From c67bb4aaa3812c7bc3d6b19d396797d2daef53e2 Mon Sep 17 00:00:00 2001 From: njbrake Date: Thu, 23 Jul 2026 12:55:57 +0000 Subject: [PATCH 1/6] fix(dashboard): persist sign-in with an HttpOnly session cookie The dashboard forced operators to re-paste the master key on every new tab, closed tab, or browser restart, because the raw key lived in per-tab sessionStorage. Signing in now exchanges the key once (POST /v1/auth/session) for a server-issued opaque session held in an HttpOnly cookie, which is both more convenient (survives tabs and restarts) and more secure (no JS-readable credential, TTL, server-side revocation). Backend: - dashboard_sessions table stores only SHA-256 token hashes, so every worker and replica accepts a session and revocation is global. - POST /v1/auth/session verifies the master key and sets the cookie (HttpOnly; SameSite=Strict; Secure mirrors the request scheme so plain-HTTP LAN deployments keep working); DELETE signs out. - The master-key auth dependencies accept the cookie only when a request carries no header credentials, so API clients are untouched. A Sec-Fetch-Site check backs up SameSite as CSRF defense in depth. - Master-key rotation revokes every session and re-mints the caller's cookie on the response, so the rotating tab stays signed in. - Session TTL is configurable via dashboard_session_ttl_hours (default 7 days). Frontend: - The raw key is sent once to mint the session and never stored; a non-secret localStorage marker keeps the signed-in state synchronous, and any 401 drops it exactly like a mid-session revocation. - Sign-out revokes the session server-side before clearing local state. Fixes #338 Co-Authored-By: Claude Fable 5 --- AGENTS.md | 2 +- ...c1e3b5d7f9_add_dashboard_sessions_table.py | 36 ++++ docs/public/openapi.json | 166 ++++++++++-------- docs/public/otari.postman_collection.json | 29 +-- src/gateway/api/deps.py | 70 +++++++- src/gateway/api/main.py | 2 + src/gateway/api/routes/auth_session.py | 92 ++++++++++ src/gateway/api/routes/settings.py | 40 ++++- src/gateway/core/config.py | 11 +- src/gateway/main.py | 6 +- src/gateway/models/entities.py | 17 ++ .../services/dashboard_session_service.py | 96 ++++++++++ .../dashboard/assets/ActivityPage-BS_KZH0z.js | 9 + .../dashboard/assets/ActivityPage-C0gVlZW-.js | 5 + .../dashboard/assets/ActivityPage-D3mR-Vcr.js | 12 ++ .../dashboard/assets/ActivityPage-Dm6r6wPy.js | 1 + .../dashboard/assets/AliasesPage-AOThQmDL.js | 1 + .../dashboard/assets/AliasesPage-DJtTC87k.js | 12 ++ .../dashboard/assets/AliasesPage-O7ZGijD-.js | 9 + .../dashboard/assets/AliasesPage-mAjq9eh5.js | 5 + .../dashboard/assets/BudgetsPage-9zpV4nTH.js | 9 + .../dashboard/assets/BudgetsPage-BCAQ5J9W.js | 12 ++ .../dashboard/assets/BudgetsPage-Us4jYLgv.js | 5 + .../dashboard/assets/BudgetsPage-o3Sj5U5B.js | 1 + .../static/dashboard/assets/Field-gj3-ox4q.js | 1 + .../dashboard/assets/KeysPage-BhG598Pa.js | 8 + .../dashboard/assets/KeysPage-CbUCEimJ.js | 4 + .../dashboard/assets/KeysPage-DAGeWeBS.js | 12 ++ .../dashboard/assets/KeysPage-DIt3Gp89.js | 12 ++ .../assets/ModelScopeControl-Bpbo36Ko.js | 1 + .../assets/ModelScopeControl-CNKA1fyP.js | 5 + .../assets/ModelScopeControl-CxWug9wa.js | 9 + .../assets/ModelScopeControl-D_p9BPKF.js | 12 ++ .../dashboard/assets/ModelsPage-BR6bzhht.js | 12 ++ .../dashboard/assets/ModelsPage-DI7qj4qI.js | 9 + .../dashboard/assets/ModelsPage-DaewNAhO.js | 5 + .../dashboard/assets/ModelsPage-WLlH9ed9.js | 1 + .../dashboard/assets/OverviewPage-BHX_G4X9.js | 1 + .../dashboard/assets/OverviewPage-BYSSsHzo.js | 5 + .../dashboard/assets/OverviewPage-DXIwdDWG.js | 1 + .../assets/ProvidersPage-BJkEklg1.js | 9 + .../assets/ProvidersPage-Bz-mLWy0.js | 1 + .../assets/ProvidersPage-swJiAs79.js | 5 + .../dashboard/assets/SettingsPage-BNeqLlOB.js | 1 + .../dashboard/assets/SettingsPage-BzPdd2gR.js | 1 + .../dashboard/assets/SettingsPage-CLdo7bKV.js | 1 + .../static/dashboard/assets/Table-DEsIhjZo.js | 1 + .../assets/ToolsGuardrailsPage-ChC-YhRl.js | 1 + .../assets/ToolsGuardrailsPage-OKm-s8Wi.js | 1 + .../assets/ToolsGuardrailsPage-qp13etCg.js | 1 + .../dashboard/assets/UsagePage-BVzIiui8.js | 5 + .../dashboard/assets/UsagePage-DLrkG3qL.js | 1 + .../dashboard/assets/UsagePage-DU8IagMv.js | 1 + .../dashboard/assets/UsersPage-BDaNeswz.js | 12 ++ .../dashboard/assets/UsersPage-BxkuFQkF.js | 5 + .../dashboard/assets/UsersPage-CNthhRRV.js | 9 + .../dashboard/assets/UsersPage-DjQ_32XA.js | 1 + .../dashboard/assets/heroui-CewI8xK4.js | 20 +++ .../static/dashboard/assets/index-CSyrpBqZ.js | 2 + .../static/dashboard/assets/index-D1FfVwkg.js | 2 + .../static/dashboard/assets/index-D6YDX-oj.js | 2 + .../dashboard/assets/index-DFtD8NLS.css | 1 + .../dashboard/assets/index-Dl_VAUga.css | 1 + .../static/dashboard/assets/react-q-ooZ0ti.js | 52 ++++++ .../assets/tanstack-query-W9y7rsMr.js | 9 + src/gateway/static/dashboard/index.html | 10 +- tests/unit/test_dashboard_session.py | 153 ++++++++++++++++ tests/unit/test_deps_db_error.py | 4 +- tests/unit/test_master_key_service.py | 8 +- web/src/App.test.tsx | 4 +- web/src/api/client.ts | 51 +++--- web/src/auth/AuthContext.test.tsx | 69 ++++++++ web/src/auth/AuthContext.tsx | 81 +++------ web/src/components/Login.test.tsx | 16 +- web/src/components/Login.tsx | 8 +- web/src/components/PricingWarning.test.tsx | 5 +- web/src/components/UpdatePrompt.test.tsx | 3 - web/src/components/UpdatePrompt.tsx | 3 +- web/src/pages/ActivityPage.test.tsx | 7 +- web/src/pages/AliasesPage.test.tsx | 5 +- web/src/pages/BudgetsPage.test.tsx | 5 +- web/src/pages/KeysPage.test.tsx | 5 +- web/src/pages/ModelsPage.test.tsx | 2 - web/src/pages/OverviewPage.test.tsx | 7 +- web/src/pages/ProvidersPage.test.tsx | 5 +- web/src/pages/SettingsPage.test.tsx | 12 +- web/src/pages/SettingsPage.tsx | 6 +- web/src/pages/ToolsGuardrailsPage.test.tsx | 5 +- web/src/pages/UsagePage.test.tsx | 5 +- web/src/pages/UsersPage.test.tsx | 5 +- 90 files changed, 1104 insertions(+), 271 deletions(-) create mode 100644 alembic/versions/a9c1e3b5d7f9_add_dashboard_sessions_table.py create mode 100644 src/gateway/api/routes/auth_session.py create mode 100644 src/gateway/services/dashboard_session_service.py create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js create mode 100644 src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js create mode 100644 src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js create mode 100644 src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js create mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js create mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js create mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js create mode 100644 src/gateway/static/dashboard/assets/Field-gj3-ox4q.js create mode 100644 src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js create mode 100644 src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js create mode 100644 src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js create mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js create mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js create mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js create mode 100644 src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js create mode 100644 src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js create mode 100644 src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js create mode 100644 src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js create mode 100644 src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js create mode 100644 src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js create mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js create mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js create mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js create mode 100644 src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js create mode 100644 src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js create mode 100644 src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js create mode 100644 src/gateway/static/dashboard/assets/Table-DEsIhjZo.js create mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js create mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js create mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js create mode 100644 src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js create mode 100644 src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js create mode 100644 src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js create mode 100644 src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js create mode 100644 src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js create mode 100644 src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js create mode 100644 src/gateway/static/dashboard/assets/heroui-CewI8xK4.js create mode 100644 src/gateway/static/dashboard/assets/index-CSyrpBqZ.js create mode 100644 src/gateway/static/dashboard/assets/index-D1FfVwkg.js create mode 100644 src/gateway/static/dashboard/assets/index-D6YDX-oj.js create mode 100644 src/gateway/static/dashboard/assets/index-DFtD8NLS.css create mode 100644 src/gateway/static/dashboard/assets/index-Dl_VAUga.css create mode 100644 src/gateway/static/dashboard/assets/react-q-ooZ0ti.js create mode 100644 src/gateway/static/dashboard/assets/tanstack-query-W9y7rsMr.js create mode 100644 tests/unit/test_dashboard_session.py create mode 100644 web/src/auth/AuthContext.test.tsx diff --git a/AGENTS.md b/AGENTS.md index 45055227..36c72f4e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,7 +69,7 @@ ORM entities are in `src/gateway/models/entities.py` (User, APIKey, Budget, Usag - Docker local build/run: `docker compose up --build` - CI Docker smoke check is implemented in `scripts/docker_liveness_check.sh`. ## Web Dashboard (`web/`) -- The standalone admin dashboard is a React + HeroUI v3 SPA in `web/` (Vite, Tailwind v4, TanStack Query). It browses the model catalogue, sets model pricing, manages aliases, adds/edits provider API keys, and toggles runtime settings; it calls the management API (`/v1/models`, `/v1/pricing`, `/v1/aliases`, `/v1/provider-credentials`, `/v1/settings`) with the master key, entered on a sign-in screen and kept only in the browser tab's session storage. +- The standalone admin dashboard is a React + HeroUI v3 SPA in `web/` (Vite, Tailwind v4, TanStack Query). It browses the model catalogue, sets model pricing, manages aliases, adds/edits provider API keys, and toggles runtime settings; it calls the management API (`/v1/models`, `/v1/pricing`, `/v1/aliases`, `/v1/provider-credentials`, `/v1/settings`) as the master key: entered once on a sign-in screen, the key is exchanged (`POST /v1/auth/session`) for an HttpOnly session cookie with a TTL (`dashboard_session_ttl_hours`, table `dashboard_sessions`), so the raw key is never persisted in the browser and a sign-in survives tab closes and restarts. The auth dependencies in `api/deps.py` accept the cookie only when a request carries no header credentials; master-key rotation revokes every session and re-mints the caller's. - Runtime provider management: the Providers page (`web/src/pages/ProvidersPage.tsx`) manages the `provider_credentials` table via `/v1/provider-credentials` (CRUD + `POST /{instance}/test`). Backend: `services/provider_store_service.py` overlays stored providers onto `config.providers` (per-config baseline on `config._provider_baseline`, refreshed by a TTL refresher wired in the lifespan like the alias refresher, standalone-only); `services/secret_box.py` encrypts keys with `OTARI_SECRET_KEY` (Fernet); `services/master_key_service.py` generates + prints a master key on first run when none is set (hash in `runtime_settings`). Keys are write-only over the API (responses expose only `last4`). - Build: `npm --prefix web ci && npm --prefix web run build`. Output goes to `src/gateway/static/dashboard/` (set in `web/vite.config.ts`), which is committed so the wheel and Docker image ship the dashboard with no Node build stage. Rebuild and commit after any change under `web/src`. - Checks: `npm --prefix web run typecheck`, `npm --prefix web test`. CI runs these and fails if the committed bundle is stale (`.github/workflows/otari-dashboard.yml`). diff --git a/alembic/versions/a9c1e3b5d7f9_add_dashboard_sessions_table.py b/alembic/versions/a9c1e3b5d7f9_add_dashboard_sessions_table.py new file mode 100644 index 00000000..4235ac17 --- /dev/null +++ b/alembic/versions/a9c1e3b5d7f9_add_dashboard_sessions_table.py @@ -0,0 +1,36 @@ +"""Add dashboard_sessions table for cookie-based dashboard sign-in. + +Revision ID: a9c1e3b5d7f9 +Revises: 7d9e1f3a5b7c +Create Date: 2026-07-23 00:00:00.000000 + +""" + +from collections.abc import Sequence + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "a9c1e3b5d7f9" +down_revision: str | Sequence[str] | None = "7d9e1f3a5b7c" +branch_labels: str | Sequence[str] | None = None +depends_on: str | Sequence[str] | None = None + + +def upgrade() -> None: + """Upgrade schema.""" + op.create_table( + "dashboard_sessions", + sa.Column("token_hash", sa.String(), nullable=False), + sa.Column("created_at", sa.DateTime(timezone=True), nullable=False), + sa.Column("expires_at", sa.DateTime(timezone=True), nullable=False), + sa.PrimaryKeyConstraint("token_hash"), + ) + op.create_index("ix_dashboard_sessions_expires_at", "dashboard_sessions", ["expires_at"]) + + +def downgrade() -> None: + """Downgrade schema.""" + op.drop_index("ix_dashboard_sessions_expires_at", table_name="dashboard_sessions") + op.drop_table("dashboard_sessions") diff --git a/docs/public/openapi.json b/docs/public/openapi.json index 861bbbda..8832ac84 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -1233,6 +1233,21 @@ "title": "CreateKeyResponse", "type": "object" }, + "CreateSessionRequest": { + "description": "Sign in to the dashboard by proving possession of the master key.", + "properties": { + "master_key": { + "description": "The gateway master key; verified once and never stored by the browser.", + "title": "Master Key", + "type": "string" + } + }, + "required": [ + "master_key" + ], + "title": "CreateSessionRequest", + "type": "object" + }, "CreateStoredProviderRequest": { "description": "Create a stored provider. ``api_key`` is write-only and requires OTARI_SECRET_KEY.", "properties": { @@ -1812,7 +1827,7 @@ "type": "object" }, "KnownProviderSchema": { - "description": "A selected provider's autofill hints for the add-provider form.", + "description": "A provider the add-provider picker can offer, with autofill hints.", "properties": { "default_api_base": { "anyOf": [ @@ -1868,27 +1883,6 @@ "title": "KnownProviderSchema", "type": "object" }, - "KnownProviderSummarySchema": { - "description": "A provider offered in the add-provider picker: id and display name only.", - "properties": { - "id": { - "description": "any-llm provider id, used as the default instance name.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Human-friendly display name.", - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "KnownProviderSummarySchema", - "type": "object" - }, "McpServerConfig": { "description": "Inline MCP server configuration accepted on the chat completions request.\n\nStreamable HTTP transport. The `url` must be reachable from the gateway process.\n\nURL safety (SSRF guard against private/link-local/reserved IP ranges, plus\nrejecting plain ``http://`` when ``authorization_token`` is set) is\nenforced by :func:`gateway.services.url_safety.validate_mcp_url`, called\nfrom the async request pipeline (``prepare_gateway_tools``) rather than\nhere at parse time: the safety check does a DNS lookup, which must be\nawaited so it can't block the event loop, and Pydantic validators run\nsynchronously during request-body parsing.", "properties": { @@ -3681,6 +3675,22 @@ "title": "RotateMasterKeyResponse", "type": "object" }, + "SessionResponse": { + "description": "A freshly minted dashboard session (the token travels only in the cookie).", + "properties": { + "expires_at": { + "description": "When the session cookie stops being accepted.", + "format": "date-time", + "title": "Expires At", + "type": "string" + } + }, + "required": [ + "expires_at" + ], + "title": "SessionResponse", + "type": "object" + }, "SetPricingRequest": { "description": "Create a versioned per-model price, with optional cache and context tiers.", "properties": { @@ -5668,6 +5678,61 @@ ] } }, + "/v1/auth/session": { + "delete": { + "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore.", + "operationId": "delete_session_v1_auth_session_delete", + "responses": { + "204": { + "description": "Successful Response" + } + }, + "summary": "Delete Session", + "tags": [ + "auth" + ] + }, + "post": { + "description": "Verify the master key and set the HttpOnly session cookie.", + "operationId": "create_session_v1_auth_session_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSessionRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Create Session", + "tags": [ + "auth" + ] + } + }, "/v1/batches": { "get": { "description": "List batches for a provider.\n\nNon-master keys only see batches they own (plus legacy batches without an\nownership marker); the page is filtered after the provider call, so a page\nmay contain fewer than ``limit`` items.", @@ -8178,7 +8243,7 @@ }, "/v1/providers/catalog": { "get": { - "description": "List every known provider for the add-provider picker: id and name only.\n\nLightweight by design so the picker never lags: provider ids come from the\nany-llm registry and names from the bundled genai-prices dataset, so no\nprovider SDK is imported. The autofill hints for a chosen provider come from\nGET /v1/providers/catalog/{provider_id}, which imports only that one SDK.\nMaster-key gated because it is operator-facing dashboard data.", + "description": "List every known provider for the add-provider picker.\n\nNetwork-free and config-independent: the full any-llm provider set with each\none's display name, credential env var, default endpoint, and whether it\nneeds a key. Master-key gated because it is operator-facing dashboard data.", "operationId": "provider_catalog_v1_providers_catalog_get", "responses": { "200": { @@ -8186,7 +8251,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/KnownProviderSummarySchema" + "$ref": "#/components/schemas/KnownProviderSchema" }, "title": "Response Provider Catalog V1 Providers Catalog Get", "type": "array" @@ -8210,57 +8275,6 @@ ] } }, - "/v1/providers/catalog/{provider_id}": { - "get": { - "description": "Autofill hints for one provider the add-provider form has selected.\n\nImports only the selected provider's any-llm module (not the whole catalog)\nto report its credential env var, default endpoint, whether a key is required,\nand whether that env var is already set on the server. Returns 404 for an\nunknown provider id. Master-key gated because it is operator-facing.\n\nThe SDK import is offloaded to a worker thread: the first fetch for a given\nprovider imports that provider's module, which would otherwise block the event\nloop (and thus every concurrent request) for the import's duration.", - "operationId": "provider_catalog_detail_v1_providers_catalog__provider_id__get", - "parameters": [ - { - "in": "path", - "name": "provider_id", - "required": true, - "schema": { - "title": "Provider Id", - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnownProviderSchema" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "XApiKeyAuth": [] - } - ], - "summary": "Provider Catalog Detail", - "tags": [ - "providers" - ] - } - }, "/v1/providers/health": { "get": { "description": "Report every configured provider's reachability, with a last-checked time.\n\nReuses the per-provider model-discovery test path, so a provider is healthy\nwhen its credentials can list models. Results are served from the discovery\ncache (cheap enough to poll), so ``checked_at`` reflects when each provider\nwas actually dialed. Pass ``refresh=true`` to force a live re-dial of every\nprovider. Master-key gated because it describes the gateway's own providers.", @@ -8489,7 +8503,7 @@ }, "/v1/settings/master-key/rotate": { "post": { - "description": "Regenerate the database-backed master key and invalidate the old one.\n\nOnly the first-run generated master key can be rotated here. When a master\nkey is supplied through config or ``OTARI_MASTER_KEY``, the dashboard cannot\ninvalidate it; the operator must change that value and restart instead.", + "description": "Regenerate the database-backed master key and invalidate the old one.\n\nOnly the first-run generated master key can be rotated here. When a master\nkey is supplied through config or ``OTARI_MASTER_KEY``, the dashboard cannot\ninvalidate it; the operator must change that value and restart instead.\n\nEvery dashboard session is revoked with the rotation (a session only proves\npossession of the now-dead key); the caller's own session is re-minted under\nthe new key so the tab that performed the rotation stays signed in.", "operationId": "rotate_master_key_v1_settings_master_key_rotate_post", "responses": { "200": { diff --git a/docs/public/otari.postman_collection.json b/docs/public/otari.postman_collection.json index f415ba9c..1c89d0ad 100644 --- a/docs/public/otari.postman_collection.json +++ b/docs/public/otari.postman_collection.json @@ -1702,7 +1702,7 @@ { "name": "Provider Catalog", "request": { - "description": "List every known provider for the add-provider picker: id and name only.\n\nLightweight by design so the picker never lags: provider ids come from the\nany-llm registry and names from the bundled genai-prices dataset, so no\nprovider SDK is imported. The autofill hints for a chosen provider come from\nGET /v1/providers/catalog/{provider_id}, which imports only that one SDK.\nMaster-key gated because it is operator-facing dashboard data.", + "description": "List every known provider for the add-provider picker.\n\nNetwork-free and config-independent: the full any-llm provider set with each\none's display name, credential env var, default endpoint, and whether it\nneeds a key. Master-key gated because it is operator-facing dashboard data.", "header": [], "method": "GET", "url": { @@ -1718,33 +1718,6 @@ } } }, - { - "name": "Provider Catalog Detail", - "request": { - "description": "Autofill hints for one provider the add-provider form has selected.\n\nImports only the selected provider's any-llm module (not the whole catalog)\nto report its credential env var, default endpoint, whether a key is required,\nand whether that env var is already set on the server. Returns 404 for an\nunknown provider id. Master-key gated because it is operator-facing.\n\nThe SDK import is offloaded to a worker thread: the first fetch for a given\nprovider imports that provider's module, which would otherwise block the event\nloop (and thus every concurrent request) for the import's duration.", - "header": [], - "method": "GET", - "url": { - "host": [ - "{{baseUrl}}" - ], - "path": [ - "v1", - "providers", - "catalog", - ":provider_id" - ], - "raw": "{{baseUrl}}/v1/providers/catalog/:provider_id", - "variable": [ - { - "description": "path parameter", - "key": "provider_id", - "value": "" - } - ] - } - } - }, { "name": "Provider Health", "request": { diff --git a/src/gateway/api/deps.py b/src/gateway/api/deps.py index 833f68fc..902e76d3 100644 --- a/src/gateway/api/deps.py +++ b/src/gateway/api/deps.py @@ -14,6 +14,7 @@ from gateway.log_config import logger from gateway.metrics import record_auth_failure from gateway.models.entities import APIKey +from gateway.services.dashboard_session_service import SESSION_COOKIE_NAME, is_valid_dashboard_session from gateway.services.file_store import FileStore from gateway.services.log_writer import LogWriter from gateway.services.master_key_service import hash_master_key, is_generated_master_key, load_master_key_hash @@ -179,7 +180,55 @@ async def _bump_last_used_at(api_key_id: str, now: datetime) -> None: logger.warning("Failed to update last_used_at for API key %s", api_key_id, exc_info=True) -async def _is_valid_master_key(token: str, config: GatewayConfig, db: AsyncSession) -> bool: +def _header_credentials_present(request: Request) -> bool: + """Whether the request carries any of the header credential forms. + + Header credentials always win over the dashboard session cookie: an API + client that sends a key gets exactly today's behavior (including failures), + and the cookie is only consulted for requests that present nothing else, + i.e. the browser-driven dashboard. + """ + return bool( + request.headers.get(API_KEY_HEADER) + or request.headers.get("Authorization") + or request.headers.get(X_API_KEY_HEADER) + ) + + +# Sec-Fetch-Site values under which a cookie may authenticate a request: +# same-origin fetches (the dashboard itself) and non-site-initiated requests +# ("none", e.g. a direct navigation). "same-site" is deliberately excluded, so a +# sibling-subdomain page cannot ride the cookie. +_COOKIE_SAFE_FETCH_SITES = ("same-origin", "none") + + +async def _session_cookie_authenticates(request: Request, config: GatewayConfig, db: AsyncSession) -> bool: + """Whether a valid dashboard session cookie grants master-key authority. + + ``SameSite=Strict`` on the cookie is the primary CSRF control; the + Sec-Fetch-Site check is belt-and-braces for clients that send the header. + Standalone-only: hybrid mode has no dashboard or management API. + """ + if config.is_hybrid_mode: + return False + token = request.cookies.get(SESSION_COOKIE_NAME) + if not token: + return False + fetch_site = request.headers.get("Sec-Fetch-Site") + if fetch_site is not None and fetch_site not in _COOKIE_SAFE_FETCH_SITES: + record_auth_failure("cross_site_cookie") + return False + try: + return await is_valid_dashboard_session(db, token) + except SQLAlchemyError as exc: + record_auth_failure("db_error") + raise HTTPException( + status_code=status.HTTP_503_SERVICE_UNAVAILABLE, + detail="Authentication temporarily unavailable, please retry", + ) from exc + + +async def is_valid_master_key(token: str, config: GatewayConfig, db: AsyncSession) -> bool: """Check if token matches the configured key or the current generated key.""" if config.master_key is not None and secrets.compare_digest(token, config.master_key): return True @@ -232,17 +281,23 @@ async def verify_master_key( request: Request, db: Annotated[AsyncSession, Depends(get_db)], config: Annotated[GatewayConfig, Depends(get_config)], -) -> str: - """Verify master key from Otari-Key header. +) -> str | None: + """Verify master key from Otari-Key header or the dashboard session cookie. Args: request: FastAPI request object config: Gateway configuration + Returns: + The raw master key when header-authenticated, or None when a dashboard + session cookie authenticated the request (the raw key is not available). + Raises: HTTPException: If master key is not configured or invalid """ + if not _header_credentials_present(request) and await _session_cookie_authenticates(request, config, db): + return None token = _extract_bearer_token(request, config) if config.master_key is None: @@ -270,6 +325,9 @@ async def verify_api_key_or_master_key( ) -> tuple[APIKey | None, bool]: """Verify either API key or master key from Otari-Key header. + A valid dashboard session cookie also grants master-key authority, but only + when the request carries no header credentials at all. + Args: request: FastAPI request object db: Database session @@ -282,9 +340,12 @@ async def verify_api_key_or_master_key( HTTPException: If key is invalid, inactive, or expired """ + if not _header_credentials_present(request) and await _session_cookie_authenticates(request, config, db): + return None, True + token = _extract_bearer_token(request, config) - if await _is_valid_master_key(token, config, db): + if await is_valid_master_key(token, config, db): return None, True api_key = await _verify_and_update_api_key(db, token) @@ -322,6 +383,7 @@ def get_file_store(request: Request) -> FileStore: "get_db_if_needed", "get_file_store", "get_log_writer", + "is_valid_master_key", "verify_api_key", "verify_api_key_or_master_key", "verify_master_key", diff --git a/src/gateway/api/main.py b/src/gateway/api/main.py index 021858d2..ccbb9d4c 100644 --- a/src/gateway/api/main.py +++ b/src/gateway/api/main.py @@ -3,6 +3,7 @@ from gateway.api.routes import ( aliases, audio, + auth_session, batches, budgets, chat, @@ -39,6 +40,7 @@ def register_routers(app: FastAPI, config: GatewayConfig) -> None: app.include_router(hybrid_mode.router) return # Remaining routers (including batches) are standalone-mode only + app.include_router(auth_session.router) app.include_router(embeddings.router) app.include_router(images.router) app.include_router(audio.router) diff --git a/src/gateway/api/routes/auth_session.py b/src/gateway/api/routes/auth_session.py new file mode 100644 index 00000000..43ec9332 --- /dev/null +++ b/src/gateway/api/routes/auth_session.py @@ -0,0 +1,92 @@ +"""Dashboard sign-in sessions (standalone mode only). + +``POST /v1/auth/session`` exchanges the master key for a server-issued session +held in an HttpOnly cookie, so the dashboard never persists the raw key in the +browser and a sign-in survives tab closes and restarts. ``DELETE`` is sign-out. +The cookie is honored by the master-key auth dependencies in +``gateway.api.deps`` when a request carries no header credentials. +""" + +from datetime import datetime +from typing import Annotated + +from fastapi import APIRouter, Depends, HTTPException, Request, Response, status +from pydantic import BaseModel, Field +from sqlalchemy.exc import SQLAlchemyError +from sqlalchemy.ext.asyncio import AsyncSession + +from gateway.api.deps import get_config, get_db, is_valid_master_key +from gateway.core.config import GatewayConfig +from gateway.metrics import record_auth_failure +from gateway.services.dashboard_session_service import ( + SESSION_COOKIE_NAME, + apply_session_cookie, + clear_session_cookie, + create_dashboard_session, + revoke_dashboard_session, +) + +router = APIRouter(prefix="/v1/auth/session", tags=["auth"]) + + +class CreateSessionRequest(BaseModel): + """Sign in to the dashboard by proving possession of the master key.""" + + master_key: str = Field(description="The gateway master key; verified once and never stored by the browser.") + + +class SessionResponse(BaseModel): + """A freshly minted dashboard session (the token travels only in the cookie).""" + + expires_at: datetime = Field(description="When the session cookie stops being accepted.") + + +@router.post("") +async def create_session( + body: CreateSessionRequest, + request: Request, + response: Response, + db: Annotated[AsyncSession, Depends(get_db)], + config: Annotated[GatewayConfig, Depends(get_config)], +) -> SessionResponse: + """Verify the master key and set the HttpOnly session cookie.""" + if not await is_valid_master_key(body.master_key, config, db): + record_auth_failure("invalid_key") + raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid master key") + try: + token, expires_at = await create_dashboard_session(db, config.dashboard_session_ttl_hours) + await db.commit() + except SQLAlchemyError: + await db.rollback() + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail="Database error", + ) from None + apply_session_cookie(response, token, expires_at, secure=request.url.scheme == "https") + return SessionResponse(expires_at=expires_at) + + +@router.delete("", status_code=status.HTTP_204_NO_CONTENT) +async def delete_session( + request: Request, + response: Response, + db: Annotated[AsyncSession, Depends(get_db)], +) -> None: + """Sign out: revoke the cookie's session server-side and expire the cookie. + + Deliberately unauthenticated and idempotent: it only ever revokes the + session named by the caller's own cookie, and the dashboard calls it on the + 401-bounce path where no valid credential exists anymore. + """ + token = request.cookies.get(SESSION_COOKIE_NAME) + if token: + try: + await revoke_dashboard_session(db, token) + await db.commit() + except SQLAlchemyError: + await db.rollback() + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail="Database error", + ) from None + clear_session_cookie(response) diff --git a/src/gateway/api/routes/settings.py b/src/gateway/api/routes/settings.py index e63fff80..9c50df11 100644 --- a/src/gateway/api/routes/settings.py +++ b/src/gateway/api/routes/settings.py @@ -17,16 +17,23 @@ from typing import Annotated, Any, Literal from urllib.parse import parse_qsl, quote, urlencode, urlsplit, urlunsplit -from fastapi import APIRouter, Depends, HTTPException, status +from fastapi import APIRouter, Depends, HTTPException, Request, Response, status from pydantic import BaseModel, Field from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.ext.asyncio import AsyncSession from gateway.api.deps import get_config, get_db, verify_master_key from gateway.core.config import GatewayConfig +from gateway.services.dashboard_session_service import ( + SESSION_COOKIE_NAME, + apply_session_cookie, + create_dashboard_session, + revoke_all_dashboard_sessions, +) from gateway.services.master_key_service import ( MasterKeyRotationConflictError, hash_master_key, + load_master_key_hash, stage_generated_master_key_rotation, ) from gateway.services.runtime_settings_service import ( @@ -350,23 +357,48 @@ async def update_settings( @router.post("/master-key/rotate", dependencies=[Depends(verify_master_key)]) async def rotate_master_key( + request: Request, + response: Response, db: Annotated[AsyncSession, Depends(get_db)], config: Annotated[GatewayConfig, Depends(get_config)], - authenticated_key: Annotated[str, Depends(verify_master_key)], + authenticated_key: Annotated[str | None, Depends(verify_master_key)], ) -> RotateMasterKeyResponse: """Regenerate the database-backed master key and invalidate the old one. Only the first-run generated master key can be rotated here. When a master key is supplied through config or ``OTARI_MASTER_KEY``, the dashboard cannot invalidate it; the operator must change that value and restart instead. + + Every dashboard session is revoked with the rotation (a session only proves + possession of the now-dead key); the caller's own session is re-minted under + the new key so the tab that performed the rotation stays signed in. """ if config.master_key is not None: raise HTTPException( status_code=status.HTTP_409_CONFLICT, detail="This gateway uses a configured master key; change OTARI_MASTER_KEY or config.yml and restart.", ) + # A cookie-authenticated caller has no raw key to hash; the stored hash is + # the same value, so the rotation CAS still rejects a concurrent rotation. + if authenticated_key is not None: + current_hash = hash_master_key(authenticated_key) + else: + stored_hash = await load_master_key_hash(db) + if stored_hash is None: + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail="The master key was already rotated. Reload and try again.", + ) + current_hash = stored_hash + session_token: str | None = None + session_expires_at = None try: - token, hashed = await stage_generated_master_key_rotation(db, hash_master_key(authenticated_key)) + token, hashed = await stage_generated_master_key_rotation(db, current_hash) + await revoke_all_dashboard_sessions(db) + if SESSION_COOKIE_NAME in request.cookies: + session_token, session_expires_at = await create_dashboard_session( + db, config.dashboard_session_ttl_hours + ) await db.commit() except MasterKeyRotationConflictError as exc: await db.rollback() @@ -375,4 +407,6 @@ async def rotate_master_key( await db.rollback() raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Database error") from None config._master_key_hash = hashed + if session_token is not None and session_expires_at is not None: + apply_session_cookie(response, session_token, session_expires_at, secure=request.url.scheme == "https") return RotateMasterKeyResponse(master_key=token) diff --git a/src/gateway/core/config.py b/src/gateway/core/config.py index b117d98f..8fa18fbc 100644 --- a/src/gateway/core/config.py +++ b/src/gateway/core/config.py @@ -169,7 +169,7 @@ class GatewayConfig(BaseSettings): # Treat an empty OTARI_ env var as unset, matching the empty-skip # in _apply_otari_env_overrides. Without this, a blank OTARI_MASTER_KEY # (common from container templating) would read as "" instead of None, - # and an empty bearer token would then satisfy _is_valid_master_key. + # and an empty bearer token would then satisfy is_valid_master_key. env_ignore_empty=True, ) @@ -203,6 +203,15 @@ class GatewayConfig(BaseSettings): host: str = Field(default="0.0.0.0", description="Host to bind the server to") # noqa: S104 port: int = Field(default=8000, description="Port to bind the server to") master_key: str | None = Field(default=None, description="Master key for protecting management endpoints") + dashboard_session_ttl_hours: int = Field( + default=168, + ge=1, + description=( + "How long a dashboard sign-in stays valid, in hours. Signing in to the admin " + "dashboard exchanges the master key for an HttpOnly session cookie with this " + "lifetime; the master key itself never expires." + ), + ) rate_limit_rpm: int | None = Field( default=None, ge=1, description="Maximum requests per minute per user (None disables rate limiting)" ) diff --git a/src/gateway/main.py b/src/gateway/main.py index 5a8a099a..dd31856c 100644 --- a/src/gateway/main.py +++ b/src/gateway/main.py @@ -42,6 +42,10 @@ from gateway.version import __version__ _PUBLIC_PREFIXES = ("/health",) +# Paths authenticated by the master key in the request body (sign-in) or the +# session cookie (sign-out) rather than the header schemes; the OpenAPI +# security stamp below skips them. They still get the no-store cache headers. +_COOKIE_AUTH_PREFIXES = ("/v1/auth/session",) # Public, unauthenticated static assets that shared caches may keep. Paths here # set their own Cache-Control at the route (favicon.svg), so the middleware only # fills one in when it is missing. @@ -223,7 +227,7 @@ def custom_openapi() -> dict[str, Any]: } for path, path_item in openapi_schema.get("paths", {}).items(): - if path.startswith(_PUBLIC_PREFIXES): + if path.startswith(_PUBLIC_PREFIXES) or path.startswith(_COOKIE_AUTH_PREFIXES): continue for operation in path_item.values(): if isinstance(operation, dict): diff --git a/src/gateway/models/entities.py b/src/gateway/models/entities.py index 00085bfd..8d7e8385 100644 --- a/src/gateway/models/entities.py +++ b/src/gateway/models/entities.py @@ -203,6 +203,23 @@ class RuntimeSetting(Base): ) +class DashboardSession(Base): + """A server-side admin-dashboard sign-in session. + + Minted when an operator signs in to the dashboard with the master key: the + browser holds only an opaque token in an HttpOnly cookie and this table + stores the token's SHA-256 hash, so neither the master key nor a usable + session credential is ever persisted in JS-readable storage. Sessions + expire on a TTL and are revoked on sign-out and on master-key rotation. + """ + + __tablename__ = "dashboard_sessions" + + token_hash: Mapped[str] = mapped_column(primary_key=True) + created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC)) + expires_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), index=True) + + class PricingSnapshot(Base): """An approved, source-tagged upstream pricing catalog.""" diff --git a/src/gateway/services/dashboard_session_service.py b/src/gateway/services/dashboard_session_service.py new file mode 100644 index 00000000..63ac090c --- /dev/null +++ b/src/gateway/services/dashboard_session_service.py @@ -0,0 +1,96 @@ +"""Dashboard sign-in sessions. + +Signing in to the admin dashboard exchanges the master key for a server-issued +session: an opaque token handed to the browser in an HttpOnly cookie, with only +its SHA-256 hash stored in the ``dashboard_sessions`` table. This lets a +sign-in survive tab closes and browser restarts without ever persisting the +master key (or any JS-readable credential) in the browser. + +Sessions live in the database, not process memory, so every worker and replica +accepts them and a revocation is seen everywhere. They expire on a TTL +(``dashboard_session_ttl_hours``) and are revoked on sign-out and on master-key +rotation. +""" + +import hashlib +import secrets +from datetime import UTC, datetime, timedelta + +from fastapi import Response +from sqlalchemy import delete +from sqlalchemy.ext.asyncio import AsyncSession + +from gateway.models.entities import DashboardSession + +SESSION_COOKIE_NAME = "otari_dashboard_session" +_SESSION_TOKEN_PREFIX = "otari-sess-" + + +def hash_session_token(token: str) -> str: + """SHA-256 hex of a session token; only the hash is ever stored.""" + return hashlib.sha256(token.encode()).hexdigest() + + +def _as_utc(value: datetime) -> datetime: + """Treat a naive stored datetime as the UTC it was written as (SQLite).""" + return value if value.tzinfo is not None else value.replace(tzinfo=UTC) + + +async def create_dashboard_session(db: AsyncSession, ttl_hours: int) -> tuple[str, datetime]: + """Stage a new session row and return ``(token, expires_at)``. + + Expired rows are pruned opportunistically here, so the table stays small + without a background task. The caller owns the transaction and must commit + before handing the token to the browser. + """ + now = datetime.now(UTC) + await db.execute(delete(DashboardSession).where(DashboardSession.expires_at < now)) + token = f"{_SESSION_TOKEN_PREFIX}{secrets.token_urlsafe(32)}" + expires_at = now + timedelta(hours=ttl_hours) + db.add(DashboardSession(token_hash=hash_session_token(token), created_at=now, expires_at=expires_at)) + return token, expires_at + + +async def is_valid_dashboard_session(db: AsyncSession, token: str) -> bool: + """Whether a session token matches a stored, unexpired session.""" + row = await db.get(DashboardSession, hash_session_token(token)) + if row is None: + return False + return _as_utc(row.expires_at) >= datetime.now(UTC) + + +async def revoke_dashboard_session(db: AsyncSession, token: str) -> None: + """Stage removal of one session (sign-out). The caller commits.""" + await db.execute(delete(DashboardSession).where(DashboardSession.token_hash == hash_session_token(token))) + + +async def revoke_all_dashboard_sessions(db: AsyncSession) -> None: + """Stage removal of every session (master-key rotation). The caller commits.""" + await db.execute(delete(DashboardSession)) + + +def apply_session_cookie(response: Response, token: str, expires_at: datetime, *, secure: bool) -> None: + """Set the session cookie with its security attributes in one place. + + ``secure`` mirrors the request scheme rather than being hard-coded: a plain + HTTP deployment (LAN, localhost without TLS) would otherwise never receive + the cookie back. That is no worse than such a deployment already sending the + raw master key in cleartext today. ``SameSite=Strict`` keeps cross-site + requests from carrying the cookie, which is the primary CSRF control here + (the dashboard and API are same-origin). + """ + max_age = max(0, int((expires_at - datetime.now(UTC)).total_seconds())) + response.set_cookie( + SESSION_COOKIE_NAME, + token, + max_age=max_age, + httponly=True, + secure=secure, + samesite="strict", + path="/", + ) + + +def clear_session_cookie(response: Response) -> None: + """Expire the session cookie in the browser (sign-out).""" + response.delete_cookie(SESSION_COOKIE_NAME, path="/") diff --git a/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js b/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js new file mode 100644 index 00000000..a2889361 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D6YDX-oj.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js b/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js new file mode 100644 index 00000000..aa520429 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js b/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js index 4b472d13..c63df734 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-Dp4DdBFR.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D6YDX-oj.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js b/src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js new file mode 100644 index 00000000..49c7c7a2 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js b/src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js new file mode 100644 index 00000000..6eb1c32d --- /dev/null +++ b/src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js b/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js index f1bc1ca5..430c3568 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-Dp4DdBFR.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D6YDX-oj.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js diff --git a/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js b/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js new file mode 100644 index 00000000..93b3cf4e --- /dev/null +++ b/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D6YDX-oj.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js diff --git a/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js b/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js new file mode 100644 index 00000000..0cec29e1 --- /dev/null +++ b/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js b/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js new file mode 100644 index 00000000..02afb5b8 --- /dev/null +++ b/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D6YDX-oj.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js b/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js index 4ff65f87..0c78cf1c 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-Dp4DdBFR.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D6YDX-oj.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js b/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js new file mode 100644 index 00000000..f7c80984 --- /dev/null +++ b/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js b/src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js new file mode 100644 index 00000000..c1daab44 --- /dev/null +++ b/src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js b/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js new file mode 100644 index 00000000..46815ed0 --- /dev/null +++ b/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{T as n,L as o,I as c,D as d}from"./heroui-CewI8xK4.js";function j({label:s,value:a,onChange:x,placeholder:r,type:l="text",isRequired:m,description:e,autoFocus:i}){return t.jsxs(n,{value:a,onChange:x,isRequired:m,className:"flex max-w-md flex-col gap-1",children:[t.jsx(o,{className:"text-sm font-medium text-[var(--otari-ink)]",children:s}),t.jsx(c,{type:l,placeholder:r,autoFocus:i}),e?t.jsx(d,{className:"text-xs text-[var(--otari-muted)]",children:e}):null]})}export{j as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js b/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js new file mode 100644 index 00000000..cb36b417 --- /dev/null +++ b/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js @@ -0,0 +1,8 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js +`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` +`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` +`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js b/src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js new file mode 100644 index 00000000..b4c84f25 --- /dev/null +++ b/src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js @@ -0,0 +1,4 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` +`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` +`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js b/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js new file mode 100644 index 00000000..7b97df75 --- /dev/null +++ b/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js @@ -0,0 +1,12 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D6YDX-oj.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-CxWug9wa.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` +`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` +`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js b/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js index ea9cbb42..4b673354 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js +++ b/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js @@ -1,4 +1,16 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-Dp4DdBFR.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-D_p9BPKF.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D6YDX-oj.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-CxWug9wa.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js `).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js b/src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js new file mode 100644 index 00000000..3dd1b6f5 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js b/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js new file mode 100644 index 00000000..f625426c --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======== +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js b/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js new file mode 100644 index 00000000..5a194cb5 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-D6YDX-oj.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======== +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js b/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js index ae6a92a0..da51fab2 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-Dp4DdBFR.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-D6YDX-oj.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +======== +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js b/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js index 658c5198..954753dc 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-Dp4DdBFR.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D6YDX-oj.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js b/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js new file mode 100644 index 00000000..83406d25 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D6YDX-oj.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js b/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js new file mode 100644 index 00000000..9a652e2f --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js b/src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js new file mode 100644 index 00000000..4f4efda0 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js b/src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js new file mode 100644 index 00000000..7453bb5e --- /dev/null +++ b/src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as f,i as Z,N as G}from"./react-dgEcD0HR.js";import{J as tt,c as N,K as et,j as rt,p as at,u as st,a as nt,L as _,P as ot,E as Y,S as p,M as D,N as R,z as E,O as k,Q as it}from"./index-D6YDX-oj.js";import{S as H}from"./charts-Cr3Dij9t.js";import{T as lt,a as dt,b,L as ct,c as ut,d as xt,e as j}from"./Table-CLdjdyTx.js";import{d as B,B as mt}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function U(e){return e==="neutral"?void 0:e}const vt=.02,ht=.1;function F(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=ht?"alert":n>=vt?"warn":"ok";return{rate:n,status:a}}function pt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ft=.8;function gt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(s=>s.max_budget!==null&&s.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,r=0,c,m=-1;for(const s of n){const o=s.max_budget*s.user_count,i=o>0?s.total_spend/o:0;i>=1?a+=1:i>=ft&&(r+=1),i>m&&(m=i,c={name:s.name??s.budget_id,spent:s.total_spend,allocated:o,pct:i})}const u=a>0?"alert":r>0?"warn":"ok",g=a>0?`${a} over limit`:r>0?`${r} near limit`:"All within budget";return{status:u,label:g,overCount:a,nearCount:r,cappedCount:n.length,worst:c}}const K=864e5,W=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function bt(){const[e,n]=f.useState(I);return f.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const r=I();n(c=>c===r?c:r)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),f.useMemo(()=>{const a=Date.now(),r=new Date(a);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(a-W*K).toISOString(),prevStart:new Date(a-2*W*K).toISOString()}},[e])}const jt={ok:"Healthy",warn:"Elevated",alert:"High"},St={ok:"On track",warn:"Near limit",alert:"Over budget"};function Pt(){const e=tt();return e.isLoading?null:t.jsx(yt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function yt({needsSetup:e=!1}){var $,A,P,T,M,q;const n=bt(),a=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),c=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=N(a,"hour"),u=N(r,"day"),g=N(c,"day"),s=et(),o=rt(),i=at(),S=st(),y=nt({},0,5),C=($=m.data)==null?void 0:$.totals,x=(A=u.data)==null?void 0:A.totals,v=(P=g.data)==null?void 0:P.totals,w=((T=u.data)==null?void 0:T.series)??[],O=w.length>1,l=F(x),L=F(v),z=l.rate!==null&&L.rate!==null?_(l.rate,L.rate):null,d=gt(o.data??[]),J=pt(s.data),Q=(i.data??[]).filter(h=>h.is_active).length,V=(S.data??[]).filter(h=>!h.blocked).length,X=m.error??u.error??s.error??o.error??i.error??S.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ot,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(wt,{}):null,t.jsx(Y,{error:X}),t.jsx(_t,{providerHealth:J,healthy:((M=s.data)==null?void 0:M.healthy)??0,total:((q=s.data)==null?void 0:q.total)??0,budget:d,errStatus:l.status,errRate:l.rate,ready:s.isSuccess&&o.isSuccess&&u.isSuccess,failed:s.isError||o.isError||u.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(p,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(p,{label:"Spend, last 30 days",value:x?D(x.cost):"—",hint:x?t.jsx(R,{fraction:_(x.cost,v==null?void 0:v.cost)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Requests, last 30 days",value:x?E(x.request_count):"—",hint:x?t.jsx(R,{fraction:_(x.request_count,v==null?void 0:v.request_count)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Error rate, last 30 days",value:l.rate===null?"—":k(l.rate),status:U(l.status),statusLabel:l.status==="neutral"?void 0:jt[l.status],hint:l.rate!==null?t.jsx(R,{fraction:z}):null}),t.jsx(p,{label:"Budget health",value:o.data&&d.worst?k(d.worst.pct):"—",status:o.data?U(d.status):void 0,statusLabel:o.data&&d.status!=="neutral"?St[d.status]:void 0,hint:o.data?d.worst?`${d.label} · worst: ${d.worst.name}`:d.label:void 0,to:"/budgets"}),t.jsx(p,{label:"Active keys",value:i.data?E(Q):"—",to:"/keys"}),t.jsx(p,{label:"Active users",value:S.data?E(V):"—",to:"/users"})]}),t.jsx(Et,{entries:y.data??[],loading:y.isLoading,error:y.error})]})}function wt(){const e=Z();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(mt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Nt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function _t({providerHealth:e,healthy:n,total:a,budget:r,errStatus:c,errRate:m,ready:u,failed:g}){if(g)return t.jsx(Nt,{text:"Some status data could not be loaded."});if(!u)return null;const s=[];if((e==="warn"||e==="alert")&&a>0){const o=a-n;s.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),c==="alert"&&m!==null&&s.push({text:`error rate ${k(m)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(G,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function Rt(e){return e==="error"?"error":"ok"}function Et({entries:e,loading:n,error:a}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(G,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsxs(lt,{children:[t.jsx(dt,{children:t.jsxs("tr",{children:[t.jsx(b,{children:"Time"}),t.jsx(b,{children:"Model"}),t.jsx(b,{className:"text-right",children:"Cost"}),t.jsx(b,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(ct,{colSpan:4}):e.length===0?t.jsx(ut,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(xt,{children:[t.jsx(j,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:it(r.timestamp)})}),t.jsx(j,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(j,{className:"text-right tabular-nums",children:r.cost===null?"—":D(r.cost)}),t.jsx(j,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Rt(r.status)})})]},r.id))})]})]})}export{Pt as OverviewIndex,yt as OverviewPage,I as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js b/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js new file mode 100644 index 00000000..c874cabc --- /dev/null +++ b/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-CSyrpBqZ.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; +======== +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-D1FfVwkg.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js diff --git a/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js b/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js new file mode 100644 index 00000000..4cf0debf --- /dev/null +++ b/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-D1FfVwkg.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js b/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js new file mode 100644 index 00000000..b4564f0e --- /dev/null +++ b/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Q}from"./react-dgEcD0HR.js";import{J as X,R as Z,B as ee,K as te,T as se,U as ae,V as ne,P as re,E as B,C as ie,W as oe,X as le,Q as z,h as U,Y as M,Z as Y,_ as de}from"./index-D6YDX-oj.js";import{F as _}from"./Field-HzRk1KDP.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-CLdjdyTx.js";import{B as j,f as H,d as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-BX6JwHY-.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=X(),s=Z(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(Q,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-CSyrpBqZ.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js b/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js new file mode 100644 index 00000000..b3e3d28e --- /dev/null +++ b/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js b/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js new file mode 100644 index 00000000..118dac28 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-CSyrpBqZ.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js diff --git a/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js b/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js new file mode 100644 index 00000000..326bf2a5 --- /dev/null +++ b/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{B as R,W as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,a4 as O,T as F,a5 as K,I as w}from"./index-CSyrpBqZ.js";import{c as v,B as h,A as d,g as I,I as M}from"./heroui-CewI8xK4.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function B(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function L({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),c=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const o=Number(n),g=n.trim()!==""&&Number.isFinite(o)&&(c||Number.isInteger(o)),m=t.minimum??void 0,p=t.exclusive_minimum??void 0,x=p!==void 0?o>p:m!==void 0?o>=m:o>=0,l=g&&x&&o!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{type:"number",min:"0",step:c?"any":"1",inputMode:c?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(o),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const c=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:o=>i(o.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!c,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(L,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[c,o]=u.useState(!1),g=async()=>{var m,p,x;(m=a.current)==null||m.focus(),(p=a.current)==null||p.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(t),i(!0),o(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}o(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:g,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),c?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var c,o;t!==void 0&&((c=i.current)==null||c.focus(),(o=i.current)==null||o.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=A(),{replaceMasterKey:s}=O(),[a,n]=u.useState(!1),[i,c]=u.useState(),o=t==="generated",g=()=>r.mutate(void 0,{onSuccess:x=>{c(x.master_key),s(x.master_key)}}),m=()=>{n(!1),c(void 0),r.reset()},p=x=>{x?(r.reset(),n(!0)):i===void 0&&m()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:a,onOpenChange:p,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),a?e.jsx(G,{masterKey:i,error:r.error,isPending:r.isPending,onRegenerate:g,onClose:m}):null]})]})})}function X(){var c;const t=F(),r=K(),s=r.data,a=((c=t.data)==null?void 0:c.length)??0,n=(t.data??[]).filter(o=>!o.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:c=>c?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[c,o]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=g.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),p=(s==null?void 0:s.config)??[],x=p.filter(l=>(c?l.settable:!0)&&B(l,n)),k=ee(x);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:g,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:l=>o(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",x.length," of ",p.length," settings"]}):null,s&&x.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,B as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js b/src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js new file mode 100644 index 00000000..0b221458 --- /dev/null +++ b/src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{B as R,W as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,T as O,a4 as F,I as w}from"./index-D1FfVwkg.js";import{c as v,B as h,A as d,g as I,I as K}from"./heroui-CewI8xK4.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function M(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function L({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function H(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function Y({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx(L,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:H(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function q({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(Y,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function V({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function G({source:t}){const r=A(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(V,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function W(){var o;const t=O(),r=F(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function X({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(G,{source:t}),e.jsx(W,{})]})})]})}function J({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Q(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(J,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function Z(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ae(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&M(l,n)),k=Z(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(q,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Q,{}):null,s?e.jsx(X,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ae as SettingsPage,M as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js b/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js new file mode 100644 index 00000000..6bfa24f3 --- /dev/null +++ b/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{B as R,V as C,P,E as y,$ as E,a0 as T,a1 as _,F as D,a2 as A,a3 as O,R as F,a4 as K,I as w}from"./index-D6YDX-oj.js";import{d as v,B as h,A as d,g as I,I as M}from"./heroui-BX6JwHY-.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function B(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function $({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function L({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),c=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const o=Number(n),g=n.trim()!==""&&Number.isFinite(o)&&(c||Number.isInteger(o)),m=t.minimum??void 0,p=t.exclusive_minimum??void 0,x=p!==void 0?o>p:m!==void 0?o>=m:o>=0,l=g&&x&&o!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{type:"number",min:"0",step:c?"any":"1",inputMode:c?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(o),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const c=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:o=>i(o.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!c,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx($,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx(L,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[c,o]=u.useState(!1),g=async()=>{var m,p,x;(m=a.current)==null||m.focus(),(p=a.current)==null||p.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(t),i(!0),o(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}o(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:g,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),c?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var c,o;t!==void 0&&((c=i.current)==null||c.focus(),(o=i.current)==null||o.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=A(),{replaceMasterKey:s}=O(),[a,n]=u.useState(!1),[i,c]=u.useState(),o=t==="generated",g=()=>r.mutate(void 0,{onSuccess:x=>{c(x.master_key),s(x.master_key)}}),m=()=>{n(!1),c(void 0),r.reset()},p=x=>{x?(r.reset(),n(!0)):i===void 0&&m()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:a,onOpenChange:p,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),a?e.jsx(G,{masterKey:i,error:r.error,isPending:r.isPending,onRegenerate:g,onClose:m}):null]})]})})}function J(){var c;const t=F(),r=K(),s=r.data,a=((c=t.data)==null?void 0:c.length)??0,n=(t.data??[]).filter(o=>!o.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function Q({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(J,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:c=>c?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[c,o]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=g.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),p=(s==null?void 0:s.config)??[],x=p.filter(l=>(c?l.settable:!0)&&B(l,n)),k=ee(x);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:g,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:l=>o(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",x.length," of ",p.length," settings"]}):null,s&&x.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(Q,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,B as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js b/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js new file mode 100644 index 00000000..cec5d22d --- /dev/null +++ b/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js @@ -0,0 +1 @@ +import{j as r}from"./tanstack-query-W9y7rsMr.js";import{r as c}from"./react-q-ooZ0ti.js";import{S as f}from"./heroui-CewI8xK4.js";const p=60,h=c.createContext(null);function w({children:n}){const[t,s]=c.useState(null),i=c.useCallback(e=>{s(o=>o||Array.from(e.cells,l=>Math.max(p,Math.round(l.getBoundingClientRect().width))))},[]),u=c.useCallback((e,o)=>{s(l=>{if(!l)return l;const d=l.slice();return d[e]=Math.max(p,Math.round(o)),d})},[]),x={widths:t,pinWidths:i,setColumnWidth:u},a=t?t.reduce((e,o)=>e+o,0):null;return r.jsx(h.Provider,{value:x,children:r.jsx("div",{className:"overflow-x-auto rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)]",children:r.jsxs("table",{className:`border-collapse text-sm ${t?"table-fixed":"w-full"}`,style:a?{width:`${a}px`}:void 0,children:[t?r.jsx("colgroup",{children:t.map((e,o)=>r.jsx("col",{style:{width:`${e}px`}},o))}):null,n]})})})}function C({children:n}){return r.jsx("thead",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-left",children:n})}function b({resize:n}){const t=c.useRef(null),s=c.useRef(null),i=a=>{var l,d;const e=(l=t.current)==null?void 0:l.closest("th"),o=e==null?void 0:e.parentElement;!e||!(o instanceof HTMLTableRowElement)||(a.preventDefault(),a.stopPropagation(),n.pinWidths(o),(d=t.current)==null||d.setPointerCapture(a.pointerId),s.current={index:e.cellIndex,startX:a.clientX,startWidth:e.getBoundingClientRect().width})},u=a=>{var o;const e=s.current;!e||!((o=t.current)!=null&&o.hasPointerCapture(a.pointerId))||n.setColumnWidth(e.index,e.startWidth+(a.clientX-e.startX))},x=a=>{var e;(e=t.current)!=null&&e.hasPointerCapture(a.pointerId)&&t.current.releasePointerCapture(a.pointerId),s.current=null};return r.jsx("span",{ref:t,"aria-hidden":!0,title:"Drag to resize",onPointerDown:i,onPointerMove:u,onPointerUp:x,onPointerCancel:x,className:"group absolute top-0 right-0 z-10 flex h-full w-2 cursor-col-resize touch-none select-none justify-end",children:r.jsx("span",{className:"h-full w-px bg-[var(--otari-line)] transition-all group-hover:w-0.5 group-hover:bg-[var(--otari-brand)]"})})}function N({children:n,className:t="",ariaSort:s}){const i=c.useContext(h);return r.jsxs("th",{"aria-sort":s,className:`relative px-4 py-2.5 font-semibold text-[var(--otari-ink)] whitespace-nowrap ${t}`,children:[n,i?r.jsx(b,{resize:i}):null]})}function R({children:n,className:t=""}){return r.jsx("td",{className:`px-4 py-2.5 align-middle ${t}`,children:n})}function y({children:n,className:t="",onClick:s,selected:i}){return r.jsx("tr",{onClick:s,onKeyDown:s?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s())}:void 0,tabIndex:s?0:void 0,"aria-selected":i,className:`border-b border-[var(--otari-line)] last:border-b-0 ${s?"cursor-pointer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--otari-brand)]":""} ${i?"bg-[var(--otari-brand-tint)]":"hover:bg-[var(--otari-bg)]"} ${t}`,children:n})}function m({colSpan:n,children:t}){return r.jsx("tr",{children:r.jsx("td",{colSpan:n,className:"px-4 py-10 text-center text-[var(--otari-muted)]",children:t})})}function z({colSpan:n}){return r.jsx(m,{colSpan:n,children:r.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.jsx(f,{size:"sm"})," Loading…"]})})}export{z as L,w as T,C as a,N as b,m as c,y as d,R as e}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js new file mode 100644 index 00000000..35454e78 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as d}from"./react-q-ooZ0ti.js";import{a6 as C,a7 as L,P as E,E as P,h as w,a8 as R,F as D}from"./index-CSyrpBqZ.js";import{c as N,B as b}from"./heroui-CewI8xK4.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js new file mode 100644 index 00000000..96dfae83 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d}from"./react-dgEcD0HR.js";import{a5 as C,a6 as L,P as E,E as P,h as w,a7 as R,F as D}from"./index-D6YDX-oj.js";import{d as N,B as b}from"./heroui-BX6JwHY-.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js new file mode 100644 index 00000000..590dfa16 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as d}from"./react-q-ooZ0ti.js";import{a5 as k,a6 as N,P as S,E as _,h as y,a7 as T,F as C}from"./index-D1FfVwkg.js";import{c as j,B as b}from"./heroui-CewI8xK4.js";function P(s,t){return{[s]:t}}const R=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function D(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function L({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const v="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50";function g({field:s,help:t}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function $({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),l=T();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:o=>{c(o.target.value),l.reset()},className:`w-64 ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||l.isPending,onPress:()=>l.mutate({service:s.service,url:x}),children:l.isPending?"Testing…":"Test"})]}),e.jsx("span",{role:"status","aria-live":"polite",className:"block max-w-md break-words text-xs",children:l.isPending?null:l.error?e.jsx("span",{className:"text-red-700",children:y(l.error)}):l.data?e.jsx("span",{className:l.data.ok?"font-medium text-green-700":"text-red-700",children:l.data.reason}):null}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function B({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const l=i!==r;return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:`w-64 ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})]}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function E({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const l=i.trim(),m=Number(l),o=(l===""||Number.isInteger(m)&&m>=1)&&l!==r;return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s,help:"Leave blank to use the backend default."}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-28 text-right tabular-nums ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(l===""?null:m),children:"Save"})]}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function M({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsx(C,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function z({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx($,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(E,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(M,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(B,{field:s,onSave:t,saveError:a,disabled:n})}function q(){const s=k(),t=N(),[a,n]=D(),[r,i]=d.useState({}),c=s.data,l=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(o=>[o.key,o])),x=(o,p)=>{i(h=>{const{[o.key]:f,...u}=h;return u}),t.mutate(P(o.key,p),{onSuccess:()=>n(`${o.key} saved`),onError:h=>i(f=>({...f,[o.key]:y(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(S,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(_,{error:s.error}),R.map(o=>{const p=o.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),f=[...p,...h];return f.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(j,{children:e.jsx(j.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:f.map(u=>e.jsx(z,{field:u,onSave:w=>x(u,w),saveError:r[u.key],disabled:l},u.key))})})]},o.key)}),e.jsx(L,{message:a})]})}export{q as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js b/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js new file mode 100644 index 00000000..86ad0546 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-CSyrpBqZ.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-D1FfVwkg.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js diff --git a/src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js b/src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js new file mode 100644 index 00000000..b890d515 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as ie,r as x}from"./react-dgEcD0HR.js";import{u as ce,c as D,P as de,E as ue,d as J,S as j,N as v,L as p,M as $,O as he,a8 as S}from"./index-D6YDX-oj.js";import{S as E,B as me}from"./charts-Cr3Dij9t.js";import{T as xe,a as ge,b as M,L as fe,c as je,d as be,e as O}from"./Table-CLdjdyTx.js";import{B as k,S as K}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function z(a){return a.toLocaleString()}function ve(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const pe=3600,R=86400,L=[{label:"Last hour",seconds:pe,bucket:"hour"},{label:"24h",seconds:R,bucket:"hour"},{label:"7d",seconds:7*R,bucket:"day"},{label:"30d",seconds:30*R,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],U=L[3],A=15;function B(a){return new Date(Date.now()-a*1e3).toISOString()}function Q({title:a,rows:r,totalCost:n,emptyLabel:g,onDrill:c,loading:d}){const[u,_]=x.useState(!1),f=u?r:r.slice(0,A),N=r.length-f.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(xe,{children:[e.jsx(ge,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:d?e.jsx(fe,{colSpan:3}):r.length===0?e.jsx(je,{colSpan:3,children:g}):f.map((o,T)=>{const m=o.is_other,y=!m&&o.key!==null,h=n>0?o.cost/n:0;return e.jsxs(be,{onClick:y?()=>c(o.key):void 0,children:[e.jsx(O,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:m?`Other (${o.requests.toLocaleString()} req)`:o.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:z(o.requests)}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:$(o.cost)})]},o.key??`__null_${T}`)})})]}),!d&&N>0?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!0),children:["Show all ",r.length]}):null,!d&&u&&r.length>A?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!1),children:["Show top ",A]}):null]})}const ke=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function _e(a,r){return r==="cost"?a.cost:r==="tokens"?a.tokens:a.requests}function W(a,r){return r==="cost"?$(a):r==="tokens"?S(a):z(a)}function ye(a,r){const n=new Date(a);return Number.isNaN(n.getTime())?a:r==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Se(a,r,n){const g=a.map(d=>({label:ye(d.bucket_start,n),value:_e(d,r)})),c=g.length?Math.max(...g.map(d=>d.value)):0;return{points:g,peak:c,count:a.length}}function De(){var V,Z,Y;const a=ie(),r=ce(),[n,g]=x.useState(U),[c,d]=x.useState(()=>U.seconds===null?void 0:B(U.seconds)),[u,_]=x.useState(""),[f,N]=x.useState(""),[o,T]=x.useState("cost"),m=x.useMemo(()=>({start_date:c,model:u.trim()||void 0,user_id:f||void 0}),[c,u,f]),y=x.useMemo(()=>n.seconds===null||!c?null:{...m,start_date:new Date(new Date(c).getTime()-n.seconds*1e3).toISOString(),end_date:c},[m,n.seconds,c]),h=D(m,n.bucket),X=D(y??m,n.bucket,y!==null),i=h.data,t=i==null?void 0:i.totals,l=y!==null?(V=X.data)==null?void 0:V.totals:void 0,ee=x.useMemo(()=>({...m,model:void 0}),[m]),q=((Y=(Z=D(ee,n.bucket).data)==null?void 0:Z.by_model)==null?void 0:Y.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],se=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),te=(u&&!q.includes(u)?[u,...q]:q).map(s=>({value:s,label:s})),w=!!(u.trim()||f||n.seconds!==null),ae=!!(i&&t&&t.request_count===0&&!w),H=s=>{g(s),d(s.seconds===null?void 0:B(s.seconds))},ne=()=>{H(L[L.length-1]),_(""),N("")},re=()=>{n.seconds!==null&&d(B(n.seconds)),h.refetch()},I=s=>{const P=new URLSearchParams;c&&P.set("start_date",c);for(const[oe,G]of Object.entries(s))G&&P.set(oe,G);a(`/activity?${P.toString()}`)},le=t&&t.request_count>0?t.error_count/t.request_count:0,b=(i==null?void 0:i.series)??[],C=b.length>1,F=Se(b,o,n.bucket);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(de,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(k,{variant:"outline",onPress:re,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ue,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(s=>e.jsx(k,{size:"sm",variant:n.label===s.label?"primary":"outline",onPress:()=>H(s),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(J,{label:"User",value:f,onChange:N,options:se,placeholder:"All users"}),e.jsx(J,{label:"Model",value:u,onChange:_,options:te,placeholder:"All models"}),w?e.jsx(k,{size:"sm",variant:"ghost",onPress:ne,children:"Clear filters"}):null]})]}),ae?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(j,{label:"Spend",value:t?$(t.cost):"—",hint:t?e.jsx(v,{fraction:p(t.cost,l==null?void 0:l.cost)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(j,{label:"Requests",value:t?z(t.request_count):"—",hint:t?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[he(le)," errors",l?e.jsxs(e.Fragment,{children:[" · ",e.jsx(v,{fraction:p(t.request_count,l.request_count)})]}):null]}):null,chart:C?e.jsx(E,{values:b.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(j,{label:"Tokens",value:t?S(t.total_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.total_tokens,l==null?void 0:l.total_tokens)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(j,{label:"Cache read",value:t?S(t.cache_read_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_read_tokens,l==null?void 0:l.cache_read_tokens)}):null}),e.jsx(j,{label:"Cache write",value:t?S(t.cache_write_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_tokens,l==null?void 0:l.cache_write_tokens)}):null}),e.jsx(j,{label:"1h cache write",value:t?S(t.cache_write_1h_tokens??0):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_1h_tokens??0,(l==null?void 0:l.cache_write_1h_tokens)??0)}):null}),e.jsx(j,{label:"Avg latency",value:t?ve(t.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Q,{title:"Spend by model",rows:(i==null?void 0:i.by_model)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({model:s}),loading:h.isLoading}),e.jsx(Q,{title:"Spend by user",rows:(i==null?void 0:i.by_user)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({user_id:s}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[ke.map(s=>e.jsx(k,{size:"sm",variant:o===s.key?"primary":"outline",onPress:()=>T(s.key),children:s.label},s.key)),h.isFetching?e.jsx(K,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(K,{size:"sm"})}):b.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(me,{data:F.points,formatValue:s=>W(s,o),ariaLabel:`${o} per ${n.bucket}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[W(F.peak,o)," peak · ",F.count," ",n.bucket==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{De as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js b/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js new file mode 100644 index 00000000..754fe4e7 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-D1FfVwkg.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js b/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js index fbd004d1..b8df9698 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js +++ b/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js @@ -1 +1,13 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,aa as V,P as L,E as A,ab as O}from"./index-Dp4DdBFR.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-D_p9BPKF.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======= +<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-D6YDX-oj.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-CxWug9wa.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js +>>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js b/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js new file mode 100644 index 00000000..324e97d3 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js b/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js new file mode 100644 index 00000000..a6d17b11 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js @@ -0,0 +1,9 @@ +<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-D6YDX-oj.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-CxWug9wa.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======= +<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +======== +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +>>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js +>>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js b/src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js new file mode 100644 index 00000000..4899ed28 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js b/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js new file mode 100644 index 00000000..a4fb0b56 --- /dev/null +++ b/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js @@ -0,0 +1,20 @@ +var ho=t=>{throw TypeError(t)};var mo=(t,e,n)=>e.has(t)||ho("Cannot "+n);var go=(t,e,n)=>(mo(t,e,"read from private field"),n?n.call(t):e.get(t)),$o=(t,e,n)=>e.has(t)?ho("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Nn=(t,e,n,r)=>(mo(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{r as a,$ as y,a as Lr,b as Tu,c as ku}from"./react-q-ooZ0ti.js";import{j as A}from"./tanstack-query-W9y7rsMr.js";const Du="react-aria-clear-focus",Mu="react-aria-focus";function xn(t){var n;if(typeof window>"u"||window.navigator==null)return!1;let e=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(e)&&e.some(r=>t.test(r.brand))||t.test(window.navigator.userAgent)}function Kr(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)==null?void 0:e.platform)||window.navigator.platform):!1}function je(t){let e=null;return()=>(e==null&&(e=t()),e)}const Xe=je(function(){return Kr(/^Mac/i)}),Au=je(function(){return Kr(/^iPhone/i)}),Vl=je(function(){return Kr(/^iPad/i)||Xe()&&navigator.maxTouchPoints>1}),Ze=je(function(){return Au()||Vl()}),ln=je(function(){return Xe()||Ze()}),_l=je(function(){return xn(/AppleWebKit/i)&&!jl()}),jl=je(function(){return xn(/Chrome/i)}),Rr=je(function(){return xn(/Android/i)}),Lu=je(function(){return xn(/Firefox/i)});function Ke(t){if(Ku())t.focus({preventScroll:!0});else{let e=Ru(t);t.focus(),Fu(e)}}let Xt=null;function Ku(){if(Xt==null){Xt=!1;try{document.createElement("div").focus({get preventScroll(){return Xt=!0,!0}})}catch{}}return Xt}function Ru(t){let e=t.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeightt});function zt(){return a.useContext(Iu)}function Bu(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function _e(t,e,n=!0){var u,c;let{metaKey:r,ctrlKey:o,altKey:l,shiftKey:i}=e;Lu()&&((c=(u=window.event)==null?void 0:u.type)!=null&&c.startsWith("key"))&&t.target==="_blank"&&(Xe()?r=!0:o=!0);let s=_l()&&Xe()&&!Vl()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:l,shiftKey:i}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:l,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});_e.isOpening=n,Ke(t),t.dispatchEvent(s),_e.isOpening=!1}_e.isOpening=!1;function Nu(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function Ou(t,e){Nu(t,n=>_e(n,e))}function zl(t){const n=zt().useHref((t==null?void 0:t.href)??"");let r={};if(t)for(let o of["href","target","rel","download","ping","referrerPolicy"])o in t&&(r[o]=o==="href"?n:t[o]);return r}function Vu(t,e,n,r){!e.isNative&&t.currentTarget instanceof HTMLAnchorElement&&t.currentTarget.href&&!t.isDefaultPrevented()&&Bu(t.currentTarget,t)&&n&&(t.preventDefault(),e.open(t.currentTarget,t,n,r))}const ne=typeof document<"u"?y.useLayoutEffect:()=>{},Hl={prefix:String(Math.round(Math.random()*1e10)),current:0},Wl=y.createContext(Hl),_u=y.createContext(!1);let On=new WeakMap;function ju(t=!1){var r,o;let e=a.useContext(Wl),n=a.useRef(null);if(n.current===null&&!t){let l=(o=(r=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:r.ReactCurrentOwner)==null?void 0:o.current;if(l){let i=On.get(l);i==null?On.set(l,{id:e.current,state:l.memoizedState}):l.memoizedState!==i.state&&(e.current=i.id,On.delete(l))}n.current=++e.current}return n.current}function zu(t){let e=a.useContext(Wl),n=ju(!!t),r=`react-aria${e.prefix}`;return t||`${r}-${n}`}function Hu(t){let e=y.useId(),[n]=a.useState(et()),r=n?"react-aria":`react-aria${Hl.prefix}`;return t||`${r}-${e}`}const Wu=typeof y.useId=="function"?Hu:zu;function Gu(){return!1}function Uu(){return!0}function qu(t){return()=>{}}function et(){return typeof y.useSyncExternalStore=="function"?y.useSyncExternalStore(qu,Gu,Uu):a.useContext(_u)}function Yu(t){let[e,n]=a.useState(t),r=a.useRef(e),o=a.useRef(null),l=a.useRef(()=>{if(!o.current)return;let s=o.current.next();if(s.done){o.current=null;return}r.current===s.value?l.current():n(s.value)});ne(()=>{r.current=e,o.current&&l.current()});let i=a.useCallback(s=>{o.current=s(r.current),l.current()},[l]);return[e,i]}let Xu=!!(typeof window<"u"&&window.document&&window.document.createElement),dt=new Map,Pt;typeof FinalizationRegistry<"u"&&(Pt=new FinalizationRegistry(t=>{dt.delete(t)}));function ve(t){let[e,n]=a.useState(t),r=a.useRef(null),o=Wu(e),l=a.useRef(null);if(Pt&&Pt.register(l,o),Xu){const i=dt.get(o);i&&!i.includes(r)?i.push(r):dt.set(o,[r])}return ne(()=>{let i=o;return()=>{Pt&&Pt.unregister(l),dt.delete(i)}},[o]),a.useEffect(()=>{let i=r.current;return i&&n(i),()=>{i&&(r.current=null)}}),o}function Zu(t,e){if(t===e)return t;let n=dt.get(t);if(n)return n.forEach(o=>o.current=e),e;let r=dt.get(e);return r?(r.forEach(o=>o.current=t),t):e}function Ft(t=[]){let e=ve(),[n,r]=Yu(e),o=a.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return ne(o,[e,o,...t]),n}function tt(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const ee=t=>(t==null?void 0:t.ownerDocument)??document,xe=t=>t&&"window"in t&&t.window===t?t:ee(t).defaultView||window;function Ju(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function Qu(t){return Ju(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let ec=!1;function Ne(){return ec}function te(t,e){if(!Ne())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Qu(n)?n=n.host:n=n.parentNode}return!1}const re=(t=document)=>{var n;if(!Ne())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&((n=e.shadowRoot)!=null&&n.activeElement);)e=e.shadowRoot.activeElement;return e};function j(t){if(Ne()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function It(t){if(!t)return!1;let e=t.getRootNode(),n=xe(t);if(!(e instanceof n.Document||e instanceof n.ShadowRoot))return!1;let r=e.activeElement;return r!=null&&t.contains(r)}class tc{constructor(e,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var s;if(i.nodeType===Node.ELEMENT_NODE){const u=i.shadowRoot;if(u){const c=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((s=this.filter)!=null&&s.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,r,this._acceptNode));const l=n.shadowRoot;if(l){const i=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(e){if(!te(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=e,o=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=r,s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=o,this._currentSetFor.add(s),r=o=i.host}else r=r.parentNode;const l=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=o,this._currentSetFor.add(l),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return te(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){var n;const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(e):(n=this.filter)!=null&&n.acceptNode&&(o=this.filter.acceptNode(e)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let l=this.nextNode();return l&&(this.currentNode=l),l}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){let l;if(typeof this.filter=="function"?l=this.filter(n):(r=this.filter)!=null&&r.acceptNode&&(l=this.filter.acceptNode(n)),l===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let i=this.lastChild();return i&&(this.currentNode=i),i}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function Gl(t,e,n,r){return Ne()?new tc(t,e,n,r):t.createTreeWalker(e,n,r)}function ht(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const r=t.map(o=>{const l=yo(o,e);return n||(n=typeof l=="function"),l});if(n)return()=>{r.forEach((o,l)=>{typeof o=="function"?o():yo(t[l],null)})}}}function yo(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ul(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e=65&&o.charCodeAt(2)<=90?e[o]=tt(l,i):(o==="className"||o==="UNSAFE_className")&&typeof l=="string"&&typeof i=="string"?e[o]=nc(l,i):o==="id"&&l&&i?e.id=Zu(l,i):o==="ref"&&l&&i?e.ref=ht(l,i):e[o]=i!==void 0?i:l}}return e}const rc=new Set(["id"]),oc=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),lc=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),ic=new Set(["dir","lang","hidden","inert","translate"]),vo=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),sc=/^(data-.*)$/;function pe(t,e={}){let{labelable:n,isLink:r,global:o,events:l=o,propNames:i}=e,s={};for(const u in t)Object.prototype.hasOwnProperty.call(t,u)&&(rc.has(u)||n&&oc.has(u)||r&&lc.has(u)||o&&ic.has(u)||l&&(vo.has(u)||u.endsWith("Capture")&&vo.has(u.slice(0,-7)))||i!=null&&i.has(u)||sc.test(u))&&(s[u]=t[u]);return s}let He=new Map,rr=new Set;function xo(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{let o=j(r);if(!t(r)||!o)return;let l=He.get(o);l||(l=new Set,He.set(o,l),o.addEventListener("transitioncancel",n,{once:!0})),l.add(r.propertyName)},n=r=>{let o=j(r);if(!t(r)||!o)return;let l=He.get(o);if(l&&(l.delete(r.propertyName),l.size===0&&(o.removeEventListener("transitioncancel",n),He.delete(o)),He.size===0)){for(let i of rr)i();rr.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?xo():document.addEventListener("DOMContentLoaded",xo));function ac(){for(const[t]of He)"isConnected"in t&&!t.isConnected&&He.delete(t)}function ql(t){requestAnimationFrame(()=>{ac(),He.size===0?t():rr.add(t)})}function Cn(){let t=a.useRef(new Map),e=a.useCallback((o,l,i,s)=>{let u=s!=null&&s.once?(...c)=>{t.current.delete(i),i(...c)}:i;t.current.set(i,{type:l,eventTarget:o,fn:u,options:s}),o.addEventListener(l,u,s)},[]),n=a.useCallback((o,l,i,s)=>{var c;let u=((c=t.current.get(i))==null?void 0:c.fn)||i;o.removeEventListener(l,u,s),t.current.delete(i)},[]),r=a.useCallback(()=>{t.current.forEach((o,l)=>{n(o.eventTarget,o.type,l,o.options)})},[n]);return a.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function dn(t,e){let{id:n,"aria-label":r,"aria-labelledby":o}=t;return n=ve(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&e&&(r=e),{id:n,"aria-label":r,"aria-labelledby":o}}function nt(t){const e=a.useRef(null),n=a.useRef(void 0),r=a.useCallback(o=>{if(typeof t=="function"){const l=t,i=l(o);return()=>{typeof i=="function"?i():l(null)}}else if(t)return t.current=o,()=>{t.current=null}},[t]);return a.useMemo(()=>({get current(){return e.current},set current(o){e.current=o,n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=r(o))}}),[r])}const uc=y.useInsertionEffect??ne;function Pe(t){const e=a.useRef(null);return uc(()=>{e.current=t},[t]),a.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}function cc(t,e){const n=a.useRef(!0),r=a.useRef(null);let o=Pe(t);a.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),a.useEffect(()=>{let l=r.current;n.current?n.current=!1:(!l||e.some((i,s)=>!Object.is(i,l[s])))&&o(),r.current=e},e)}function Co(t,e){const n=a.useRef(!0),r=a.useRef(null);ne(()=>(n.current=!0,()=>{n.current=!1}),[]),ne(()=>{n.current?n.current=!1:(!r.current||e.some((o,l)=>!Object.is(o,r[l])))&&t(),r.current=e},e)}function dc(){return typeof window.ResizeObserver<"u"}function fn(t){const{ref:e,box:n,onResize:r}=t;let o=Pe(r);a.useEffect(()=>{let l=e==null?void 0:e.current;if(l)if(dc()){const i=new window.ResizeObserver(s=>{s.length&&o()});return i.observe(l,{box:n}),()=>{l&&i.unobserve(l)}}else return window.addEventListener("resize",o,!1),()=>{window.removeEventListener("resize",o,!1)}},[e,n])}function Fr(t,e){ne(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Je(t,e){if(!t)return!1;let n=window.getComputedStyle(t),r=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return t===r&&n.overflow!=="hidden"&&(o=!0),o&&e&&(o=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),o}function Ir(t,e){let n=t;for(Je(n,e)&&(n=n.parentElement);n&&!Je(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Vn(t,e){let n=[],r=document.scrollingElement||document.documentElement;for(;t&&(Je(t,e)&&n.push(t),t!==r);)t=t.parentElement;return n}function ut(t){return Xe()?t.metaKey:t.ctrlKey}const fc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function At(t){return t instanceof HTMLInputElement&&!fc.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}let ye=typeof document<"u"&&window.visualViewport;function pc(){let t=et(),[e,n]=a.useState(()=>t?{width:0,height:0}:_n());return a.useEffect(()=>{let r=s=>{n(u=>s.width===u.width&&s.height===u.height?u:s)},o=()=>{ye&&ye.scale>1||r(_n())},l,i=s=>{ye&&ye.scale>1||At(j(s))&&(l=requestAnimationFrame(()=>{let u=re();(!u||!At(u))&&r({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return r(_n()),Ze()&&window.addEventListener("blur",i,!0),ye?ye.addEventListener("resize",o):window.addEventListener("resize",o),()=>{cancelAnimationFrame(l),Ze()&&window.removeEventListener("blur",i,!0),ye?ye.removeEventListener("resize",o):window.removeEventListener("resize",o)}},[]),e}function _n(){return{width:ye?Math.min(ye.width*ye.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:ye?ye.height*ye.scale:document.documentElement.clientHeight}}let bc=0;const jn=new Map;function hc(t){let[e,n]=a.useState();return ne(()=>{if(!t)return;let r=jn.get(t);if(r)n(r.element.id);else{let o=`react-aria-description-${bc++}`;n(o);let l=document.createElement("div");l.id=o,l.style.display="none",l.textContent=t,document.body.appendChild(l),r={refCount:0,element:l},jn.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),jn.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function Tt(t,e,n,r){let o=Pe(n),l=n==null;a.useEffect(()=>{if(l||!t.current)return;let i=t.current;return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[t,e,r,l])}function sn(t,e,n={}){let{block:r="nearest",inline:o="nearest"}=n;if(t===e)return;let l=t.scrollTop,i=t.scrollLeft,s=e.getBoundingClientRect(),u=t.getBoundingClientRect(),c=window.getComputedStyle(e),d=window.getComputedStyle(t),f=document.scrollingElement||document.documentElement,b=t===f,p=t===f?0:u.top,m=t===f?t.clientHeight:u.bottom,v=t===f?0:u.left,g=t===f?t.clientWidth:u.right,x=parseFloat(c.scrollMarginTop)||0,$=parseFloat(c.scrollMarginBottom)||0,D=parseFloat(c.scrollMarginLeft)||0,P=parseFloat(c.scrollMarginRight)||0,F=parseFloat(d.scrollPaddingTop)||0,R=parseFloat(d.scrollPaddingBottom)||0,I=parseFloat(d.scrollPaddingLeft)||0,k=parseFloat(d.scrollPaddingRight)||0,B=parseFloat(d.borderTopWidth)||0,K=parseFloat(d.borderBottomWidth)||0,_=parseFloat(d.borderLeftWidth)||0,U=parseFloat(d.borderRightWidth)||0,z=s.top-x,h=s.bottom+$,C=s.left-D,M=s.right+P,E=t===f?0:_+U,w=t===f?0:B+K,T=t===f?0:t.offsetWidth-t.clientWidth-E,S=t===f?0:t.offsetHeight-t.clientHeight-w,N=p+(b?0:B)+F,q=m-(b?0:K)-R-S,W=v+(b?0:_)+I,X=g-(b?0:U)-k;d.direction==="rtl"&&!Ze()?W+=T:X-=T;let Q=zq,le=CX;if(Q&&r==="start")l+=z-N;else if(Q&&r==="center")l+=(z+h)/2-(N+q)/2;else if(Q&&r==="end")l+=h-q;else if(Q&&r==="nearest"){let Z=z-N,be=h-q;l+=Math.abs(Z)<=Math.abs(be)?Z:be}if(le&&o==="start")i+=C-W;else if(le&&o==="center")i+=(C+M)/2-(W+X)/2;else if(le&&o==="end")i+=M-X;else if(le&&o==="nearest"){let Z=C-W,be=M-X;i+=Math.abs(Z)<=Math.abs(be)?Z:be}t.scrollTo({left:i,top:l})}function Eo(t,e={}){var r,o,l;let{containingElement:n}=e;if(t&&t.isConnected){let i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let{left:u,top:c}=t.getBoundingClientRect(),d=Vn(t,!0);for(let p of d)sn(p,t);let{left:f,top:b}=t.getBoundingClientRect();if(Math.abs(u-f)>1||Math.abs(c-b)>1){d=n?Vn(n,!0):[];for(let p of d)sn(p,n,{block:"center",inline:"center"});for(let p of Vn(t,!0))sn(p,t)}}else{let{left:u,top:c}=t.getBoundingClientRect();(r=t==null?void 0:t.scrollIntoView)==null||r.call(t,{block:"nearest"});let{left:d,top:f}=t.getBoundingClientRect();(Math.abs(u-d)>1||Math.abs(c-f)>1)&&((o=n==null?void 0:n.scrollIntoView)==null||o.call(n,{block:"center",inline:"center"}),(l=t.scrollIntoView)==null||l.call(t,{block:"nearest"}))}}}function Yl(t){return t.pointerType===""&&t.isTrusted?!0:Rr()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function mc(t){return!Rr()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function Xl(t,e,n){let r=Pe(o=>{n&&!o.defaultPrevented&&n(e)});a.useEffect(()=>{var l;let o=(l=t==null?void 0:t.current)==null?void 0:l.form;return o==null||o.addEventListener("reset",r),()=>{o==null||o.removeEventListener("reset",r)}},[t])}function gc(t,e){let{collection:n,onLoadMore:r,scrollOffset:o=1}=t,l=a.useRef(null),i=Pe(s=>{for(let u of s)u.isIntersecting&&r&&r()});ne(()=>(e.current&&(l.current=new IntersectionObserver(i,{root:Ir(e==null?void 0:e.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),l.current.observe(e.current)),()=>{l.current&&l.current.disconnect()}),[n,e,o])}function $c(t){const e=a.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}function Br(t,e=!0){let[n,r]=a.useState(!0),o=n&&e;return ne(()=>{if(o&&t.current&&"getAnimations"in t.current)for(let l of t.current.getAnimations())l instanceof CSSTransition&&l.cancel()},[t,o]),Zl(t,o,a.useCallback(()=>r(!1),[])),o}function or(t,e){let[n,r]=a.useState(e?"open":"closed");switch(n){case"open":e||r("exiting");break;case"closed":case"exiting":e&&r("open");break}let o=n==="exiting";return Zl(t,o,a.useCallback(()=>{r(l=>l==="exiting"?"closed":l)},[])),o}function Zl(t,e,n){ne(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let r=t.current.getAnimations();if(r.length===0){n();return}let o=!1;return Promise.allSettled(r.map(l=>l.finished)).then(()=>{o||Lr.flushSync(()=>{n()})}),()=>{o=!0}}},[t,e,n])}const yc=typeof Element<"u"&&"checkVisibility"in Element.prototype;function vc(t){const e=xe(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:r}=t.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:l}=t.ownerDocument.defaultView;let{display:i,visibility:s}=l(t);o=i!=="none"&&s!=="hidden"&&s!=="collapse"}return o}function xc(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Nr(t,e){return yc?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&vc(t)&&xc(t,e)&&(!t.parentElement||Nr(t.parentElement,t))}const Or=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Cc=Or.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Or.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ec=Or.join(':not([hidden]):not([tabindex="-1"]),');function Jl(t,e){return t.matches(Cc)&&!ei(t)&&((e==null?void 0:e.skipVisibilityCheck)||Nr(t))}function Ql(t){return t.matches(Ec)&&Nr(t)&&!ei(t)}function ei(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function wo(t){let e=t==null?void 0:t.defaultView;return(e==null?void 0:e.__webpack_nonce__)||globalThis.__webpack_nonce__||void 0}let zn=new WeakMap;function ti(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return wo(e);if(zn.has(e))return zn.get(e);let n=e.querySelector('meta[property="csp-nonce"]'),r=n&&n instanceof xe(n).HTMLMetaElement&&(n.nonce||n.content)||wo(e)||void 0;return r!==void 0&&zn.set(e,r),r}function wc(t,e,n){const{render:r,...o}=e,l=a.useRef(null),i=a.useMemo(()=>ht(n,l),[n,l]);ne(()=>{},[t,r]);const s={...o,ref:i};return r?r(s,void 0):A.jsx(t,{...s})}const So={},Ae=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=So[e];return n||(n=a.forwardRef(wc.bind(null,e)),So[e]=n),n}});var Sc=/\s+/g,Pc=t=>typeof t!="string"||!t?t:t.replace(Sc," ").trim(),Bt=(...t)=>{const e=[],n=r=>{if(!r&&r!==0&&r!==0n)return;if(Array.isArray(r)){for(let l=0,i=r.length;l0?Pc(e.join(" ")):void 0},Po=t=>t===!1?"false":t===!0?"true":t===0?"0":t,ge=t=>{if(!t||typeof t!="object")return!0;for(const e in t)return!1;return!0},Tc=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let o=0;o{for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const r=e[n];n in t?t[n]=Bt(t[n],r):t[n]=r}return t},ni=(t,e)=>{for(let n=0;n{const e=[];ni(t,e);const n=[];for(let r=0;r{const n={};for(const r in t){const o=t[r];if(r in e){const l=e[r];Array.isArray(o)||Array.isArray(l)?n[r]=ri(l,o):typeof o=="object"&&typeof l=="object"&&o&&l?n[r]=lr(o,l):n[r]=l+" "+o}else n[r]=o}for(const r in e)r in t||(n[r]=e[r]);return n},Dc={twMerge:!0,twMergeConfig:{}};function Mc(){let t=null,e={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(r){t=r},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(r){e=r},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(r){n=r},reset(){t=null,e={},n=!1}}}var Be=Mc(),Ac=t=>{const e=(r,o)=>{const{extend:l=null,slots:i={},variants:s={},compoundVariants:u=[],compoundSlots:c=[],defaultVariants:d={}}=r,f={...Dc,...o},b=l!=null&&l.base?Bt(l.base,r==null?void 0:r.base):r==null?void 0:r.base,p=l!=null&&l.variants&&!ge(l.variants)?lr(s,l.variants):s,m=l!=null&&l.defaultVariants&&!ge(l.defaultVariants)?{...l.defaultVariants,...d}:d;!ge(f.twMergeConfig)&&!Tc(f.twMergeConfig,Be.cachedTwMergeConfig)&&(Be.didTwMergeConfigChange=!0,Be.cachedTwMergeConfig=f.twMergeConfig);const v=ge(l==null?void 0:l.slots),g=ge(i)?{}:{base:Bt(r==null?void 0:r.base,v&&(l==null?void 0:l.base)),...i},x=v?g:kc({...l==null?void 0:l.slots},ge(g)?{base:r==null?void 0:r.base}:g),$=ge(l==null?void 0:l.compoundVariants)?u:ri(l==null?void 0:l.compoundVariants,u),D=F=>{if(ge(p)&&ge(i)&&v)return t(b,F==null?void 0:F.class,F==null?void 0:F.className)(f);if($&&!Array.isArray($))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof $}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const R=(h,C=p,M=null,E=null)=>{const w=C[h];if(!w||ge(w))return null;const T=(E==null?void 0:E[h])??(F==null?void 0:F[h]);if(T===null)return null;const S=Po(T);if(typeof S=="object")return null;const N=m==null?void 0:m[h],q=S??Po(N);return w[q||"false"]},I=()=>{if(!p)return null;const h=Object.keys(p),C=[];for(let M=0;M{if(!p||typeof p!="object")return null;const M=[];for(const E in p){const w=R(E,p,h,C),T=h==="base"&&typeof w=="string"?w:w&&w[h];T&&M.push(T)}return M},B={};for(const h in F){const C=F[h];C!==void 0&&(B[h]=C)}const K=(h,C)=>{var E;const M=typeof(F==null?void 0:F[h])=="object"?{[h]:(E=F[h])==null?void 0:E.initial}:{};return{...m,...B,...M,...C}},_=(h=[],C)=>{const M=[],E=h.length;for(let w=0;w{const C=_($,h);if(!Array.isArray(C))return C;const M={},E=t;for(let w=0;w{if(c.length<1)return null;const C={},M=K(null,h);for(let E=0;E{const w=U(E),T=z(E);return C(x[M],k(M,E),w?w[M]:void 0,T?T[M]:void 0,E==null?void 0:E.class,E==null?void 0:E.className)(f)}}return h}return t(b,I(),_($),F==null?void 0:F.class,F==null?void 0:F.className)(f)},P=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return D.variantKeys=P(),D.extend=l,D.base=b,D.slots=x,D.variants=p,D.defaultVariants=m,D.compoundSlots=c,D.compoundVariants=$,D};return{tv:e,createTV:r=>(o,l)=>e(o,l?lr(r,l):r)}};const Lc=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),oi=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),pn="-",To=[],Rc="arbitrary..",Fc=t=>{const e=Bc(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ic(i);const s=i.split(pn),u=s[0]===""&&s.length>1?1:0;return li(s,u,e)},getConflictingClassGroupIds:(i,s)=>{if(s){const u=r[i],c=n[i];return u?c?Lc(c,u):u:c||To}return n[i]||To}}},li=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const c=li(t,e+1,l);if(c)return c}const i=n.validators;if(i===null)return;const s=e===0?t.join(pn):t.slice(e).join(pn),u=i.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Rc+r:void 0})(),Bc=t=>{const{theme:e,classGroups:n}=t;return Nc(n,e)},Nc=(t,e)=>{const n=oi();for(const r in t){const o=t[r];Vr(o,n,r,e)}return n},Vr=(t,e,n,r)=>{const o=t.length;for(let l=0;l{if(typeof t=="string"){Vc(t,e,n);return}if(typeof t=="function"){_c(t,e,n,r);return}jc(t,e,n,r)},Vc=(t,e,n)=>{const r=t===""?e:ii(e,t);r.classGroupId=n},_c=(t,e,n,r)=>{if(zc(t)){Vr(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Kc(n,t))},jc=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let i=0;i{let n=t;const r=e.split(pn),o=r.length;for(let l=0;l"isThemeGetter"in t&&t.isThemeGetter===!0,Hc=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,i)=>{n[l]=i,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let i=n[l];if(i!==void 0)return i;if((i=r[l])!==void 0)return o(l,i),i},set(l,i){l in n?n[l]=i:o(l,i)}}},ir="!",ko=":",Wc=[],Do=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Gc=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let i=0,s=0,u=0,c;const d=o.length;for(let v=0;vu?c-u:void 0;return Do(l,p,b,m)};if(e){const o=e+ko,l=r;r=i=>i.startsWith(o)?l(i.slice(o.length)):Do(Wc,!1,i,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},Uc=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},qc=t=>({cache:Hc(t.cacheSize),parseClassName:Gc(t),sortModifiers:Uc(t),...Fc(t)}),Yc=/\s+/,Xc=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,i=[],s=t.trim().split(Yc);let u="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:f,modifiers:b,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}=n(d);if(f){u=d+(u.length>0?" "+u:u);continue}let g=!!v,x=r(g?m.substring(0,v):m);if(!x){if(!g){u=d+(u.length>0?" "+u:u);continue}if(x=r(m),!x){u=d+(u.length>0?" "+u:u);continue}g=!1}const $=b.length===0?"":b.length===1?b[0]:l(b).join(":"),D=p?$+ir:$,P=D+x;if(i.indexOf(P)>-1)continue;i.push(P);const F=o(x,g);for(let R=0;R0?" "+u:u)}return u},Zc=(...t)=>{let e=0,n,r,o="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,o,l;const i=u=>{const c=e.reduce((d,f)=>f(d),t());return n=qc(c),r=n.cache.get,o=n.cache.set,l=s,s(u)},s=u=>{const c=r(u);if(c)return c;const d=Xc(u,n);return o(u,d),d};return l=i,(...u)=>l(Zc(...u))},Jc=[],de=t=>{const e=n=>n[t]||Jc;return e.isThemeGetter=!0,e},ai=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ui=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qc=/^\d+\/\d+$/,ed=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,td=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,od=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,st=t=>Qc.test(t),Y=t=>!!t&&!Number.isNaN(Number(t)),ze=t=>!!t&&Number.isInteger(Number(t)),Hn=t=>t.endsWith("%")&&Y(t.slice(0,-1)),Ie=t=>ed.test(t),ld=()=>!0,id=t=>td.test(t)&&!nd.test(t),ci=()=>!1,sd=t=>rd.test(t),ad=t=>od.test(t),ud=t=>!O(t)&&!V(t),cd=t=>mt(t,pi,ci),O=t=>ai.test(t),Ue=t=>mt(t,bi,id),Wn=t=>mt(t,hd,Y),Mo=t=>mt(t,di,ci),dd=t=>mt(t,fi,ad),Zt=t=>mt(t,hi,sd),V=t=>ui.test(t),Ct=t=>gt(t,bi),fd=t=>gt(t,md),Ao=t=>gt(t,di),pd=t=>gt(t,pi),bd=t=>gt(t,fi),Jt=t=>gt(t,hi,!0),mt=(t,e,n)=>{const r=ai.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},gt=(t,e,n=!1)=>{const r=ui.exec(t);return r?r[1]?e(r[1]):n:!1},di=t=>t==="position"||t==="percentage",fi=t=>t==="image"||t==="url",pi=t=>t==="length"||t==="size"||t==="bg-size",bi=t=>t==="length",hd=t=>t==="number",md=t=>t==="family-name",hi=t=>t==="shadow",ar=()=>{const t=de("color"),e=de("font"),n=de("text"),r=de("font-weight"),o=de("tracking"),l=de("leading"),i=de("breakpoint"),s=de("container"),u=de("spacing"),c=de("radius"),d=de("shadow"),f=de("inset-shadow"),b=de("text-shadow"),p=de("drop-shadow"),m=de("blur"),v=de("perspective"),g=de("aspect"),x=de("ease"),$=de("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...P(),V,O],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[V,O,u],B=()=>[st,"full","auto",...k()],K=()=>[ze,"none","subgrid",V,O],_=()=>["auto",{span:["full",ze,V,O]},ze,V,O],U=()=>[ze,"auto",V,O],z=()=>["auto","min","max","fr",V,O],h=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],C=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...k()],E=()=>[st,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],w=()=>[t,V,O],T=()=>[...P(),Ao,Mo,{position:[V,O]}],S=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",pd,cd,{size:[V,O]}],q=()=>[Hn,Ct,Ue],W=()=>["","none","full",c,V,O],X=()=>["",Y,Ct,Ue],Q=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[Y,Hn,Ao,Mo],be=()=>["","none",m,V,O],we=()=>["none",Y,V,O],L=()=>["none",Y,V,O],H=()=>[Y,V,O],oe=()=>[st,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ie],breakpoint:[Ie],color:[ld],container:[Ie],"drop-shadow":[Ie],ease:["in","out","in-out"],font:[ud],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ie],shadow:[Ie],spacing:["px",Y],text:[Ie],"text-shadow":[Ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",st,O,V,g]}],container:["container"],columns:[{columns:[Y,O,V,s]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[ze,"auto",V,O]}],basis:[{basis:[st,"full","auto",s,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Y,st,"auto","initial","none",O]}],grow:[{grow:["",Y,V,O]}],shrink:[{shrink:["",Y,V,O]}],order:[{order:[ze,"first","last","none",V,O]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...h(),"normal"]}],"justify-items":[{"justify-items":[...C(),"normal"]}],"justify-self":[{"justify-self":["auto",...C()]}],"align-content":[{content:["normal",...h()]}],"align-items":[{items:[...C(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...C(),{baseline:["","last"]}]}],"place-content":[{"place-content":h()}],"place-items":[{"place-items":[...C(),"baseline"]}],"place-self":[{"place-self":["auto",...C()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,Ct,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,V,Wn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hn,O]}],"font-family":[{font:[fd,O,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,V,O]}],"line-clamp":[{"line-clamp":[Y,"none",V,Wn]}],leading:[{leading:[l,...k()]}],"list-image":[{"list-image":["none",V,O]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",V,O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Y,"from-font","auto",V,Ue]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[Y,"auto",V,O]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",V,O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",V,O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:S()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ze,V,O],radial:["",V,O],conic:[ze,V,O]},bd,dd]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Y,V,O]}],"outline-w":[{outline:["",Y,Ct,Ue]}],"outline-color":[{outline:w()}],shadow:[{shadow:["","none",d,Jt,Zt]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":["none",f,Jt,Zt]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[Y,Ue]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":["none",b,Jt,Zt]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[Y,V,O]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Y]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[V,O]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Y]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:S()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",V,O]}],filter:[{filter:["","none",V,O]}],blur:[{blur:be()}],brightness:[{brightness:[Y,V,O]}],contrast:[{contrast:[Y,V,O]}],"drop-shadow":[{"drop-shadow":["","none",p,Jt,Zt]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:["",Y,V,O]}],"hue-rotate":[{"hue-rotate":[Y,V,O]}],invert:[{invert:["",Y,V,O]}],saturate:[{saturate:[Y,V,O]}],sepia:[{sepia:["",Y,V,O]}],"backdrop-filter":[{"backdrop-filter":["","none",V,O]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[Y,V,O]}],"backdrop-contrast":[{"backdrop-contrast":[Y,V,O]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Y,V,O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Y,V,O]}],"backdrop-invert":[{"backdrop-invert":["",Y,V,O]}],"backdrop-opacity":[{"backdrop-opacity":[Y,V,O]}],"backdrop-saturate":[{"backdrop-saturate":[Y,V,O]}],"backdrop-sepia":[{"backdrop-sepia":["",Y,V,O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",V,O]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Y,"initial",V,O]}],ease:[{ease:["linear","initial",x,V,O]}],delay:[{delay:[Y,V,O]}],animate:[{animate:["none",$,V,O]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,V,O]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[V,O,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:w()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",V,O]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",V,O]}],fill:[{fill:["none",...w()]}],"stroke-w":[{stroke:[Y,Ct,Ue,Wn]}],stroke:[{stroke:["none",...w()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gd=(t,{cacheSize:e,prefix:n,experimentalParseClassName:r,extend:o={},override:l={}})=>(kt(t,"cacheSize",e),kt(t,"prefix",n),kt(t,"experimentalParseClassName",r),Qt(t.theme,l.theme),Qt(t.classGroups,l.classGroups),Qt(t.conflictingClassGroups,l.conflictingClassGroups),Qt(t.conflictingClassGroupModifiers,l.conflictingClassGroupModifiers),kt(t,"orderSensitiveModifiers",l.orderSensitiveModifiers),en(t.theme,o.theme),en(t.classGroups,o.classGroups),en(t.conflictingClassGroups,o.conflictingClassGroups),en(t.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),mi(t,o,"orderSensitiveModifiers"),t),kt=(t,e,n)=>{n!==void 0&&(t[e]=n)},Qt=(t,e)=>{if(e)for(const n in e)kt(t,n,e[n])},en=(t,e)=>{if(e)for(const n in e)mi(t,e,n)},mi=(t,e,n)=>{const r=e[n];r!==void 0&&(t[n]=t[n]?t[n].concat(r):r)},$d=(t,...e)=>typeof t=="function"?sr(ar,t,...e):sr(()=>gd(ar(),t),...e),yd=sr(ar);var vd=t=>ge(t)?yd:$d({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),xd=(t,e)=>{const n=Bt(t);return!n||!((e==null?void 0:e.twMerge)??!0)?n:((!Be.cachedTwMerge||Be.didTwMergeConfigChange)&&(Be.didTwMergeConfigChange=!1,Be.cachedTwMerge=vd(Be.cachedTwMergeConfig)),Be.cachedTwMerge(n)||void 0)},Cd=(...t)=>e=>xd(t,e),{tv:me}=Ac(Cd);const En=me({defaultVariants:{size:"md",status:"danger",variant:"opaque"},slots:{backdrop:"alert-dialog__backdrop",body:"alert-dialog__body",closeTrigger:"alert-dialog__close-trigger",container:"alert-dialog__container",dialog:"alert-dialog__dialog",footer:"alert-dialog__footer",header:"alert-dialog__header",heading:"alert-dialog__heading",icon:"alert-dialog__icon",trigger:"alert-dialog__trigger"},variants:{size:{cover:{dialog:"alert-dialog__dialog--cover"},lg:{dialog:"alert-dialog__dialog--lg"},md:{dialog:"alert-dialog__dialog--md"},sm:{dialog:"alert-dialog__dialog--sm"},xs:{dialog:"alert-dialog__dialog--xs"}},status:{accent:{icon:"alert-dialog__icon--accent"},danger:{icon:"alert-dialog__icon--danger"},default:{icon:"alert-dialog__icon--default"},success:{icon:"alert-dialog__icon--success"},warning:{icon:"alert-dialog__icon--warning"}},variant:{blur:{backdrop:"alert-dialog__backdrop--blur"},opaque:{backdrop:"alert-dialog__backdrop--opaque"},transparent:{backdrop:"alert-dialog__backdrop--transparent"}}}}),Ed=me({base:"button",defaultVariants:{fullWidth:!1,isIconOnly:!1,size:"md",variant:"primary"},variants:{fullWidth:{false:"",true:"button--full-width"},isIconOnly:{true:"button--icon-only"},size:{lg:"button--lg",md:"button--md",sm:"button--sm"},variant:{danger:"button--danger","danger-soft":"button--danger-soft",ghost:"button--ghost",outline:"button--outline",primary:"button--primary",secondary:"button--secondary",tertiary:"button--tertiary"}}}),wd=me({defaultVariants:{variant:"default"},slots:{base:"card",content:"card__content",description:"card__description",footer:"card__footer",header:"card__header",title:"card__title"},variants:{variant:{default:{base:"card--default"},secondary:{base:"card--secondary"},tertiary:{base:"card--tertiary"},transparent:{base:"card--transparent"}}}}),Sd=me({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),Pd=me({base:"close-button",defaultVariants:{variant:"default"},variants:{variant:{default:"close-button--default"}}}),Td=me({defaultVariants:{fullWidth:!1},slots:{base:"combo-box",inputGroup:"combo-box__input-group",popover:"combo-box__popover",trigger:"combo-box__trigger"},variants:{fullWidth:{false:{},true:{base:"combo-box--full-width",inputGroup:"combo-box__input-group--full-width"}}}}),kd=me({base:"description"}),Dd=me({base:"input",defaultVariants:{fullWidth:!1,variant:"primary"},variants:{fullWidth:{false:"",true:"input--full-width"},variant:{primary:"input--primary",secondary:"input--secondary"}}}),Md=me({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),Ad=me({slots:{base:"link",icon:"link__icon"}}),Ld=me({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),Kd=me({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),Rd=me({base:"list-box-section"}),Fd=me({base:"spinner",defaultVariants:{color:"accent",size:"md"},variants:{color:{accent:"spinner--accent",current:"spinner--current",danger:"spinner--danger",success:"spinner--success",warning:"spinner--warning"},size:{lg:"spinner--lg",md:"spinner--md",sm:"spinner--sm",xl:"spinner--xl"}}}),Id=me({base:"textfield",defaultVariants:{fullWidth:!1},variants:{fullWidth:{false:"",true:"textfield--full-width"}}}),bn=Symbol("default");function rt({values:t,children:e}){for(let[n,r]of t)e=y.createElement(n.Provider,{value:r},e);return e}function Ee(t){let{className:e,style:n,children:r,defaultClassName:o,defaultChildren:l,defaultStyle:i,values:s,render:u}=t;return a.useMemo(()=>{let c,d,f;return typeof e=="function"?c=e({...s,defaultClassName:o}):c=e,typeof n=="function"?d=n({...s,defaultStyle:i||{}}):d=n,typeof r=="function"?f=r({...s,defaultChildren:l}):r==null?f=l:f=r,{className:c??o,style:d||i?{...i,...d}:void 0,children:f??l,"data-rac":"",render:u?b=>u(b,s):void 0}},[e,n,r,o,l,i,s,u])}function Bd(t,e){return n=>e(typeof t=="function"?t(n):t,n)}function _r(t,e){let n=a.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=e||bn;if(!n.slots[r]){let o=new Intl.ListFormat().format(Object.keys(n.slots).map(i=>`"${i}"`)),l=e?`Invalid slot "${e}".`:"A slot prop is required.";throw new Error(`${l} Valid slot names are ${o}.`)}return n.slots[r]}return n}function Ce(t,e,n){let r=_r(n,t.slot)||{},{ref:o,...l}=r,i=nt(a.useMemo(()=>ht(e,o),[e,o])),s=J(l,t);return"style"in l&&l.style&&"style"in t&&t.style&&(typeof l.style=="function"||typeof t.style=="function"?s.style=u=>{let c=typeof l.style=="function"?l.style(u):l.style,d={...u.defaultStyle,...c},f=typeof t.style=="function"?t.style({...u,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...l.style,...t.style}),[s,i]}function jr(t=!0){let[e,n]=a.useState(t),r=a.useRef(!1),o=a.useCallback(l=>{r.current=!0,n(!!l)},[]);return ne(()=>{r.current||n(!1)},[]),[o,e]}function gi(t){const e=/^(data-.*)$/;let n={};for(const r in t)e.test(r)||(n[r]=t[r]);return n}function Nd(t,e,n){let{render:r,...o}=e,l=a.useRef(null),i=a.useMemo(()=>ht(n,l),[n,l]);ne(()=>{},[t,r]);let s={...o,ref:i};return r?r(s,void 0):y.createElement(t,s)}const Lo={},fe=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=Lo[e];return n||(n=a.forwardRef(Nd.bind(null,e)),Lo[e]=n),n}});typeof HTMLTemplateElement<"u"&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.appendChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.removeChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(t,e){return this.content.insertBefore(t,e)}}));const hn=a.createContext(!1);function Od(t){if(a.useContext(hn))return y.createElement(y.Fragment,null,t.children);let n=y.createElement(hn.Provider,{value:!0},t.children);return y.createElement("template",null,n)}function Ht(t){let e=(n,r)=>a.useContext(hn)?null:t(n,r);return e.displayName=t.displayName||t.name,a.forwardRef(e)}function Vd(){return a.useContext(hn)}const wn=a.createContext({}),_d=Ht(function(e,n){[e,n]=Ce(e,n,wn);let{elementType:r="label",...o}=e,l=fe[r];return y.createElement(l,{className:"react-aria-Label",...o,ref:n})});function $i(t){let{id:e,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:l="label"}=t;e=ve(e);let i=ve(),s={};n&&(r=r?`${i} ${r}`:i,s={id:i,htmlFor:l==="label"?e:void 0});let u=dn({id:e,"aria-label":o,"aria-labelledby":r});return{labelProps:s,fieldProps:u}}const jd=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),zd=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Hd(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return jd.has(n.script)}let e=t.split("-")[0];return zd.has(e)}const yi=Symbol.for("react-aria.i18n.locale");function vi(){let t=typeof window<"u"&&window[yi]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:Hd(t)?"rtl":"ltr"}}let ur=vi(),Dt=new Set;function Ko(){ur=vi();for(let t of Dt)t(ur)}function Wd(){let t=et(),[e,n]=a.useState(ur);return a.useEffect(()=>(Dt.size===0&&window.addEventListener("languagechange",Ko),Dt.add(n),()=>{Dt.delete(n),Dt.size===0&&window.removeEventListener("languagechange",Ko)}),[]),t?{locale:typeof window<"u"&&window[yi]||"en-US",direction:"ltr"}:e}const Gd=y.createContext(null);function $t(){let t=Wd();return a.useContext(Gd)||t}function cr(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const Ud=a.createContext(null),xi=7e3;let Re=null;function Lt(t,e="assertive",n=xi){Re?Re.announce(t,e,n):(Re=new qd,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?Re.announce(t,e,n):setTimeout(()=>{Re!=null&&Re.isAttached()&&(Re==null||Re.announce(t,e,n))},100))}class qd{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){var e;return(e=this.node)==null?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",r=xi){var l,i;if(!this.node)return;let o=document.createElement("div");typeof e=="object"?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,n==="assertive"?(l=this.assertiveLog)==null||l.appendChild(o):(i=this.politeLog)==null||i.appendChild(o),e!==""&&setTimeout(()=>{o.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}}function zr(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function Ci(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Ei(t){let e=a.useRef({isFocused:!1,observer:null});return ne(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),a.useCallback(n=>{let r=j(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){e.current.isFocused=!0;let o=r,l=i=>{if(e.current.isFocused=!1,o.disabled){let s=zr(i);t==null||t(s)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",l,{once:!0}),e.current.observer=new MutationObserver(()=>{var i;if(e.current.isFocused&&o.disabled){(i=e.current.observer)==null||i.disconnect();let s=o===re()?null:re();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let mn=!1;function Yd(t){for(;t&&!Jl(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=xe(t),n=e.document.activeElement;if(!n||n===t)return;mn=!0;let r=!1,o=d=>{(j(d)===n||r)&&d.stopImmediatePropagation()},l=d=>{(j(d)===n||r)&&(d.stopImmediatePropagation(),!t&&!r&&(r=!0,Ke(n),u()))},i=d=>{(j(d)===t||r)&&d.stopImmediatePropagation()},s=d=>{(j(d)===t||r)&&(d.stopImmediatePropagation(),r||(r=!0,Ke(n),u()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",l,!0),e.addEventListener("focusin",s,!0),e.addEventListener("focus",i,!0);let u=()=>{cancelAnimationFrame(c),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",l,!0),e.removeEventListener("focusin",s,!0),e.removeEventListener("focus",i,!0),mn=!1,r=!1},c=requestAnimationFrame(u);return u}let ot=null;const dr=new Set;let Kt=new Map,Qe=!1,fr=!1;const Xd={Tab:!0,Escape:!0};function Sn(t,e){for(let n of dr)n(t,e)}function Zd(t){return!(t.metaKey||!Xe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function gn(t){Qe=!0,!_e.isOpening&&Zd(t)&&(ot="keyboard",Sn("keyboard",t))}function ft(t){ot="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(Qe=!0,Sn("pointer",t))}function wi(t){!_e.isOpening&&Yl(t)&&(Qe=!0,ot="virtual")}function Si(t){let e=xe(j(t)),n=ee(j(t));j(t)===e||j(t)===n||mn||!t.isTrusted||(!Qe&&!fr&&(ot="virtual",Sn("virtual",t)),Qe=!1,fr=!1)}function Pi(){mn||(Qe=!1,fr=!0)}function pr(t){if(typeof window>"u"||typeof document>"u")return;const e=xe(t),n=ee(t);if(Kt.get(e))return;let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Qe=!0,r.apply(this,arguments)},n.addEventListener("keydown",gn,!0),n.addEventListener("keyup",gn,!0),n.addEventListener("click",wi,!0),e.addEventListener("focus",Si,!0),e.addEventListener("blur",Pi,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",ft,!0),n.addEventListener("pointermove",ft,!0),n.addEventListener("pointerup",ft,!0)),e.addEventListener("beforeunload",()=>{Ti(t)},{once:!0}),Kt.set(e,{focus:r})}const Ti=(t,e)=>{const n=xe(t),r=ee(t);e&&r.removeEventListener("DOMContentLoaded",e),Kt.has(n)&&(n.HTMLElement.prototype.focus=Kt.get(n).focus,r.removeEventListener("keydown",gn,!0),r.removeEventListener("keyup",gn,!0),r.removeEventListener("click",wi,!0),n.removeEventListener("focus",Si,!0),n.removeEventListener("blur",Pi,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",ft,!0),r.removeEventListener("pointermove",ft,!0),r.removeEventListener("pointerup",ft,!0)),Kt.delete(n))};function Jd(t){const e=ee(t);let n;return e.readyState!=="loading"?pr(t):(n=()=>{pr(t)},e.addEventListener("DOMContentLoaded",n)),()=>Ti(t,n)}typeof document<"u"&&Jd();function Nt(){return ot!=="pointer"}function Ot(){return ot}function Qd(t){ot=t,Sn(t,null)}const ef=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function tf(t,e,n){let r=n?j(n):void 0,o=ee(r),l=xe(r);const i=typeof l<"u"?l.HTMLInputElement:HTMLInputElement,s=typeof l<"u"?l.HTMLTextAreaElement:HTMLTextAreaElement,u=typeof l<"u"?l.HTMLElement:HTMLElement,c=typeof l<"u"?l.KeyboardEvent:KeyboardEvent;let d=re(o);return t=t||d instanceof i&&!ef.has(d.type)||d instanceof s||d instanceof u&&d.isContentEditable,!(t&&e==="keyboard"&&n instanceof c&&!Xd[n.key])}function nf(t,e,n){pr(),a.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,l)=>{tf(!!(n!=null&&n.isTextInput),o,l)&&t(Nt())};return dr.add(r),()=>{dr.delete(r)}},e)}function Ge(t){if(!t.isConnected)return;const e=ee(t);if(Ot()==="virtual"){let n=re(e);ql(()=>{const r=re(e);(r===n||r===e.body)&&t.isConnected&&Ke(t)})}else Ke(t)}function Hr(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:o}=t;const l=a.useCallback(u=>{if(j(u)===u.currentTarget)return r&&r(u),o&&o(!1),!0},[r,o]),i=Ei(l),s=a.useCallback(u=>{let c=j(u);const d=ee(c),f=d?re(d):re();c===u.currentTarget&&c===f&&(n&&n(u),o&&o(!0),i(u))},[o,n,i]);return{focusProps:{onFocus:!e&&(n||o||r)?s:void 0,onBlur:!e&&(r||o)?l:void 0}}}function Ro(t){if(!t)return;let e=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(r),e&&n.stopPropagation()}}function ki(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:Ro(t.onKeyDown),onKeyUp:Ro(t.onKeyUp)}}}let br=y.createContext(null);function rf(t){let e=a.useContext(br)||{};Fr(e,t);let{ref:n,...r}=e;return r}function Pn(t,e){let{focusProps:n}=Hr(t),{keyboardProps:r}=ki(t),o=J(n,r),l=rf(e),i=t.isDisabled?{}:l,s=a.useRef(t.autoFocus);a.useEffect(()=>{s.current&&e.current&&Ge(e.current),s.current=!1},[e]);let u=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(u=void 0),{focusableProps:J({...o,tabIndex:u},i)}}let ct="default",hr="",an=new WeakMap;function of(t){if(Ze()){if(ct==="default"){const e=ee(t);hr=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}ct="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";an.set(t,t.style[e]),t.style[e]="none"}}function Fo(t){if(Ze()){if(ct!=="disabled")return;ct="restoring",setTimeout(()=>{ql(()=>{if(ct==="restoring"){const e=ee(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=hr||""),hr="",ct="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&an.has(t)){let e=an.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),an.delete(t)}}const Vt=y.createContext({register:()=>{}});Vt.displayName="PressResponderContext";function lf(t){let e=a.useContext(Vt);if(e){let{register:n,ref:r,...o}=e;t=J(o,t),n()}return Fr(e,t.ref),t}var bt;class tn{constructor(e,n,r,o){$o(this,bt);Nn(this,bt,!0);let l=(o==null?void 0:o.target)??r.currentTarget;const i=l==null?void 0:l.getBoundingClientRect();let s,u=0,c,d=null;r.clientX!=null&&r.clientY!=null&&(c=r.clientX,d=r.clientY),i&&(c!=null&&d!=null?(s=c-i.left,u=d-i.top):(s=i.width/2,u=i.height/2)),this.type=e,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=s,this.y=u,this.key=r.key}continuePropagation(){Nn(this,bt,!1)}get shouldStopPropagation(){return go(this,bt)}}bt=new WeakMap;const Io=Symbol("linkClicked"),Bo="react-aria-pressable-style",No="data-react-aria-pressable";function Wt(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:l,onClick:i,isDisabled:s,isPressed:u,preventFocusOnPress:c,shouldCancelOnPointerExit:d,allowTextSelectionOnPress:f,ref:b,...p}=lf(t),[m,v]=a.useState(!1),g=a.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:$}=Cn(),D=a.useCallback((h,C)=>{let M=g.current;if(s||M.didFirePressStart)return!1;let E=!0;if(M.isTriggeringEvent=!0,r){let w=new tn("pressstart",C,h);r(w),E=w.shouldStopPropagation}return n&&n(!0),M.isTriggeringEvent=!1,M.didFirePressStart=!0,v(!0),E},[s,r,n]),P=a.useCallback((h,C,M=!0)=>{let E=g.current;if(!E.didFirePressStart)return!1;E.didFirePressStart=!1,E.isTriggeringEvent=!0;let w=!0;if(o){let T=new tn("pressend",C,h);o(T),w=T.shouldStopPropagation}if(n&&n(!1),v(!1),e&&M&&!s){let T=new tn("press",C,h);e(T),w&&(w=T.shouldStopPropagation)}return E.isTriggeringEvent=!1,w},[s,o,n,e]),F=Pe(P),R=a.useCallback((h,C)=>{let M=g.current;if(s)return!1;if(l){M.isTriggeringEvent=!0;let E=new tn("pressup",C,h);return l(E),M.isTriggeringEvent=!1,E.shouldStopPropagation}return!0},[s,l]),I=Pe(R),k=a.useCallback(h=>{let C=g.current;if(C.isPressed&&C.target){C.didFirePressStart&&C.pointerType!=null&&P(qe(C.target,h),C.pointerType,!1),C.isPressed=!1,C.isOverTarget=!1,C.activePointerId=null,C.pointerType=null,$(),f||Fo(C.target);for(let M of C.disposables)M();C.disposables=[]}},[f,$,P]),B=Pe(k);a.useEffect(()=>{s&&g.current.isPressed&&B({currentTarget:g.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[s]);let K=a.useCallback(h=>{d&&k(h)},[d,k]),_=a.useCallback(h=>{s||i==null||i(h)},[s,i]),U=a.useCallback((h,C)=>{if(!s&&i){let M=new MouseEvent("click",h);Ci(M,C),i(zr(M))}},[s,i]),z=a.useMemo(()=>{let h=g.current,C={onKeyDown(E){var w;if(Gn(E.nativeEvent,E.currentTarget)&&te(E.currentTarget,j(E))){Oo(j(E),E.key)&&E.preventDefault();let T=!0;!h.isPressed&&!E.repeat&&(h.target=E.currentTarget,h.isPressed=!0,h.pointerType="keyboard",T=D(E,"keyboard"));let S=E.currentTarget,N=q=>{Gn(q,S)&&!q.repeat&&te(S,j(q))&&h.target&&I(qe(h.target,q),"keyboard")};x(ee(E.currentTarget),"keyup",tt(N,M),!0),T&&E.stopPropagation(),E.metaKey&&Xe()&&((w=h.metaKeyEvents)==null||w.set(E.key,E.nativeEvent))}else E.key==="Meta"&&(h.metaKeyEvents=new Map)},onClick(E){if(!(E&&!te(E.currentTarget,j(E)))&&E&&E.button===0&&!h.isTriggeringEvent&&!_e.isOpening){let w=!0;if(s&&E.preventDefault(),!h.ignoreEmulatedMouseEvents&&!h.isPressed&&(h.pointerType==="virtual"||Yl(E.nativeEvent))){let T=D(E,"virtual"),S=I(E,"virtual"),N=F(E,"virtual");_(E),w=T&&S&&N}else if(h.isPressed&&h.pointerType!=="keyboard"){let T=h.pointerType||E.nativeEvent.pointerType||"virtual",S=I(qe(E.currentTarget,E),T),N=F(qe(E.currentTarget,E),T,!0);w=S&&N,h.isOverTarget=!1,_(E),B(E)}h.ignoreEmulatedMouseEvents=!1,w&&E.stopPropagation()}}},M=E=>{var w,T,S;if(h.isPressed&&h.target&&Gn(E,h.target)){Oo(j(E),E.key)&&E.preventDefault();let N=j(E),q=te(h.target,N);F(qe(h.target,E),"keyboard",q),q&&U(E,h.target),$(),E.key!=="Enter"&&Wr(h.target)&&te(h.target,N)&&!E[Io]&&(E[Io]=!0,_e(h.target,E,!1)),h.isPressed=!1,(w=h.metaKeyEvents)==null||w.delete(E.key)}else if(E.key==="Meta"&&((T=h.metaKeyEvents)!=null&&T.size)){let N=h.metaKeyEvents;h.metaKeyEvents=void 0;for(let q of N.values())(S=h.target)==null||S.dispatchEvent(new KeyboardEvent("keyup",q))}};if(typeof PointerEvent<"u"){C.onPointerDown=T=>{if(T.button!==0||!te(T.currentTarget,j(T)))return;if(mc(T.nativeEvent)){h.pointerType="virtual";return}h.pointerType=T.pointerType;let S=!0;if(!h.isPressed){h.isPressed=!0,h.isOverTarget=!0,h.activePointerId=T.pointerId,h.target=T.currentTarget,f||of(h.target),S=D(T,h.pointerType);let N=j(T);"releasePointerCapture"in N&&("hasPointerCapture"in N?N.hasPointerCapture(T.pointerId)&&N.releasePointerCapture(T.pointerId):N.releasePointerCapture(T.pointerId)),x(ee(T.currentTarget),"pointerup",E,!1),x(ee(T.currentTarget),"pointercancel",w,!1)}S&&T.stopPropagation()},C.onMouseDown=T=>{if(te(T.currentTarget,j(T))&&T.button===0){if(c){let S=Yd(T.target);S&&h.disposables.push(S)}T.stopPropagation()}},C.onPointerUp=T=>{!te(T.currentTarget,j(T))||h.pointerType==="virtual"||T.button===0&&!h.isPressed&&I(T,h.pointerType||T.pointerType)},C.onPointerEnter=T=>{T.pointerId===h.activePointerId&&h.target&&!h.isOverTarget&&h.pointerType!=null&&(h.isOverTarget=!0,D(qe(h.target,T),h.pointerType))},C.onPointerLeave=T=>{T.pointerId===h.activePointerId&&h.target&&h.isOverTarget&&h.pointerType!=null&&(h.isOverTarget=!1,F(qe(h.target,T),h.pointerType,!1),K(T))};let E=T=>{if(T.pointerId===h.activePointerId&&h.isPressed&&T.button===0&&h.target){if(te(h.target,j(T))&&h.pointerType!=null){let S=!1,N=setTimeout(()=>{h.isPressed&&h.target instanceof HTMLElement&&(S?B(T):(Ke(h.target),h.target.click()))},80);x(T.currentTarget,"click",()=>S=!0,!0),h.disposables.push(()=>clearTimeout(N))}else B(T);h.isOverTarget=!1}},w=T=>{B(T)};C.onDragStart=T=>{te(T.currentTarget,j(T))&&B(T)}}return C},[x,s,c,$,f,K,D,_,U]);return a.useEffect(()=>{if(!b)return;const h=ee(b.current);if(!h||!h.head||h.getElementById(Bo))return;const C=h.createElement("style");C.id=Bo;let M=ti(h);M&&(C.nonce=M),C.textContent=` +@layer { + [${No}] { + touch-action: pan-x pan-y pinch-zoom; + } +} + `.trim(),h.head.prepend(C)},[b]),a.useEffect(()=>{let h=g.current;return()=>{f||Fo(h.target??void 0);for(let C of h.disposables)C();h.disposables=[]}},[f]),{isPressed:u||m,pressProps:J(p,z,{[No]:!0})}}function Wr(t){return t.tagName==="A"&&t.hasAttribute("href")}function Gn(t,e){const{key:n,code:r}=t,o=e,l=o.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(o instanceof xe(o).HTMLInputElement&&!Di(o,n)||o instanceof xe(o).HTMLTextAreaElement||o.isContentEditable)&&!((l==="link"||!l&&Wr(o))&&n!=="Enter")}function qe(t,e){let n=e.clientX,r=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r,key:e.key}}function sf(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Wr(t)}function Oo(t,e){return t instanceof HTMLInputElement?!Di(t,e):sf(t)}const af=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Di(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":af.has(t.type)}function uf(t,e){let{elementType:n="button",isDisabled:r,onPress:o,onPressStart:l,onPressEnd:i,onPressUp:s,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:b,target:p,rel:m,type:v="button"}=t,g;n==="button"?g={type:v,disabled:r,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:g={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?p:void 0,type:n==="input"?v:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?m:void 0};let{pressProps:x,isPressed:$}=Wt({onPressStart:l,onPressEnd:i,onPressChange:u,onPress:o,onPressUp:s,onClick:f,isDisabled:r,preventFocusOnPress:c,ref:e}),{focusableProps:D}=Pn(t,e);d&&(D.tabIndex=r?-1:D.tabIndex);let P=J(D,x,pe(t,{labelable:!0}));return{isPressed:$,buttonProps:J(g,P,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}function Tn(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=t,l=a.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=Cn(),u=a.useCallback(f=>{te(f.currentTarget,j(f))&&l.current.isFocusWithin&&!te(f.currentTarget,f.relatedTarget)&&(l.current.isFocusWithin=!1,s(),n&&n(f),o&&o(!1))},[n,o,l,s]),c=Ei(u),d=a.useCallback(f=>{if(!te(f.currentTarget,j(f)))return;let b=j(f);const p=ee(b),m=re(p);if(!l.current.isFocusWithin&&m===b){r&&r(f),o&&o(!0),l.current.isFocusWithin=!0,c(f);let v=f.currentTarget;i(p,"focus",g=>{let x=j(g);if(l.current.isFocusWithin&&!te(v,x)){let $=new p.defaultView.FocusEvent("blur",{relatedTarget:x});Ci($,v);let D=zr($);u(D)}},{capture:!0})}},[r,o,c,i,u]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:u}}}function kn(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,o=a.useRef({isFocused:!1,isFocusVisible:e||Nt()}),[l,i]=a.useState(!1),[s,u]=a.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=a.useCallback(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=a.useCallback(p=>{o.current.isFocused=p,o.current.isFocusVisible=Nt(),i(p),c()},[c]);nf(p=>{o.current.isFocusVisible=p,c()},[n,l],{enabled:l,isTextInput:n});let{focusProps:f}=Hr({isDisabled:r,onFocusChange:d}),{focusWithinProps:b}=Tn({isDisabled:!r,onFocusWithinChange:d});return{isFocused:l,isFocusVisible:s,focusProps:r?b:f}}let mr=!1,nn=0;function cf(){mr=!0,setTimeout(()=>{mr=!1},500)}function Vo(t){t.pointerType==="touch"&&cf()}function df(){let t=ee(null);if(!(typeof t>"u"))return nn===0&&typeof PointerEvent<"u"&&t.addEventListener("pointerup",Vo),nn++,()=>{nn--,!(nn>0)&&typeof PointerEvent<"u"&&t.removeEventListener("pointerup",Vo)}}function Gt(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:o}=t,[l,i]=a.useState(!1),s=a.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;a.useEffect(df,[]);let{addGlobalListener:u,removeAllGlobalListeners:c}=Cn(),{hoverProps:d,triggerHoverEnd:f}=a.useMemo(()=>{let b=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!te(v.currentTarget,j(v)))return;s.isHovered=!0;let x=v.currentTarget;s.target=x,u(ee(j(v)),"pointerover",$=>{s.isHovered&&s.target&&!te(s.target,j($))&&p($,$.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:x,pointerType:g}),n&&n(!0),i(!0)},p=(v,g)=>{let x=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,c(),r&&r({type:"hoverend",target:x,pointerType:g}),n&&n(!1),i(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=v=>{mr&&v.pointerType==="mouse"||b(v,v.pointerType)},m.onPointerLeave=v=>{!o&&te(v.currentTarget,j(v))&&p(v,v.pointerType)}),{hoverProps:m,triggerHoverEnd:p}},[e,n,r,o,s,u,c]);return a.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:d,isHovered:l}}const Dn=a.createContext({}),Gr=Ht(function(e,n){[e,n]=Ce(e,n,Dn);let r=e,{isPending:o}=r,{buttonProps:l,isPressed:i}=uf(e,n);l=pf(l,o);let{focusProps:s,isFocused:u,isFocusVisible:c}=kn(e),{hoverProps:d,isHovered:f}=Gt({...e,isDisabled:e.isDisabled||o}),b={isHovered:f,isPressed:(r.isPressed||i)&&!o,isFocused:u,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:o??!1},p=Ee({...e,values:b,defaultClassName:"react-aria-Button"}),m=ve(l.id),v=ve(),g=l["aria-labelledby"];o&&(g?g=`${g} ${v}`:l["aria-label"]&&(g=`${m} ${v}`));let x=a.useRef(o);a.useEffect(()=>{let D={"aria-labelledby":g||m};(!x.current&&u&&o||x.current&&u&&!o)&&Lt(D,"assertive"),x.current=o},[o,u,g,m]);let $=pe(e,{global:!0});return delete $.onClick,y.createElement(fe.button,{...J($,p,l,s,d),type:l.type==="submit"&&o?"button":l.type,id:m,ref:n,"aria-labelledby":g,slot:e.slot||void 0,"aria-disabled":o?"true":l["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":b.isPressed||void 0,"data-hovered":f||void 0,"data-focused":u||void 0,"data-pending":o||void 0,"data-focus-visible":c||void 0},y.createElement(Ud.Provider,{value:{id:v}},p.children))}),ff=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function pf(t,e){if(e){for(const n in t)n.startsWith("on")&&!ff.test(n)&&(t[n]=void 0);t.href=void 0,t.target=void 0}return t}const bf=typeof document<"u"?y.useInsertionEffect??y.useLayoutEffect:()=>{};function $n(t,e,n){let[r,o]=a.useState(t||e),l=a.useRef(r),i=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{i.current,i.current=s},[s]);let u=s?t:r;bf(()=>{l.current=u});let[,c]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(l.current):f;Object.is(l.current,p)||(l.current=p,o(p),c(),n==null||n(p,...b))},[n]);return[u,d]}const Mi=a.createContext({}),hf=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Mi);let{children:r,level:o=3,className:l,...i}=e,s=fe[`h${o}`];return y.createElement(s,{...i,ref:n,className:l??"react-aria-Heading"},r)}),Ai=t=>t?"true":void 0;function Te(t,e){return Bd(t,(n,r)=>{const o=typeof e=="function"?e(r)??"":e??"";return Bt(o,n??"")??""})}const he=(t,e,n)=>typeof t=="function"?t({className:e}):e,mf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron down icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})}),gf=({height:t=9,width:e=9,...n})=>A.jsx("svg",{"aria-hidden":"true","aria-label":"External link icon",fill:"none",height:t,role:"presentation",viewBox:"0 0 7 7",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:A.jsx("path",{d:"M1.20592 6.84333L0.379822 6.01723L4.52594 1.8672H1.37819L1.38601 0.731812H6.48742V5.83714H5.34421L5.35203 2.6933L1.20592 6.84333Z",fill:"currentColor"})}),$f=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Close icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06Z",fill:"currentColor",fillRule:"evenodd"})}),_o=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Info icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),yf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Warning icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0",fill:"currentColor",fillRule:"evenodd"})}),jo=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Danger icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),vf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Success icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z",fill:"currentColor",fillRule:"evenodd"})}),Li=a.createContext({}),xf=a.createContext({placement:"bottom"}),Cf=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function zo(t){return t.dataset.liveAnnouncer==="true"||t.dataset.reactAriaTopLayer!==void 0}let Et=new WeakMap,$e=[];function Ur(t,e){let n=xe(t==null?void 0:t[0]),r=e instanceof n.Element?{root:e}:e,o=(r==null?void 0:r.root)??document.body,l=(r==null?void 0:r.shouldUseInert)&&Cf,i=new Set(t),s=new Set,u=g=>l&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true",c=(g,x)=>{l&&g instanceof n.HTMLElement?g.inert=x:x?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},d=new Set;if(Ne())for(let g of t){let x=g;for(;x&&x!==o;){let $=x.getRootNode();"shadowRoot"in $&&d.add($.shadowRoot),x=$.parentNode}}let f=g=>{for(let P of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(P);let x=P=>{if(s.has(P)||i.has(P)||P.parentElement&&s.has(P.parentElement)&&P.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let F of i)if(te(P,F))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},$=Gl(ee(g),g,NodeFilter.SHOW_ELEMENT,{acceptNode:x}),D=x(g);if(D===NodeFilter.FILTER_ACCEPT&&b(g),D!==NodeFilter.FILTER_REJECT){let P=$.nextNode();for(;P!=null;)b(P),P=$.nextNode()}},b=g=>{let x=Et.get(g)??0;u(g)&&x===0||(x===0&&c(g,!0),s.add(g),Et.set(g,x+1))};$e.length&&$e[$e.length-1].disconnect(),f(o);let p=new MutationObserver(g=>{for(let x of g)if(x.type==="childList"){if(x.target.isConnected&&![...i,...s].some($=>te($,x.target)))for(let $ of x.addedNodes)($ instanceof HTMLElement||$ instanceof SVGElement)&&zo($)?i.add($):$ instanceof Element&&f($);if(Ne()){for(let $ of d)if(!$.isConnected){p.disconnect();break}}}});p.observe(o,{childList:!0,subtree:!0});let m=new Set;if(Ne())for(let g of d){let x=new MutationObserver($=>{for(let D of $)if(D.type==="childList"){if(D.target.isConnected&&![...i,...s].some(P=>te(P,D.target)))for(let P of D.addedNodes)(P instanceof HTMLElement||P instanceof SVGElement)&&zo(P)?i.add(P):P instanceof Element&&f(P);if(Ne()){for(let P of d)if(!P.isConnected){p.disconnect();break}}}});x.observe(g,{childList:!0,subtree:!0}),m.add(x)}let v={visibleNodes:i,hiddenNodes:s,observe(){p.observe(o,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return $e.push(v),()=>{if(p.disconnect(),Ne())for(let g of m)g.disconnect();for(let g of s){let x=Et.get(g);x!=null&&(x===1?(c(g,!1),Et.delete(g)):Et.set(g,x-1))}v===$e[$e.length-1]?($e.pop(),$e.length&&$e[$e.length-1].observe()):$e.splice($e.indexOf(v),1)}}function Ef(t){let e=$e[$e.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const ke={top:"top",bottom:"top",left:"left",right:"left"},yn={top:"bottom",bottom:"top",left:"right",right:"left"},wf={top:"left",left:"top"},gr={top:"height",left:"width"},Ki={width:"totalWidth",height:"totalHeight"},rn={};let Sf=()=>typeof document<"u"?window.visualViewport:null;function Ho(t,e){let n=0,r=0,o=0,l=0,i=0,s=0,u={},c=((e==null?void 0:e.scale)??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let d=document.documentElement;o=d.clientWidth,l=d.clientHeight,n=(e==null?void 0:e.width)??o,r=(e==null?void 0:e.height)??l,u.top=d.scrollTop||t.scrollTop,u.left=d.scrollLeft||t.scrollLeft,e&&(i=e.offsetTop,s=e.offsetLeft)}else({width:n,height:r,top:i,left:s}=_t(t,!1)),u.top=t.scrollTop,u.left=t.scrollLeft,o=n,l=r;return _l()&&(t.tagName==="BODY"||t.tagName==="HTML")&&c&&(u.top=0,u.left=0,i=(e==null?void 0:e.pageTop)??0,s=(e==null?void 0:e.pageLeft)??0),{width:n,height:r,totalWidth:o,totalHeight:l,scroll:u,top:i,left:s}}function Pf(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Wo(t,e,n,r,o,l,i){let s=o.scroll[t]??0,u=r[gr[t]],c=i[t]+r.scroll[ke[t]]+l,d=i[t]+r.scroll[ke[t]]+u-l,f=e-s+r.scroll[ke[t]]+i[t]-r[ke[t]],b=e-s+n+r.scroll[ke[t]]+i[t]-r[ke[t]];return fd?Math.max(d-b,c-f):0}function Tf(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function Go(t){if(rn[t])return rn[t];let[e,n]=t.split(" "),r=ke[e]||"right",o=wf[r];ke[n]||(n="center");let l=gr[r],i=gr[o];return rn[t]={placement:e,crossPlacement:n,axis:r,crossAxis:o,size:l,crossSize:i},rn[t]}function Un(t,e,n,r,o,l,i,s,u,c,d){let{placement:f,crossPlacement:b,axis:p,crossAxis:m,size:v,crossSize:g}=r,x={};x[m]=t[m]??0,b==="center"?x[m]+=((t[g]??0)-(n[g]??0))/2:b!==m&&(x[m]+=(t[g]??0)-(n[g]??0)),x[m]+=l;const $=t[m]-n[g]+u+c,D=t[m]+t[g]-u-c;if(x[m]=cr(x[m],$,D),f===p){let P=s?d[v]:d[Ki[v]];x[yn[p]]=Math.floor(P-t[p]+o)}else x[p]=Math.floor(t[p]+t[v]+o);return x}function kf(t,e,n,r,o,l,i,s,u,c,d){let f=(t.top!=null?t.top:u[Ki.height]-(t.bottom??0)-i)-(u.scroll.top??0),b=c?n.top:0,p={top:Math.max(e.top+b,((d==null?void 0:d.offsetTop)??e.top)+b),bottom:Math.min(e.top+e.height+b,((d==null?void 0:d.offsetTop)??0)+((d==null?void 0:d.height)??0))};return s!=="top"?Math.max(0,p.bottom-f-((o.top??0)+(o.bottom??0)+l)):Math.max(0,f+i-p.top-((o.top??0)+(o.bottom??0)+l))}function Uo(t,e,n,r,o,l,i,s){let{placement:u,axis:c,size:d}=l;return u===c?Math.max(0,n[c]-(i.scroll[c]??0)-(t[c]+(s?e[c]:0))-(r[c]??0)-r[yn[c]]-o):Math.max(0,t[d]+t[c]+(s?e[c]:0)-n[c]-n[d]+(i.scroll[c]??0)-(r[c]??0)-r[yn[c]]-o)}function Df(t,e,n,r,o,l,i,s,u,c,d,f,b,p,m,v,g,x){let $=Go(t),{size:D,crossAxis:P,crossSize:F,placement:R,crossPlacement:I}=$,k=Un(e,s,n,$,d,f,c,b,m,v,u),B=d,K=Uo(s,c,e,o,l+d,$,u,g);if(i&&n[D]>K){let Q=Go(`${yn[R]} ${I}`),le=Un(e,s,n,Q,d,f,c,b,m,v,u);Uo(s,c,e,o,l+d,Q,u,g)>K&&($=Q,k=le,B=d)}let _="bottom";$.axis==="top"?$.placement==="top"?_="top":$.placement==="bottom"&&(_="bottom"):$.crossAxis==="top"&&($.crossPlacement==="top"?_="bottom":$.crossPlacement==="bottom"&&(_="top"));let U=Wo(P,k[P],n[F],s,u,l,c);k[P]+=U;let z=kf(k,s,c,b,o,l,n.height,_,u,g,x);p&&p{if(!n||r===null)return;let o=l=>{let i=j(l);if(!e.current||i instanceof Node&&!te(i,e.current)||i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)return;let s=r||Ri.get(e.current);s&&s()};return window.addEventListener("scroll",o,!0),()=>{window.removeEventListener("scroll",o,!0)}},[n,r,e])}let ae=typeof document<"u"?window.visualViewport:null;function Kf(t){let{direction:e}=$t(),{arrowSize:n,targetRef:r,overlayRef:o,arrowRef:l,scrollRef:i=o,placement:s="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d=typeof document<"u"?document.body:null,offset:f=0,crossOffset:b=0,shouldUpdatePosition:p=!0,isOpen:m=!0,onClose:v,maxHeight:g,arrowBoundaryOffset:x=0}=t,[$,D]=a.useState(null),P=[p,s,o.current,r.current,l==null?void 0:l.current,i.current,u,c,d,f,b,m,e,g,x,n],F=a.useRef(ae==null?void 0:ae.scale);a.useEffect(()=>{m&&(F.current=ae==null?void 0:ae.scale)},[m]);let R=a.useCallback(()=>{var z,h;if(p===!1||!m||!o.current||!r.current||!d||(ae==null?void 0:ae.scale)!==F.current)return;let B=null;if(i.current&&It(i.current)){let C=(z=re())==null?void 0:z.getBoundingClientRect(),M=i.current.getBoundingClientRect();B={type:"top",offset:((C==null?void 0:C.top)??0)-M.top},B.offset>M.height/2&&(B.type="bottom",B.offset=((C==null?void 0:C.bottom)??0)-M.bottom)}let K=o.current;!g&&o.current&&(K.style.top="0px",K.style.bottom="",K.style.maxHeight=(((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight)+"px");let _=Mf({placement:Ff(s,e),overlayNode:o.current,targetNode:r.current,scrollNode:i.current||o.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:b,maxHeight:g,arrowSize:n??(l!=null&&l.current?Mn(l.current,!0).width:0),arrowBoundaryOffset:x});if(!_.position)return;K.style.top="",K.style.bottom="",K.style.left="",K.style.right="",Object.keys(_.position).forEach(C=>K.style[C]=_.position[C]+"px"),K.style.maxHeight=_.maxHeight!=null?_.maxHeight+"px":"";let U=re();if(B&&U&&i.current){let C=U.getBoundingClientRect(),M=i.current.getBoundingClientRect(),E=C[B.type]-M[B.type];i.current.scrollTop+=E-B.offset}D(_)},P);ne(R,P),Rf(R),fn({ref:o,onResize:R}),fn({ref:r,onResize:R});let I=a.useRef(!1);ne(()=>{let B,K=()=>{I.current=!0,clearTimeout(B),B=setTimeout(()=>{I.current=!1},500),R()},_=()=>{I.current&&K()};return ae==null||ae.addEventListener("resize",K),ae==null||ae.addEventListener("scroll",_),()=>{ae==null||ae.removeEventListener("resize",K),ae==null||ae.removeEventListener("scroll",_)}},[R]);let k=a.useCallback(()=>{I.current||v==null||v()},[v,I]);return Lf({triggerRef:r,isOpen:m,onClose:v&&k}),{overlayProps:{style:{position:$?"absolute":"fixed",top:$?void 0:0,left:$?void 0:0,zIndex:1e5,...$==null?void 0:$.position,maxHeight:($==null?void 0:$.maxHeight)??"100vh"}},placement:($==null?void 0:$.placement)??null,triggerAnchorPoint:($==null?void 0:$.triggerAnchorPoint)??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:$==null?void 0:$.arrowOffsetLeft,top:$==null?void 0:$.arrowOffsetTop}},updatePosition:R}}function Rf(t){ne(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ff(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Xo=y.createContext(null),$r="react-aria-focus-scope-restore";let ie=null;function Fi(t){let{children:e,contain:n,restoreFocus:r,autoFocus:o}=t,l=a.useRef(null),i=a.useRef(null),s=a.useRef([]),{parentNode:u}=a.useContext(Xo)||{},c=a.useMemo(()=>new vr({scopeRef:s}),[s]);ne(()=>{let b=u||ce.root;if(ce.getTreeNode(b.scopeRef)&&ie&&!vn(ie,b.scopeRef)){let p=ce.getTreeNode(ie);p&&(b=p)}b.addChild(c),ce.addNode(c)},[c,u]),ne(()=>{let b=ce.getTreeNode(s);b&&(b.contain=!!n)},[n]),ne(()=>{var v;let b=(v=l.current)==null?void 0:v.nextSibling,p=[],m=g=>g.stopPropagation();for(;b&&b!==i.current;)p.push(b),b.addEventListener($r,m),b=b.nextSibling;return s.current=p,()=>{for(let g of p)g.removeEventListener($r,m)}},[e]),jf(s,r,n),Of(s,n),zf(s,r,n),_f(s,o),a.useEffect(()=>{const b=re(ee(s.current?s.current[0]:void 0));let p=null;if(De(b,s.current)){for(let m of ce.traverse())m.scopeRef&&De(b,m.scopeRef.current)&&(p=m);p===ce.getTreeNode(s)&&(ie=p.scopeRef)}},[s]),ne(()=>()=>{var p,m;let b=((m=(p=ce.getTreeNode(s))==null?void 0:p.parent)==null?void 0:m.scopeRef)??null;(s===ie||vn(s,ie))&&(!b||ce.getTreeNode(b))&&(ie=b),ce.removeTreeNode(s)},[s]);let d=a.useMemo(()=>If(s),[]),f=a.useMemo(()=>({focusManager:d,parentNode:c}),[c,d]);return y.createElement(Xo.Provider,{value:f},y.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:l}),e,y.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:i}))}function If(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:o,wrap:l,accept:i}=e,s=r||re(ee(n[0]??void 0)),u=n[0].previousElementSibling,c=Ye(n),d=Ve(c,{tabbable:o,accept:i},n);d.currentNode=De(s,n)?s:u;let f=d.nextNode();return!f&&l&&(d.currentNode=u,f=d.nextNode()),f&&Oe(f,!0),f},focusPrevious(e={}){let n=t.current,{from:r,tabbable:o,wrap:l,accept:i}=e,s=r||re(ee(n[0]??void 0)),u=n[n.length-1].nextElementSibling,c=Ye(n),d=Ve(c,{tabbable:o,accept:i},n);d.currentNode=De(s,n)?s:u;let f=d.previousNode();return!f&&l&&(d.currentNode=u,f=d.previousNode()),f&&Oe(f,!0),f},focusFirst(e={}){let n=t.current,{tabbable:r,accept:o}=e,l=Ye(n),i=Ve(l,{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let s=i.nextNode();return s&&Oe(s,!0),s},focusLast(e={}){let n=t.current,{tabbable:r,accept:o}=e,l=Ye(n),i=Ve(l,{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let s=i.previousNode();return s&&Oe(s,!0),s}}}function Ye(t){return t[0].parentElement}function Mt(t){let e=ce.getTreeNode(ie);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function Bf(t){if(!t.form)return Array.from(ee(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(r=>!r.form);const e=t.form.elements.namedItem(t.name);let n=xe(t);return e instanceof n.RadioNodeList?Array.from(e).filter(r=>r instanceof n.HTMLInputElement):e instanceof n.HTMLInputElement?[e]:[]}function Nf(t){if(t.checked)return!0;const e=Bf(t);return e.length>0&&!e.some(n=>n.checked)}function Of(t,e){let n=a.useRef(void 0),r=a.useRef(void 0);ne(()=>{let o=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const l=ee(o?o[0]:void 0);let i=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!Mt(t)||c.isComposing)return;let d=re(l),f=t.current;if(!f||!De(d,f))return;let b=Ye(f),p=Ve(b,{tabbable:!0},f);if(!d)return;p.currentNode=d;let m=c.shiftKey?p.previousNode():p.nextNode();m||(p.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,m=c.shiftKey?p.previousNode():p.nextNode()),c.preventDefault(),m&&(Oe(m,!0),m instanceof xe(m).HTMLInputElement&&m.select())},s=c=>{(!ie||vn(ie,t))&&De(j(c),t.current)?(ie=t,n.current=j(c)):Mt(t)&&!We(j(c),t)?n.current?n.current.focus():ie&&ie.current&&yr(ie.current):Mt(t)&&(n.current=j(c))},u=c=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{var p;let d=Ot(),f=(d==="virtual"||d===null)&&Rr()&&jl(),b=re(l);if(!f&&b&&Mt(t)&&!We(b,t)){ie=t;let m=j(c);m&&m.isConnected?(n.current=m,(p=n.current)==null||p.focus()):ie.current&&yr(ie.current)}})};return l.addEventListener("keydown",i,!1),l.addEventListener("focusin",s,!1),o==null||o.forEach(c=>c.addEventListener("focusin",s,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",u,!1)),()=>{l.removeEventListener("keydown",i,!1),l.removeEventListener("focusin",s,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",s,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",u,!1))}},[t,e]),ne(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function Ii(t){return We(t)}function De(t,e){return!t||!e?!1:e.some(n=>te(n,t))}function We(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of ce.traverse(ce.getTreeNode(e)))if(n&&De(t,n.current))return!0;return!1}function Vf(t){return We(t,ie)}function vn(t,e){var r;let n=(r=ce.getTreeNode(e))==null?void 0:r.parent;for(;n;){if(n.scopeRef===t)return!0;n=n.parent}return!1}function Oe(t,e=!1){if(t!=null&&!e)try{Ge(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function Bi(t,e=!0){let n=t[0].previousElementSibling,r=Ye(t),o=Ve(r,{tabbable:e},t);o.currentNode=n;let l=o.nextNode();return e&&!l&&(r=Ye(t),o=Ve(r,{tabbable:!1},t),o.currentNode=n,l=o.nextNode()),l}function yr(t,e=!0){Oe(Bi(t,e))}function _f(t,e){const n=y.useRef(e);a.useEffect(()=>{if(n.current){ie=t;const r=ee(t.current?t.current[0]:void 0);!De(re(r),ie.current)&&t.current&&yr(t.current)}n.current=!1},[t])}function jf(t,e,n){ne(()=>{if(e||n)return;let r=t.current;const o=ee(r?r[0]:void 0);let l=i=>{let s=j(i);De(s,t.current)?ie=t:Ii(s)||(ie=null)};return o.addEventListener("focusin",l,!1),r==null||r.forEach(i=>i.addEventListener("focusin",l,!1)),()=>{o.removeEventListener("focusin",l,!1),r==null||r.forEach(i=>i.removeEventListener("focusin",l,!1))}},[t,e,n])}function Zo(t){let e=ce.getTreeNode(ie);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function zf(t,e,n){const r=a.useRef(typeof document<"u"?re(ee(t.current?t.current[0]:void 0)):null);ne(()=>{let o=t.current;const l=ee(o?o[0]:void 0);if(!e||n)return;let i=()=>{(!ie||vn(ie,t))&&De(re(l),t.current)&&(ie=t)};return l.addEventListener("focusin",i,!1),o==null||o.forEach(s=>s.addEventListener("focusin",i,!1)),()=>{l.removeEventListener("focusin",i,!1),o==null||o.forEach(s=>s.removeEventListener("focusin",i,!1))}},[t,n]),ne(()=>{const o=ee(t.current?t.current[0]:void 0);if(!e)return;let l=i=>{if(i.key!=="Tab"||i.altKey||i.ctrlKey||i.metaKey||!Mt(t)||i.isComposing)return;let s=o.activeElement;if(!We(s,t)||!Zo(t))return;let u=ce.getTreeNode(t);if(!u)return;let c=u.nodeToRestore,d=Ve(o.body,{tabbable:!0});d.currentNode=s;let f=i.shiftKey?d.previousNode():d.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,u.nodeToRestore=void 0),(!f||!We(f,t))&&c){d.currentNode=c;do f=i.shiftKey?d.previousNode():d.nextNode();while(We(f,t));i.preventDefault(),i.stopPropagation(),f?Oe(f,!0):Ii(c)?Oe(c,!0):s.blur()}};return n||o.addEventListener("keydown",l,!0),()=>{n||o.removeEventListener("keydown",l,!0)}},[t,e,n]),ne(()=>{const o=ee(t.current?t.current[0]:void 0);if(!e)return;let l=ce.getTreeNode(t);if(l)return l.nodeToRestore=r.current??void 0,()=>{let i=ce.getTreeNode(t);if(!i)return;let s=i.nodeToRestore,u=re(o);if(e&&s&&(u&&We(u,t)||u===o.body&&Zo(t))){let c=ce.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let d=c.getTreeNode(t);for(;d;){if(d.nodeToRestore&&d.nodeToRestore.isConnected){Jo(d.nodeToRestore);return}d=d.parent}for(d=c.getTreeNode(t);d;){if(d.scopeRef&&d.scopeRef.current&&ce.getTreeNode(d.scopeRef)){let f=Bi(d.scopeRef.current,!0);Jo(f);return}d=d.parent}}})}}},[t,e])}function Jo(t){t.dispatchEvent(new CustomEvent($r,{bubbles:!0,cancelable:!0}))&&Oe(t)}function Ve(t,e,n){let r=e!=null&&e.tabbable?Ql:Jl,o=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null,l=ee(o),i=Gl(l,t||l,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return te(e==null?void 0:e.from,s)||e!=null&&e.tabbable&&s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(!Nf(s)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===s.name)?NodeFilter.FILTER_REJECT:r(s)&&(!n||De(s,n))&&(!(e!=null&&e.accept)||e.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e!=null&&e.from&&(i.currentNode=e.from),i}class qr{constructor(){this.fastMap=new Map,this.root=new vr({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,r){let o=this.fastMap.get(n??null);if(!o)return;let l=new vr({scopeRef:e});o.addChild(l),l.parent=o,this.fastMap.set(e,l),r&&(l.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let r=n.parent;for(let l of this.traverse())l!==n&&n.nodeToRestore&&l.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&De(l.nodeToRestore,n.scopeRef.current)&&(l.nodeToRestore=n.nodeToRestore);let o=n.children;r&&(r.removeChild(n),o.size>0&&o.forEach(l=>r&&r.addChild(l))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var n;let e=new qr;for(let r of this.traverse())e.addTreeNode(r.scopeRef,((n=r.parent)==null?void 0:n.scopeRef)??null,r.nodeToRestore);return e}}class vr{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let ce=new qr;function Hf(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=t,l=a.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=Pe(u=>{n&&Qo(u,e)&&(o&&o(u),l.current.isPointerDown=!0)}),s=Pe(u=>{n&&n(u)});a.useEffect(()=>{let u=l.current;if(r)return;const c=e.current,d=ee(c);if(typeof PointerEvent<"u"){let f=b=>{u.isPointerDown&&Qo(b,e)&&s(b),u.isPointerDown=!1};return d.addEventListener("pointerdown",i,!0),d.addEventListener("click",f,!0),()=>{d.removeEventListener("pointerdown",i,!0),d.removeEventListener("click",f,!0)}}},[e,r])}function Qo(t,e){if(t.button>0)return!1;let n=j(t);if(n){const r=n.ownerDocument;if(!r||!te(r.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}const Fe=[];function Ni(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:o,isDismissable:l=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:s}=t,u=a.useRef(void 0);a.useEffect(()=>{if(o&&!Fe.includes(e))return Fe.push(e),()=>{let m=Fe.indexOf(e);m>=0&&Fe.splice(m,1)}},[o,e]);let c=()=>{Fe[Fe.length-1]===e&&n&&n()},d=m=>{const v=Fe[Fe.length-1];u.current=v,(!s||s(j(m)))&&v===e&&m.stopPropagation()},f=m=>{(!s||s(j(m)))&&(Fe[Fe.length-1]===e&&m.stopPropagation(),u.current===e&&c()),u.current=void 0},b=m=>{m.key==="Escape"&&!i&&!m.nativeEvent.isComposing&&(m.stopPropagation(),m.preventDefault(),c())};Hf({ref:e,onInteractOutside:l&&o?f:void 0,onInteractOutsideStart:d});let{focusWithinProps:p}=Tn({isDisabled:!r,onBlurWithin:m=>{!m.relatedTarget||Vf(m.relatedTarget)||(!s||s(m.relatedTarget))&&(n==null||n())}});return{overlayProps:{onKeyDown:b,...p},underlayProps:{}}}const Rt=typeof document<"u"&&window.visualViewport;let on=0,qn;function Oi(t={}){let{isDisabled:e}=t;ne(()=>{if(!e)return on++,on===1&&(Ze()?qn=Gf():qn=Wf()),()=>{on--,on===0&&qn()}},[e])}function Wf(){let t=window.innerWidth-document.documentElement.clientWidth;return tt(t>0&&("scrollbarGutter"in document.documentElement.style?un(document.documentElement,"scrollbarGutter","stable"):un(document.documentElement,"paddingRight",`${t}px`)),un(document.documentElement,"overflow","hidden"))}function Gf(){let t=un(document.documentElement,"overflow","hidden"),e,n=!1,r=d=>{let f=j(d);e=Je(f)?f:Ir(f,!0),n=!1;let b=f.ownerDocument.defaultView.getSelection();b&&!b.isCollapsed&&b.containsNode(f,!0)&&(n=!0),d.composedPath().some(p=>p instanceof HTMLInputElement&&p.type==="range")&&(n=!0),"selectionStart"in f&&"selectionEnd"in f&&f.selectionStart{if(!(d.touches.length===2||n)){if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&d.preventDefault()}},s=d=>{var p;let f=j(d),b=d.relatedTarget;if(b&&At(b))b.focus({preventScroll:!0}),el(b,At(f));else if(!b){let m=(p=f.parentElement)==null?void 0:p.closest("[tabindex]");m==null||m.focus({preventScroll:!0})}},u=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(d){let f=re(),b=f!=null&&At(f);u.call(this,{...d,preventScroll:!0}),(!d||!d.preventScroll)&&el(this,b)};let c=tt(Yn(document,"touchstart",r,{passive:!1,capture:!0}),Yn(document,"touchmove",i,{passive:!1,capture:!0}),Yn(document,"blur",s,!0));return()=>{t(),c(),o.remove(),HTMLElement.prototype.focus=u}}function un(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Yn(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function el(t,e){e||!Rt?tl(t):Rt.addEventListener("resize",()=>tl(t),{once:!0})}function tl(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Ir(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let o=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topo.top+n.clientHeight){let i=o.bottom;Rt&&(i=Math.min(i,Rt.offsetTop+Rt.height));let s=l.top-o.top-((i-o.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+s)),behavior:"smooth"})}}n=r.parentElement}}function Uf(t,e){let{triggerRef:n,popoverRef:r,groupRef:o,isNonModal:l,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...u}=t,c=u.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=Ni({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},o??r),{overlayProps:b,arrowProps:p,placement:m,triggerAnchorPoint:v}=Kf({...u,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return Oi({isDisabled:l||!e.isOpen}),a.useEffect(()=>{if(e.isOpen&&r.current)return l?Ef((o==null?void 0:o.current)??r.current):Ur([(o==null?void 0:o.current)??r.current],{shouldUseInert:!0})},[l,e.isOpen,r,o]),{popoverProps:J(d,b),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:v}}var Vi={};Vi={dismiss:"تجاهل"};var _i={};_i={dismiss:"Отхвърляне"};var ji={};ji={dismiss:"Odstranit"};var zi={};zi={dismiss:"Luk"};var Hi={};Hi={dismiss:"Schließen"};var Wi={};Wi={dismiss:"Απόρριψη"};var Gi={};Gi={dismiss:"Dismiss"};var Ui={};Ui={dismiss:"Descartar"};var qi={};qi={dismiss:"Lõpeta"};var Yi={};Yi={dismiss:"Hylkää"};var Xi={};Xi={dismiss:"Rejeter"};var Zi={};Zi={dismiss:"התעלם"};var Ji={};Ji={dismiss:"Odbaci"};var Qi={};Qi={dismiss:"Elutasítás"};var es={};es={dismiss:"Ignora"};var ts={};ts={dismiss:"閉じる"};var ns={};ns={dismiss:"무시"};var rs={};rs={dismiss:"Atmesti"};var os={};os={dismiss:"Nerādīt"};var ls={};ls={dismiss:"Lukk"};var is={};is={dismiss:"Negeren"};var ss={};ss={dismiss:"Zignoruj"};var as={};as={dismiss:"Descartar"};var us={};us={dismiss:"Dispensar"};var cs={};cs={dismiss:"Revocare"};var ds={};ds={dismiss:"Пропустить"};var fs={};fs={dismiss:"Zrušiť"};var ps={};ps={dismiss:"Opusti"};var bs={};bs={dismiss:"Odbaci"};var hs={};hs={dismiss:"Avvisa"};var ms={};ms={dismiss:"Kapat"};var gs={};gs={dismiss:"Скасувати"};var $s={};$s={dismiss:"取消"};var ys={};ys={dismiss:"關閉"};var vs={};vs={"ar-AE":Vi,"bg-BG":_i,"cs-CZ":ji,"da-DK":zi,"de-DE":Hi,"el-GR":Wi,"en-US":Gi,"es-ES":Ui,"et-EE":qi,"fi-FI":Yi,"fr-FR":Xi,"he-IL":Zi,"hr-HR":Ji,"hu-HU":Qi,"it-IT":es,"ja-JP":ts,"ko-KR":ns,"lt-LT":rs,"lv-LV":os,"nb-NO":ls,"nl-NL":is,"pl-PL":ss,"pt-BR":as,"pt-PT":us,"ro-RO":cs,"ru-RU":ds,"sk-SK":fs,"sl-SI":ps,"sr-SP":bs,"sv-SE":hs,"tr-TR":ms,"uk-UA":gs,"zh-CN":$s,"zh-TW":ys};const qf=Symbol.for("react-aria.i18n.locale"),Yf=Symbol.for("react-aria.i18n.strings");let at;class An{constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,r])=>r)),this.defaultLocale=n}getStringForLocale(e,n){let o=this.getStringsForLocale(n)[e];if(!o)throw new Error(`Could not find intl message ${e} in ${n} locale`);return o}getStringsForLocale(e){let n=this.strings[e];return n||(n=Xf(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[qf];if(at===void 0){let o=window[Yf];if(!o)return null;at={};for(let l in o)at[l]=new An({[n]:o[l]},n)}let r=at==null?void 0:at[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}function Xf(t,e,n="en-US"){if(e[t])return e[t];let r=Zf(t);if(e[r])return e[r];for(let o in e)if(o.startsWith(r+"-"))return e[o];return e[n]}function Zf(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const nl=new Map,rl=new Map;class Jf{constructor(e,n){this.locale=e,this.strings=n}format(e,n){let r=this.strings.getStringForLocale(e,this.locale);return typeof r=="function"?r(n,this):r}plural(e,n,r="cardinal"){let o=n["="+e];if(o)return typeof o=="function"?o():o;let l=this.locale+":"+r,i=nl.get(l);i||(i=new Intl.PluralRules(this.locale,{type:r}),nl.set(l,i));let s=i.select(e);return o=n[s]||n.other,typeof o=="function"?o():o}number(e){let n=rl.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),rl.set(this.locale,n)),n.format(e)}select(e,n){let r=e[n]||e.other;return typeof r=="function"?r():r}}const ol=new WeakMap;function Qf(t){let e=ol.get(t);return e||(e=new An(t),ol.set(t,e)),e}function ep(t,e){return e&&An.getGlobalDictionaryForPackage(e)||Qf(t)}function Yr(t,e){let{locale:n}=$t(),r=ep(t,e);return a.useMemo(()=>new Jf(n,r),[n,r])}const ll={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function tp(t={}){let{style:e,isFocusable:n}=t,[r,o]=a.useState(!1),{focusWithinProps:l}=Tn({isDisabled:!n,onFocusWithinChange:s=>o(s)}),i=a.useMemo(()=>r?e:e?{...ll,...e}:ll,[r]);return{visuallyHiddenProps:{...l,style:i}}}function np(t){let{children:e,elementType:n="div",isFocusable:r,style:o,...l}=t,{visuallyHiddenProps:i}=tp(t);return y.createElement(n,J(l,i),e)}function rp(t){return t&&t.__esModule?t.default:t}function xr(t){let{onDismiss:e,...n}=t,r=Yr(rp(vs),"@react-aria/overlays"),o=dn(n,r.format("dismiss")),l=()=>{e&&e()};return y.createElement(np,null,y.createElement("button",{...o,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}const op=y.forwardRef(({children:t,...e},n)=>{let r=a.useRef(!1),o=a.useContext(Vt),l=J(o||{},{...e,register(){r.current=!0,o&&o.register()}});return l.ref=nt(n||(o==null?void 0:o.ref)),Fr(o,l.ref),a.useEffect(()=>{r.current||(r.current=!0)},[]),y.createElement(Vt.Provider,{value:l},t)});function lp({children:t}){let e=a.useMemo(()=>({register:()=>{}}),[]);return y.createElement(Vt.Provider,{value:e},t)}const ip=a.createContext({});function sp(){return a.useContext(ip)??{}}const xs=y.createContext(null);function Cr(t){let e=et(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[o,l]=a.useState(!1),i=a.useMemo(()=>({contain:o,setContain:l}),[o,l]),{getContainer:s}=sp();if(!t.portalContainer&&s&&(n=s()),!n)return null;let u=t.children;return t.disableFocusManagement||(u=y.createElement(Fi,{restoreFocus:!0,contain:(t.shouldContainFocus||o)&&!r},u)),u=y.createElement(xs.Provider,{value:i},y.createElement(lp,null,u)),Tu.createPortal(u,n)}function Cs(){let t=a.useContext(xs),e=t==null?void 0:t.setContain;ne(()=>{e==null||e(!0)},[e])}function Ln(t){let[e,n]=$n(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=a.useCallback(()=>{n(!0)},[n]),o=a.useCallback(()=>{n(!1)},[n]),l=a.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:o,toggle:l}}const Xr=a.createContext(null),il=a.createContext(null),ap=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Xr);let r=a.useContext(lt),o=Ln(e),l=e.isOpen!=null||e.defaultOpen!=null||!r?o:r,i=or(n,l.isOpen)||e.isExiting||!1,s=Vd(),{direction:u}=$t();if(s){let c=e.children;return typeof c=="function"&&(c=c({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),y.createElement(y.Fragment,null,c)}return l&&!l.isOpen&&!i?null:y.createElement(up,{...e,triggerRef:e.triggerRef,state:l,popoverRef:n,isExiting:i,dir:u})});function up({state:t,isExiting:e,UNSTABLE_portalContainer:n,clearContexts:r,...o}){var K,_;let l=a.useRef(null),i=a.useRef(null),s=a.useContext(il),u=s&&o.trigger==="SubmenuTrigger",{popoverProps:c,underlayProps:d,arrowProps:f,placement:b,triggerAnchorPoint:p}=Uf({...o,offset:o.offset??8,arrowRef:l,groupRef:u?s:i},t),m=o.popoverRef,v=Br(m,!!b)||o.isEntering||!1,g=Ee({...o,defaultClassName:"react-aria-Popover",values:{trigger:o.trigger||null,placement:b,isEntering:v,isExiting:e}}),x=!o.isNonModal||o.trigger==="SubmenuTrigger",[$,D]=a.useState(!1);ne(()=>{m.current&&D(x&&!m.current.querySelector("[role=dialog]"))},[m,x]),a.useEffect(()=>{$&&(o.trigger!=="SubmenuTrigger"||Ot()!=="pointer")&&m.current&&!It(m.current)&&Ge(m.current)},[$,m,o.trigger]);let P=a.useMemo(()=>{let U=g.children;if(r)for(let z of r)U=y.createElement(z.Provider,{value:null},U);return U},[g.children,r]),[F,R]=a.useState(null),I=a.useCallback(()=>{o.triggerRef.current&&R(o.triggerRef.current.getBoundingClientRect().width+"px")},[o.triggerRef]);ne(I,[I]),fn({ref:(K=g.style)!=null&&K["--trigger-width"]?void 0:o.triggerRef,onResize:I});let k={...c.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,...g.style,"--trigger-width":((_=g.style)==null?void 0:_["--trigger-width"])||F},B=y.createElement(fe.div,{...J(pe(o,{global:!0}),c),...g,role:$?"dialog":void 0,tabIndex:$?-1:void 0,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"],ref:m,slot:o.slot||void 0,style:k,dir:o.dir,"data-trigger":o.trigger,"data-placement":b,"data-entering":v||void 0,"data-exiting":e||void 0},!o.isNonModal&&y.createElement(xr,{onDismiss:t.close}),y.createElement(xf.Provider,{value:{...f,placement:b,ref:l}},P),y.createElement(xr,{onDismiss:t.close}));return u?y.createElement(Cr,{...o,shouldContainFocus:$,isExiting:e,portalContainer:n??(s==null?void 0:s.current)??void 0},B):y.createElement(Cr,{...o,shouldContainFocus:$,isExiting:e,portalContainer:n},!o.isNonModal&&t.isOpen&&y.createElement("div",{"data-testid":"underlay",...d,style:{position:"fixed",inset:0}}),y.createElement("div",{ref:i,style:{display:"contents"}},y.createElement(il.Provider,{value:i},B)))}class yt{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,n,r){let o=this.clone();return n.addDescendants(o,e),o}}class Es extends yt{filter(e,n,r){let[o,l]=ws(e,n,this.firstChildKey,r),i=this.clone();return i.firstChildKey=o,i.lastChildKey=l,i}}const oo=class oo extends yt{};oo.type="header";let sl=oo;const lo=class lo extends yt{};lo.type="loader";let Er=lo;const io=class io extends Es{filter(e,n,r){if(r(this.textValue,this)){let o=this.clone();return n.addDescendants(o,e),o}return null}};io.type="item";let wr=io;const so=class so extends Es{filter(e,n,r){let o=super.filter(e,n,r);if(o&&o.lastChildKey!==null){let l=e.getItem(o.lastChildKey);if(l&&l.type!=="header")return o}return null}};so.type="section";let Sr=so;class cp{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),o=(r==null?void 0:r.firstChildKey)!=null?n.get(r.firstChildKey):null;for(;o;)yield o,o=o.nextKey!=null?n.get(o.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);return(n==null?void 0:n.key)??null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}getItem(e){return this.keyMap.get(e)??null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n.itemCount=this.itemCount,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,n){this.addNode(e);let r=n.getChildren(e.key);for(let o of r)this.addDescendants(o,n)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,r=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!r}filter(e){let n=new this.constructor,[r,o]=ws(this,n,this.firstKey,e);return n==null||n.commit(r,o),n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function ws(t,e,n,r){if(n==null)return[null,null];let o=null,l=null,i=t.getItem(n);for(;i!=null;){let s=i.filter(t,e,r);s!=null&&(s.nextKey=null,l&&(s.prevKey=l.key,l.nextKey=s.key),o==null&&(o=s),e.addNode(s),l=s),i=i.nextKey!=null?t.getItem(i.nextKey):null}if(l&&l.type==="separator"){let s=l.prevKey;e.removeNode(l.key),s!=null?(l=e.getItem(s),l.nextKey=null):l=null}return[(o==null?void 0:o.key)??null,(l==null?void 0:l.key)??null]}class Ss{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)==null?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}}function Ps(t){let{children:e,items:n,idScope:r,addIdAndValue:o,dependencies:l=[]}=t,i=a.useMemo(()=>{},[e]),s=a.useMemo(()=>new WeakMap,[...l,i]);return a.useMemo(()=>{if(n&&typeof e=="function"){let u=[];for(let c of n){let d=fp(c)?c:null,f=d?s.get(d):null;if(!f){f=e(c);let b=f.props.id??(c==null?void 0:c.key)??(c==null?void 0:c.id);r!=null&&f.props.id==null&&b!=null&&(b=r+":"+b);let p=b??u.length;f=a.cloneElement(f,o?{key:p,id:b,value:c}:{key:p}),d&&s.set(d,f)}u.push(f)}return u}else if(typeof e!="function")return e},[e,n,s,r,o])}function fp(t){switch(typeof t){case"object":return t!=null;case"function":case"symbol":return!0;default:return!1}}var Xn={exports:{}},Zn={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var al;function pp(){if(al)return Zn;al=1;var t=ku();function e(f,b){return f===b&&(f!==0||1/f===1/b)||f!==f&&b!==b}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,i=t.useDebugValue;function s(f,b){var p=b(),m=r({inst:{value:p,getSnapshot:b}}),v=m[0].inst,g=m[1];return l(function(){v.value=p,v.getSnapshot=b,u(v)&&g({inst:v})},[f,p,b]),o(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),i(p),p}function u(f){var b=f.getSnapshot;f=f.value;try{var p=b();return!n(f,p)}catch{return!0}}function c(f,b){return b()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Zn.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Zn}var ul;function bp(){return ul||(ul=1,Xn.exports=pp()),Xn.exports}var hp=bp();const Ts=a.createContext(!1),jt=a.createContext(null);function ks(t){if(a.useContext(jt))return t.content;let{collection:n,document:r}=yp(t.createCollection);return y.createElement(y.Fragment,null,y.createElement(Od,null,y.createElement(jt.Provider,{value:r},t.content)),y.createElement(mp,{render:t.children,collection:n}))}function mp({collection:t,render:e}){return e(t)}function gp(t,e,n){let r=et(),o=a.useRef(r);o.current=r;let l=a.useCallback(()=>o.current?n():e(),[e,n]);return hp.useSyncExternalStore(t,l)}const $p=typeof y.useSyncExternalStore=="function"?y.useSyncExternalStore:gp;function yp(t){let[e]=a.useState(()=>new dp((t==null?void 0:t())||new cp)),n=a.useCallback(i=>e.subscribe(i),[e]),r=a.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),o=a.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:$p(n,r,o),document:e}}const Pr=a.createContext(null);function vp(t){var n;return n=class extends yt{},n.type=t,n}function Ds(t,e,n,r,o,l){typeof t=="string"&&(t=vp(t));let i=a.useCallback(u=>{u==null||u.setProps(e,n,t,r,l)},[e,n,r,l,t]),s=a.useContext(Pr);if(s){let u=s.ownerDocument.nodesByProps.get(e);return u||(u=s.ownerDocument.createElement(t.type),u.setProps(e,n,t,r,l),s.appendChild(u),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,u)),o?y.createElement(Pr.Provider,{value:u},o):null}return y.createElement(t.type,{ref:i},o)}function Ms(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=a.forwardRef((o,l)=>{let i=a.useContext(br);if(!a.useContext(Ts)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,l)}return Ds(t,o,l,"children"in o?o.children:null,null,u=>y.createElement(br.Provider,{value:i},y.createElement(n,{node:u})))});return r.displayName=e.name,r}function xp(t,e,n=As){let r=({node:l})=>e(l.props,l.props.ref,l),o=a.forwardRef((l,i)=>{let s=n(l);return Ds(t,l,i,null,s,u=>y.createElement(r,{node:u}))??y.createElement(y.Fragment,null)});return o.displayName=e.name,o}function As(t){return Ps({...t,addIdAndValue:!0})}const cl=a.createContext(null);function Cp(t){let e=a.useContext(cl),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope??(e==null?void 0:e.idScope),o=As({...t,idScope:r,dependencies:n});return a.useContext(jt)&&(o=y.createElement(Ep,null,o)),e=a.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),y.createElement(cl.Provider,{value:e},o)}function Ep({children:t}){let e=a.useContext(jt),n=a.useMemo(()=>y.createElement(jt.Provider,{value:null},y.createElement(Ts.Provider,{value:!0},t)),[t]);return et()?y.createElement(Pr.Provider,{value:e},n):Lr.createPortal(n,e)}const wp=a.createContext(null),Sp={CollectionRoot({collection:t,renderDropIndicator:e}){return dl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return dl(t,e,n)}};function dl(t,e,n){return Ps({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){if(r.type==="content")return y.createElement(y.Fragment,null);let o=r.render(r);return!n||r.type!=="item"?o:y.createElement(y.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),o,Pp(t,r,n))}})}function Pp(t,e,n){let r=e.key,o=t.getKeyAfter(r),l=o!=null?t.getItem(o):null;for(;l!=null&&l.type!=="item";)o=t.getKeyAfter(l.key),l=o!=null?t.getItem(o):null;let i=e.nextKey!=null?t.getItem(e.nextKey):null;for(;i!=null&&i.type!=="item";)i=i.nextKey!=null?t.getItem(i.nextKey):null;let s=[];if(i==null){let u=e;for(;(u==null?void 0:u.type)==="item"&&(!l||u.parentKey!==l.parentKey&&l.level{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),ee(b.target).activeElement!==b.target&&Ke(b.target),o&&o({...b,type:"longpress"}),s.current=void 0},l),b.pointerType==="touch")){let p=v=>{v.preventDefault()},m=xe(b.target);u(b.target,"contextmenu",p,{once:!0}),u(m,"pointerup",()=>{setTimeout(()=>{c(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){s.current&&clearTimeout(s.current),r&&(b.pointerType==="mouse"||b.pointerType==="touch")&&r({...b,type:"longpressend"})}}),f=hc(o&&!e?i:void 0);return{longPressProps:J(d,f)}}function ha(t,e,n){let{type:r}=t,{isOpen:o}=e;a.useEffect(()=>{n&&n.current&&Ri.set(n.current,e.close)});let l;r==="menu"?l=!0:r==="listbox"&&(l="listbox");let i=ve();return{triggerProps:{"aria-haspopup":l,"aria-expanded":o,"aria-controls":o?i:void 0,onPress:e.toggle},overlayProps:{id:i}}}function Np(t){return t&&t.__esModule?t.default:t}function Op(t,e,n){let{type:r="menu",isDisabled:o,trigger:l="press"}=t,i=ve(),{triggerProps:s,overlayProps:u}=ha({type:r},e,n),c=p=>{if(!o&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},d=Yr(Np(pa),"@react-aria/menu"),{longPressProps:f}=ba({isDisabled:o||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!o&&(Ke(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!o&&(Ke(p.target),e.toggle())}};return delete s.onPress,{menuTriggerProps:{...s,...l==="press"?b:f,id:i,onKeyDown:c},menuProps:{...u,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}function Tr(t){return ln()?t.altKey:t.ctrlKey}function cn(t,e){var o,l;let n=`[data-key="${CSS.escape(String(e))}"]`,r=(o=t.current)==null?void 0:o.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),(l=t.current)==null?void 0:l.querySelector(n)}const ma=new WeakMap;function Vp(t){let e=ve();return ma.set(t,e),e}function _p(t){return ma.get(t)}const jp=1e3;function zp(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,o=a.useRef({search:"",timeout:void 0}).current,l=i=>{let s=Hp(i.key);if(!(!s||i.ctrlKey||i.metaKey||!te(i.currentTarget,j(i))||o.search.length===0&&s===" ")){if(s===" "&&o.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),o.search+=s,e.getKeyForSearch!=null){let u=e.getKeyForSearch(o.search,n.focusedKey);u==null&&(u=e.getKeyForSearch(o.search)),u!=null&&(n.setFocusedKey(u),r&&r(u))}clearTimeout(o.timeout),o.timeout=setTimeout(()=>{o.search=""},jp)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}function Hp(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function ga(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:l=!1,disallowEmptySelection:i=!1,disallowSelectAll:s=!1,escapeKeyBehavior:u="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:b=!1,scrollRef:p=r,linkBehavior:m="action"}=t,{direction:v}=$t(),g=zt(),x=h=>{var M,E,w,T,S,N,q,W,X,Q,le,Z,be,we;if(h.altKey&&h.key==="Tab"&&h.preventDefault(),!r.current||!te(r.current,j(h)))return;const C=(L,H)=>{if(L!=null){if(e.isLink(L)&&m==="selection"&&c&&!Tr(h)){Lr.flushSync(()=>{e.setFocusedKey(L,H)});let oe=cn(r,L),Se=e.getItemProps(L);oe&&g.open(oe,h,Se.href,Se.routerOptions);return}if(e.setFocusedKey(L,H),e.isLink(L)&&m==="override")return;h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&!Tr(h)&&e.replaceSelection(L)}};switch(h.key){case"ArrowDown":if(n.getKeyBelow){let L=e.focusedKey!=null?(M=n.getKeyBelow)==null?void 0:M.call(n,e.focusedKey):(E=n.getFirstKey)==null?void 0:E.call(n);L==null&&l&&(L=(w=n.getFirstKey)==null?void 0:w.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L))}break;case"ArrowUp":if(n.getKeyAbove){let L=e.focusedKey!=null?(T=n.getKeyAbove)==null?void 0:T.call(n,e.focusedKey):(S=n.getLastKey)==null?void 0:S.call(n);L==null&&l&&(L=(N=n.getLastKey)==null?void 0:N.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){let L=e.focusedKey!=null?(q=n.getKeyLeftOf)==null?void 0:q.call(n,e.focusedKey):(W=n.getFirstKey)==null?void 0:W.call(n);L==null&&l&&(L=v==="rtl"?(X=n.getFirstKey)==null?void 0:X.call(n,e.focusedKey):(Q=n.getLastKey)==null?void 0:Q.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L,v==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let L=e.focusedKey!=null?(le=n.getKeyRightOf)==null?void 0:le.call(n,e.focusedKey):(Z=n.getFirstKey)==null?void 0:Z.call(n);L==null&&l&&(L=v==="rtl"?(be=n.getLastKey)==null?void 0:be.call(n,e.focusedKey):(we=n.getFirstKey)==null?void 0:we.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L,v==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&h.shiftKey)return;h.preventDefault();let L=n.getFirstKey(e.focusedKey,ut(h));e.setFocusedKey(L),L!=null&&(ut(h)&&h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&h.shiftKey)return;h.preventDefault();let L=n.getLastKey(e.focusedKey,ut(h));e.setFocusedKey(L),L!=null&&(ut(h)&&h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let L=n.getKeyPageBelow(e.focusedKey);L!=null&&(h.preventDefault(),C(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(h.preventDefault(),C(L))}break;case"a":ut(h)&&e.selectionMode==="multiple"&&s!==!0&&(h.preventDefault(),e.selectAll());break;case"Escape":u==="clearSelection"&&!i&&e.selectedKeys.size!==0&&(h.stopPropagation(),h.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if(h.shiftKey)r.current.focus();else{let L=Ve(r.current,{tabbable:!0}),H,oe;do oe=L.lastChild(),oe&&(H=oe);while(oe);let Se=re();H&&(!It(H)||Se&&!Ql(Se))&&Ke(H)}break}}},$=a.useRef({top:0,left:0});Tt(p,"scroll",()=>{var h,C;$.current={top:((h=p.current)==null?void 0:h.scrollTop)??0,left:((C=p.current)==null?void 0:C.scrollLeft)??0}});let D=h=>{var C,M;if(e.isFocused){te(h.currentTarget,j(h))||e.setFocused(!1);return}if(te(h.currentTarget,j(h))){if(e.setFocused(!0),e.focusedKey==null){let E=T=>{T!=null&&(e.setFocusedKey(T),c&&!e.isSelected(T)&&e.replaceSelection(T))},w=h.relatedTarget;w&&h.currentTarget.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?E(e.lastSelectedKey??((C=n.getLastKey)==null?void 0:C.call(n))):E(e.firstSelectedKey??((M=n.getFirstKey)==null?void 0:M.call(n)))}else p.current&&(p.current.scrollTop=$.current.top,p.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&p.current){let E=cn(r,e.focusedKey);E instanceof HTMLElement&&(!It(E)&&!f&&Ke(E),Ot()==="keyboard"&&Eo(E,{containingElement:r.current}))}}},P=h=>{te(h.currentTarget,h.relatedTarget)||e.setFocused(!1)},F=a.useRef(!1);Tt(r,Mu,f?h=>{let{detail:C}=h;h.stopPropagation(),e.setFocused(!0),(C==null?void 0:C.focusStrategy)==="first"&&(F.current=!0)}:void 0),Co(()=>{var h;if(F.current){let C=((h=n.getFirstKey)==null?void 0:h.call(n))??null;if(C==null){let M=re();Ls(r.current),Jr(M,null),e.collection.size>0&&(F.current=!1)}else e.setFocusedKey(C),F.current=!1}},[e.collection]),Co(()=>{e.collection.size>0&&(F.current=!1)},[e.focusedKey]),Tt(r,Du,f?h=>{var C;h.stopPropagation(),e.setFocused(!1),(C=h.detail)!=null&&C.clearFocusKey&&e.setFocusedKey(null)}:void 0);const R=a.useRef(o),I=a.useRef(!1);a.useEffect(()=>{var h,C;if(R.current){let M=null;o==="first"&&(M=((h=n.getFirstKey)==null?void 0:h.call(n))??null),o==="last"&&(M=((C=n.getLastKey)==null?void 0:C.call(n))??null);let E=e.selectedKeys;if(E.size){for(let w of E)if(e.canSelectItem(w)){M=w;break}}e.setFocused(!0),e.setFocusedKey(M),M==null&&!f&&r.current&&Ge(r.current),e.collection.size>0&&(R.current=!1,I.current=!0)}});let k=a.useRef(e.focusedKey),B=a.useRef(null);a.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==k.current||I.current)&&p.current&&r.current){let h=Ot(),C=cn(r,e.focusedKey);if(!(C instanceof HTMLElement))return;(h==="keyboard"||I.current)&&(B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame(()=>{p.current&&(sn(p.current,C),h!=="virtual"&&Eo(C,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&k.current!=null&&r.current&&Ge(r.current),k.current=e.focusedKey,I.current=!1}),a.useEffect(()=>()=>{B.current&&cancelAnimationFrame(B.current)},[]),Tt(r,"react-aria-focus-scope-restore",h=>{h.preventDefault(),e.setFocused(!0)});let K={onKeyDown:x,onFocus:D,onBlur:P,onMouseDown(h){p.current===j(h)&&h.preventDefault()}},{typeSelectProps:_}=zp({keyboardDelegate:n,selectionManager:e});d||(K=J(_,K));let U;f||(U=e.focusedKey==null?0:-1);let z=Vp(e.collection);return{collectionProps:J(K,{tabIndex:U,"data-collection":z})}}class pl{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?cn(this.ref,e):null;if(!r)return null;let o=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-o.left-n.clientLeft+n.scrollLeft,y:l.top-o.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class Qr{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new pl(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new pl(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,r;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((r=e.props)==null?void 0:r.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,r=!1){let o=e;for(;o!=null;){let l=this.collection.getItem(o);if((l==null?void 0:l.type)==="item"&&(r||!this.isDisabled(l)))return o;o=n(o)}return null}getNextKey(e,n){let r=e;return r=this.collection.getKeyAfter(r),this.findNextNonDisabled(r,o=>this.collection.getKeyAfter(o),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let r=e;return r=this.collection.getKeyBefore(r),this.findNextNonDisabled(r,o=>this.collection.getKeyBefore(o),n==null?void 0:n.includeDisabled)}findKey(e,n,r){let o=e,l=this.layoutDelegate.getItemRect(o);if(!l||o==null)return null;let i=l;do{if(o=n(o),o==null)break;l=this.layoutDelegate.getItemRect(o)}while(l&&r(i,l)&&o!=null);return o}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getNextKey(r,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getPreviousKey(r,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,r){return n?this.getPreviousKey(e,r):this.getNextKey(e,r)}getKeyRightOf(e,n){let r=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let r=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Je(n))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Je(n))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.x-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xo[0]l||new Qr({collection:n,disabledKeys:r,disabledBehavior:c,ref:o,collator:u,layoutDelegate:i,orientation:s}),[l,i,n,r,o,u,c,s]),{collectionProps:f}=ga({...t,ref:o,selectionManager:e,keyboardDelegate:d});return{listProps:f}}function Gp(t){let{id:e,selectionManager:n,key:r,ref:o,shouldSelectOnPressUp:l,shouldUseVirtualFocus:i,focus:s,isDisabled:u,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,b=zt();e=ve(e);let p=S=>{if(S.pointerType==="keyboard"&&Tr(S))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&o.current){let N=n.getItemProps(r);b.open(o.current,S,N.href,N.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):S&&S.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||S&&(ut(S)||S.pointerType==="touch"||S.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};a.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(i?Ls(o.current):s?s():re()!==o.current&&o.current&&Ge(o.current))},[o,r,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),u=u||n.isDisabled(r);let m={};!i&&!u?m={tabIndex:r===n.focusedKey?0:-1,onFocus(S){j(S)===o.current&&n.setFocusedKey(r)}}:u&&(m.onMouseDown=S=>{S.preventDefault()}),a.useEffect(()=>{u&&n.focusedKey===r&&n.setFocusedKey(null)},[n,u,r]);let v=n.isLink(r)&&f==="override",g=c&&t.UNSTABLE_itemBehavior==="action",x=n.isLink(r)&&f!=="selection"&&f!=="none",$=!u&&n.canSelectItem(r)&&!v&&!g,D=(c||x)&&!u,P=D&&(n.selectionBehavior==="replace"?!$:!$||n.isEmpty),F=D&&$&&n.selectionBehavior==="replace",R=P||F,I=a.useRef(null),k=R&&$,B=a.useRef(!1),K=a.useRef(!1),_=n.getItemProps(r),U=S=>{var N;c&&(c(),(N=o.current)==null||N.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),x&&o.current&&b.open(o.current,S,_.href,_.routerOptions)},z={ref:o};if(l?(z.onPressStart=S=>{I.current=S.pointerType,B.current=k,S.pointerType==="keyboard"&&(!R||hl(S.key))&&p(S)},d?(z.onPressUp=P?void 0:S=>{S.pointerType==="mouse"&&$&&p(S)},z.onPress=P?U:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&$&&p(S)}):z.onPress=S=>{if(P||F&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!bl(S.key))return;U(S)}else S.pointerType!=="keyboard"&&$&&p(S)}):(z.onPressStart=S=>{I.current=S.pointerType,B.current=k,K.current=P,$&&(S.pointerType==="mouse"&&!P||S.pointerType==="keyboard"&&(!D||hl(S.key)))&&p(S)},z.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&R&&bl(S.key)||S.pointerType==="mouse"&&K.current)&&(R?U(S):$&&p(S))}),m["data-collection"]=_p(n.collection),m["data-key"]=r,z.preventFocusOnPress=i,i&&(z=J(z,{onPressStart(S){S.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(S){S.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),_)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])_[S]&&(z[S]=tt(z[S],_[S]));let{pressProps:h,isPressed:C}=Wt(z),M=F?S=>{I.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),U(S))}:void 0,{longPressProps:E}=ba({isDisabled:!k,onLongPress(S){S.pointerType==="touch"&&(p(S),n.setSelectionBehavior("toggle"))}}),w=S=>{I.current==="touch"&&B.current&&S.preventDefault()},T=f!=="none"&&n.isLink(r)?S=>{_e.isOpening||S.preventDefault()}:void 0;return{itemProps:J(m,$||P||i&&!u?h:{},k?E:{},{onDoubleClick:M,onDragStartCapture:w,onClick:T,id:e},i?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:C,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:u,allowsSelection:$,hasAction:R}}function bl(t){return t==="Enter"}function hl(t){return t===" "}function $a(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}const ml=new WeakMap;function ya(t){let e=ml.get(t);if(e!=null)return e;let n=0,r=o=>{for(let l of o)l.type==="section"?r($a(l,t)):l.type==="item"&&n++};return r(t),ml.set(t,n),n}function Up(t){let e=Ln(t),[n,r]=a.useState(null),[o,l]=a.useState([]),i=()=>{l([]),e.close()};return{focusStrategy:n,...e,open(c=null){r(c),e.open()},toggle(c=null){r(c),e.toggle()},close(){i()},expandedKeysStack:o,openSubmenu:(c,d)=>{l(f=>d>f.length?f:[...f.slice(0,d),c])},closeSubmenu:(c,d)=>{l(f=>f[d]===c?f.slice(0,d):f)}}}function va(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function qp(t){return Yp(t)}function Yp(t,e){for(let n of t)return n}function Qn(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...gl(t,e),e],o=[...gl(t,n),n],l=r.slice(0,o.length).findIndex((i,s)=>i!==o[s]);return l!==-1?(e=r[l],n=o[l],e.index-n.index):r.findIndex(i=>i===n)>=0?1:(o.findIndex(i=>i===e)>=0,-1)}function gl(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}class Le extends Set{constructor(e,n,r){super(e),e instanceof Le?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}class to{constructor(e,n,r){this.collection=e,this.state=n,this.allowsCellSelection=(r==null?void 0:r.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null,this.fullCollection=(r==null?void 0:r.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Qn(this.collection,r,e)<0)&&(e=r)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Qn(this.collection,r,e)>0)&&(e=r)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Le([n],n,n);else{let o=this.state.selectedKeys,l=o.anchorKey??n;r=new Le(o,l,n);for(let i of this.getKeyRange(l,o.currentKey??n))r.delete(i);for(let i of this.getKeyRange(n,l))this.canSelectItem(i)&&r.add(i)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),o=this.collection.getItem(n);return r&&o?Qn(this.collection,r,o)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var l;if((l=this.layoutDelegate)!=null&&l.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let r=[],o=e;for(;o!=null;){let i=this.collection.getItem(o);if(i&&(i.type==="item"||i.type==="cell"&&this.allowsCellSelection)&&r.push(o),o===n)return r;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Le(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Le([n],n,n):new Le;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Le;for(let r of e){let o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],r=o=>{var l;for(;o!=null;){if(this.canSelectItemIn(o,e)){let i=e.getItem(o);(i==null?void 0:i.type)==="item"&&n.push(o),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&r(((l=qp(va(i,e)))==null?void 0:l.key)??null)}o=e.getKeyAfter(o)}};return r(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Le)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var o;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=n.getItem(e);return!(!r||(o=r==null?void 0:r.props)!=null&&o.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var r,o;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((r=n==null?void 0:n.props)!=null&&r.isDisabled))&&((o=n==null?void 0:n.props)==null?void 0:o.disabledBehavior)!=="selection"}isLink(e){var n,r;return!!((r=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&r.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new to(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Xp{build(e,n){return this.context=n,$l(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(y.isValidElement(n)&&n.type===y.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let o=0;for(let l of r)yield*this.getFullNode({value:l,index:o},{renderer:n}),o++}else{let o=[];y.Children.forEach(n,i=>{i&&o.push(i)});let l=0;for(let i of o){let s=this.getFullNode({element:i,index:l},{});for(let u of s)l++,yield u}}}getKey(e,n,r,o){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${o}${n.key}`;let l=n.value;if(l!=null){let i=l.key??l.id;if(i==null)throw new Error("No key found for item");return i}return o?`${o}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,o){if(y.isValidElement(e.element)&&e.element.type===y.Fragment){let u=[];y.Children.forEach(e.element.props.children,d=>{u.push(d)});let c=e.index??0;for(const d of u)yield*this.getFullNode({element:d,index:c++},n,r,o);return}let l=e.element;if(!l&&e.value&&n&&n.renderer){let u=this.cache.get(e.value);if(u&&(!u.shouldInvalidate||!u.shouldInvalidate(this.context))){u.index=e.index,u.parentKey=o?o.key:null,yield u;return}l=n.renderer(e.value)}if(y.isValidElement(l)){let u=l.type;if(typeof u!="function"&&typeof u.getCollectionNode!="function"){let b=l.type;throw new Error(`Unknown element <${b}> in collection.`)}let c=u.getCollectionNode(l.props,this.context),d=e.index??0,f=c.next();for(;!f.done&&f.value;){let b=f.value;e.index=d;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(l,e,n,r));let v=[...this.getFullNode({...b,key:p,index:d,wrapper:Zp(e.wrapper,b.wrapper)},this.getChildState(n,b),r?`${r}${l.key}`:l.key,o)];for(let g of v){if(g.value=b.value??e.value??null,g.value&&this.cache.set(g.value,g),e.type&&g.type!==e.type)throw new Error(`Unsupported type <${er(g.type)}> in <${er((o==null?void 0:o.type)??"unknown parent type")}>. Only <${er(e.type)}> is supported.`);d++,yield g}f=c.next(v)}return}if(e.key==null||e.type==null)return;let i=this,s={type:e.type,props:e.props,key:e.key,parentKey:o?o.key:null,value:e.value??null,level:((o==null?void 0:o.level)??0)+((o==null?void 0:o.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:$l(function*(){if(!e.hasChildNodes||!e.childNodes)return;let u=0;for(let c of e.childNodes()){c.key!=null&&(c.key=`${s.key}${c.key}`);let d=i.getFullNode({...c,index:u},i.getChildState(n,c),s.key,s);for(let f of d)u++,yield f}})};yield s}constructor(){this.cache=new WeakMap}}function $l(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function Zp(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function er(t){return t[0].toUpperCase()+t.slice(1)}function Jp(t,e,n){let r=a.useMemo(()=>new Xp,[]),{children:o,items:l,collection:i}=t;return a.useMemo(()=>{if(i)return i;let u=r.build({children:o,items:l},n);return e(u)},[r,o,l,i,n,e])}function Qp(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function eb(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:l="all"}=t,i=a.useRef(!1),[,s]=a.useState(!1),u=a.useRef(null),c=a.useRef(null),[,d]=a.useState(null),f=a.useMemo(()=>yl(t.selectedKeys),[t.selectedKeys]),b=a.useMemo(()=>yl(t.defaultSelectedKeys,new Le),[t.defaultSelectedKeys]),[p,m]=$n(f,b,t.onSelectionChange),v=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[g,x]=a.useState(o);o==="replace"&&g==="toggle"&&typeof p=="object"&&p.size===0&&x("replace");let $=a.useRef(o);return a.useEffect(()=>{o!==$.current&&(x(o),$.current=o)},[o]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:g,setSelectionBehavior:x,get isFocused(){return i.current},setFocused(D){i.current=D,s(D)},get focusedKey(){return u.current},get childFocusStrategy(){return c.current},setFocusedKey(D,P="first"){u.current=D,c.current=P,d(D)},selectedKeys:p,setSelectedKeys(D){(r||!Qp(D,p))&&m(D)},disabledKeys:v,disabledBehavior:l}}function yl(t,e){return t?t==="all"?"all":new Le(t):e}const tb=a.createContext(null),uo=class uo extends yt{filter(e,n,r){let o=e.getItem(this.firstChildKey);if(o&&r(o.textValue,this)){let l=this.clone();return n.addDescendants(l,e),l}return null}};uo.type="submenutrigger";let vl=uo;function nb(t,e){let{role:n="dialog"}=t,r=Ft();r=t["aria-label"]?void 0:r;let o=a.useRef(!1);return a.useEffect(()=>{if(e.current&&!It(e.current)){Ge(e.current);let l=setTimeout(()=>{(re()===e.current||re()===document.body)&&(o.current=!0,e.current&&(e.current.blur(),Ge(e.current)),o.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),Cs(),a.useRef(!1),a.useEffect(()=>{}),{dialogProps:{...pe(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{o.current&&l.stopPropagation()}},titleProps:{id:r}}}const xa=a.createContext(null),lt=a.createContext(null);function rb(t){let e=Up(t),n=a.useRef(null),{triggerProps:r,overlayProps:o}=ha({type:"dialog"},e,n);return r.id=ve(),o["aria-labelledby"]=r.id,y.createElement(rt,{values:[[lt,e],[tb,e],[xa,o],[Xr,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":o["aria-labelledby"]}]]},y.createElement(op,{...r,ref:n,isPressed:e.isOpen},t.children))}const ob=a.forwardRef(function(e,n){let r=e["aria-labelledby"];[e,n]=Ce(e,n,xa);let{dialogProps:o,titleProps:l}=nb({...e,"aria-labelledby":r},n),i=a.useContext(lt);!o["aria-label"]&&!o["aria-labelledby"]&&e["aria-labelledby"]&&(o["aria-labelledby"]=e["aria-labelledby"]);let s=Ee({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(i==null?void 0:i.close)||(()=>{})}}),u=pe(e,{global:!0});return y.createElement(fe.section,{...J(u,s,o),render:e.render,ref:n,slot:e.slot||void 0},y.createElement(rt,{values:[[Mi,{slots:{[bn]:{},title:{...l,level:2}}}],[Dn,{slots:{[bn]:{},close:{onPress:()=>i==null?void 0:i.close()}}}]]},s.children))});function lb(t,e,n){let{overlayProps:r,underlayProps:o}=Ni({...t,isOpen:e.isOpen,onClose:e.close},n);return Oi({isDisabled:!e.isOpen}),Cs(),a.useEffect(()=>{if(e.isOpen&&n.current)return Ur([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:J(r),underlayProps:o}}const ib=a.createContext(null),no=a.createContext(null),sb=a.forwardRef(function(e,n){if(a.useContext(no))return y.createElement(xl,{...e,modalRef:n},e.children);let{isDismissable:o,isKeyboardDismissDisabled:l,isOpen:i,defaultOpen:s,onOpenChange:u,children:c,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...m}=e;return y.createElement(Ca,{isDismissable:o,isKeyboardDismissDisabled:l,isOpen:i,defaultOpen:s,onOpenChange:u,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},y.createElement(xl,{...m,modalRef:n},c))});function ab(t,e){[t,e]=Ce(t,e,ib);let n=a.useContext(lt),r=Ln(t),o=t.isOpen!=null||t.defaultOpen!=null||!n?r:n,l=nt(e),i=a.useRef(null),s=or(l,o.isOpen),u=or(i,o.isOpen),c=s||u||t.isExiting||!1,d=et();return!o.isOpen&&!c||d?null:y.createElement(ub,{...t,state:o,isExiting:c,overlayRef:l,modalRef:i})}const Ca=a.forwardRef(ab);function ub({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:r}=e,{modalProps:o,underlayProps:l}=lb(e,r,n),i=Br(e.overlayRef)||e.isEntering||!1,s=Ee({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:i,isExiting:e.isExiting,state:r}}),u=pc(),c,d;if(typeof document<"u"){let b=Je(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,m=b.getBoundingClientRect().height%1;c=b.scrollWidth-p,d=b.scrollHeight-m}let f={...s.style,"--visual-viewport-width":u.width+"px","--visual-viewport-height":u.height+"px","--page-width":c!==void 0?c+"px":void 0,"--page-height":d!==void 0?d+"px":void 0};return y.createElement(Cr,{isExiting:e.isExiting,portalContainer:t},y.createElement(fe.div,{...J(pe(e,{global:!0}),l),...s,style:f,ref:e.overlayRef,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},y.createElement(rt,{values:[[no,{modalProps:o,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[lt,r]]},s.children)))}function xl(t){let{modalProps:e,modalRef:n,isExiting:r,isDismissable:o}=a.useContext(no),l=a.useContext(lt),i=a.useMemo(()=>ht(t.modalRef,n),[t.modalRef,n]),s=nt(i),u=Br(s),c=Ee({...t,defaultClassName:"react-aria-Modal",values:{isEntering:u,isExiting:r,state:l}});return y.createElement(fe.div,{...J(pe(t,{global:!0}),e),...c,ref:s,"data-entering":u||void 0,"data-exiting":r||void 0},o&&y.createElement(xr,{onDismiss:l.close}),c.children)}const cb=y.forwardRef(({children:t,...e},n)=>{n=nt(n);let{pressProps:r}=Wt({...e,ref:n}),{focusableProps:o}=Pn(e,n),l=y.Children.only(t);a.useEffect(()=>{},[n,e.isDisabled]);let i=parseInt(y.version,10)<19?l.ref:l.props.ref;return y.cloneElement(l,{...J(r,o,l.props),ref:ht(i,n)})}),Cl=({children:t,className:e,slot:n,style:r,variant:o,...l})=>{const i=a.useMemo(()=>Pd({variant:o}),[o]);return A.jsx(Gr,{"aria-label":"Close",className:Te(e,i),"data-slot":"close-button",slot:n,style:r,...l,children:s=>typeof t=="function"?t(s):t??A.jsx($f,{"data-slot":"close-button-icon"})})},db=Object.assign(Cl,{Root:Cl}),Me=a.createContext({}),El=({children:t,...e})=>{const n=a.useMemo(()=>({slots:En(),placement:void 0}),[]);return A.jsx(Me,{value:n,children:A.jsx(rb,{"data-slot":"alert-dialog-root",...e,children:t})})},fb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx(cb,{children:A.jsx("div",{className:he(r==null?void 0:r.trigger,e),"data-slot":"alert-dialog-trigger",role:"button",...n,children:t})})},pb=({children:t,className:e,isDismissable:n=!1,isKeyboardDismissDisabled:r=!0,onClick:o,variant:l,...i})=>{const{slots:s}=a.useContext(Me),u=a.useMemo(()=>En({variant:l}),[l]),c=a.useMemo(()=>({slots:{...s,...u}}),[s,u]);return A.jsx(Ca,{className:Te(e,u==null?void 0:u.backdrop()),"data-slot":"alert-dialog-backdrop",isDismissable:n,isKeyboardDismissDisabled:r,onClick:d=>{d.stopPropagation(),o==null||o(d)},...i,children:d=>A.jsxs(Me,{value:c,children:[typeof t=="function"?t(d):t," "]})})},bb=({children:t,className:e,placement:n="auto",size:r,...o})=>{const{slots:l}=a.useContext(Me),i=a.useMemo(()=>En({size:r}),[r]),s=a.useMemo(()=>({placement:n,slots:{...l,...i}}),[n,l,i]);return A.jsx(sb,{className:Te(e,i==null?void 0:i.container()),"data-placement":n,"data-slot":"alert-dialog-container",...o,children:u=>A.jsx(Me,{value:s,children:typeof t=="function"?t(u):t})})},hb=({children:t,className:e,...n})=>{const{placement:r,slots:o}=a.useContext(Me);return A.jsx(ob,{className:he(o==null?void 0:o.dialog,e),"data-placement":r,"data-slot":"alert-dialog-dialog",role:"alertdialog",...n,children:t})},mb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.header,e),"data-slot":"alert-dialog-header",...n,children:t})},gb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx(hf,{className:he(r==null?void 0:r.heading,e),"data-slot":"alert-dialog-heading",slot:"title",...n,children:t})},$b=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.body,e),"data-slot":"alert-dialog-body",...n,children:t})},yb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.footer,e),"data-slot":"alert-dialog-footer",...n,children:t})},vb=({children:t,className:e,status:n="danger",...r})=>{const o=a.useMemo(()=>En({status:n}),[n]),l=()=>{switch(n){case"default":return A.jsx(_o,{"data-slot":"alert-dialog-default-icon"});case"accent":return A.jsx(_o,{"data-slot":"alert-dialog-default-icon"});case"success":return A.jsx(vf,{"data-slot":"alert-dialog-default-icon"});case"warning":return A.jsx(yf,{"data-slot":"alert-dialog-default-icon"});case"danger":return A.jsx(jo,{"data-slot":"alert-dialog-default-icon"});default:return A.jsx(jo,{"data-slot":"alert-dialog-default-icon"})}};return A.jsx(Ae.div,{className:o==null?void 0:o.icon({className:e}),"data-slot":"alert-dialog-icon",...r,children:t??l()})},xb=({className:t,...e})=>{const{slots:n}=a.useContext(Me);return A.jsx(db,{className:Te(t,n==null?void 0:n.closeTrigger()),"data-slot":"alert-dialog-close-trigger",slot:"close",...e})},Fh=Object.assign(El,{Root:El,Trigger:fb,Backdrop:pb,Container:bb,Dialog:hb,Header:mb,Heading:gb,Body:$b,Footer:yb,Icon:vb,CloseTrigger:xb});function Cb(t){let e=eo({usage:"search",...t}),n=a.useCallback((l,i)=>i.length===0?!0:(l=l.normalize("NFC"),i=i.normalize("NFC"),e.compare(l.slice(0,i.length),i)===0),[e]),r=a.useCallback((l,i)=>i.length===0?!0:(l=l.normalize("NFC"),i=i.normalize("NFC"),e.compare(l.slice(-i.length),i)===0),[e]),o=a.useCallback((l,i)=>{if(i.length===0)return!0;l=l.normalize("NFC"),i=i.normalize("NFC");let s=0,u=i.length;for(;s+u<=l.length;s++){let c=l.slice(s,s+u);if(e.compare(i,c)===0)return!0}return!1},[e]);return a.useMemo(()=>({startsWith:n,endsWith:r,contains:o}),[n,r,o])}const ro=a.createContext({}),Ea=a.createContext(null),wa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Sa={...wa,customError:!0,valid:!1},wt={isInvalid:!1,validationDetails:wa,validationErrors:[]},Eb=a.createContext({}),wl="__reactAriaFormValidationState";function wb(t){if(t[wl]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}=t[wl];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}}return Sb(t)}function Sb(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:l,validate:i,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let u=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Sa}:null,c=a.useMemo(()=>{if(!i||o==null)return null;let K=Pb(i,o);return Sl(K)},[i,o]);l!=null&&l.validationDetails.valid&&(l=void 0);let d=a.useContext(Eb),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(K=>kr(d[K])):kr(d[r]):[],[d,r]),[b,p]=a.useState(d),[m,v]=a.useState(!1);d!==b&&(p(d),v(!1));let g=a.useMemo(()=>Sl(m?[]:f),[m,f]),x=a.useRef(wt),[$,D]=a.useState(wt),P=a.useRef(wt),F=()=>{if(!R)return;I(!1);let K=c||l||x.current;tr(K,P.current)||(P.current=K,D(K))},[R,I]=a.useState(!1);return a.useEffect(F),{realtimeValidation:u||g||c||l||wt,displayValidation:s==="native"?u||g||$:u||g||c||l||$,updateValidation(K){s==="aria"&&!tr($,K)?D(K):x.current=K},resetValidation(){let K=wt;tr(K,P.current)||(P.current=K,D(K)),s==="native"&&I(!1),v(!0)},commitValidation(){s==="native"&&I(!0),v(!0)}}}function kr(t){return t?Array.isArray(t)?t:[t]:[]}function Pb(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return kr(n)}return[]}function Sl(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Sa}:null}function tr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}const Pa=a.createContext(null),Kn=a.createContext({}),Ta=a.createContext(null),Tb=a.forwardRef(function(e,n){let{render:r}=a.useContext(Ta);return y.createElement(y.Fragment,null,r(e,n))});function ka(t,e){var l;let n=t==null?void 0:t.renderDropIndicator,r=(l=t==null?void 0:t.isVirtualDragging)==null?void 0:l.call(t),o=a.useCallback(i=>{if(r||e!=null&&e.isDropTarget(i))return n?n(i):y.createElement(Tb,{target:i})},[e==null?void 0:e.target,r,n]);return t!=null&&t.useDropIndicator?o:void 0}function kb(t,e,n){var l,i,s;let r=t.focusedKey,o=null;if((l=e==null?void 0:e.isVirtualDragging)!=null&&l.call(e)&&((i=n==null?void 0:n.target)==null?void 0:i.type)==="item"&&(o=n.target.key,n.target.dropPosition==="after")){let u=n.collection.getKeyAfter(o),c=null;if(u!=null){let d=((s=n.collection.getItem(o))==null?void 0:s.level)??0;for(;u!=null;){let f=n.collection.getItem(u);if(!f)break;if(f.type!=="item"){u=n.collection.getKeyAfter(u);continue}if((f.level??0)<=d)break;c=u,u=n.collection.getKeyAfter(u)}}o=u??c??o}return a.useMemo(()=>new Set([r,o].filter(u=>u!=null)),[r,o])}const Rn=new WeakMap;function Db(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function Da(t,e){let n=Rn.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${Db(e)}`}function Mb(t,e,n){let r=pe(t,{labelable:!0}),o=t.selectionBehavior||"toggle",l=t.orientation||"vertical",i=t.linkBehavior||(o==="replace"?"action":"override");o==="toggle"&&i==="action"&&(i="override");let{listProps:s}=Wp({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:u}=Tn({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),c=ve(t.id);Rn.set(e,{id:c,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:i,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:d,fieldProps:f}=$i({...t,id:c,labelElementType:"span"});return{labelProps:d,listBoxProps:J(r,u,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":l,...J(f,s)})}}function Ab(t,e,n){var B,K;let{key:r}=t,o=Rn.get(e),l=t.isDisabled??e.selectionManager.isDisabled(r),i=t.isSelected??e.selectionManager.isSelected(r),s=t.shouldSelectOnPressUp??(o==null?void 0:o.shouldSelectOnPressUp),u=t.shouldFocusOnHover??(o==null?void 0:o.shouldFocusOnHover),c=t.shouldUseVirtualFocus??(o==null?void 0:o.shouldUseVirtualFocus),d=t.isVirtualized??(o==null?void 0:o.isVirtualized),f=Ft(),b=Ft(),p={role:"option","aria-disabled":l||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":t["aria-label"],"aria-labelledby":f,"aria-describedby":b},m=e.collection.getItem(r);if(d){let _=Number(m==null?void 0:m.index);p["aria-posinset"]=Number.isNaN(_)?void 0:_+1,p["aria-setsize"]=ya(e.collection)}let v=o!=null&&o.onAction?()=>{var _;return(_=o==null?void 0:o.onAction)==null?void 0:_.call(o,r)}:void 0,g=Da(e,r),{itemProps:x,isPressed:$,isFocused:D,hasAction:P,allowsSelection:F}=Gp({selectionManager:e.selectionManager,key:r,ref:n,shouldSelectOnPressUp:s,allowsDifferentPressOrigin:s&&u,isVirtualized:d,shouldUseVirtualFocus:c,isDisabled:l,onAction:v||(B=m==null?void 0:m.props)!=null&&B.onAction?tt((K=m==null?void 0:m.props)==null?void 0:K.onAction,v):void 0,linkBehavior:o==null?void 0:o.linkBehavior,UNSTABLE_itemBehavior:o==null?void 0:o.UNSTABLE_itemBehavior,id:g}),{hoverProps:R}=Gt({isDisabled:l||!u,onHoverStart(){Nt()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(r))}}),I=pe(m==null?void 0:m.props);delete I.id;let k=zl(m==null?void 0:m.props);return{optionProps:{...p,...J(I,x,R,k),id:g},labelProps:{id:f},descriptionProps:{id:b},isFocused:D,isFocusVisible:D&&e.selectionManager.isFocused&&Nt(),isSelected:i,isDisabled:l,isPressed:$,allowsSelection:F,hasAction:P}}function Lb(t){let{heading:e,"aria-label":n}=t,r=ve();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation",onMouseDown:o=>{o.preventDefault()}}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}class Dr{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let s of i.childNodes)n(s)};for(let i of e)n(i);let r=null,o=0,l=0;for(let[i,s]of this.keyMap)r?(r.nextKey=i,s.prevKey=r.key):(this.firstKey=i,s.prevKey=void 0),s.type==="item"&&(s.index=o++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l,this.lastKey=(r==null?void 0:r.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}function Ma(t){let{filter:e,layoutDelegate:n}=t,r=eb(t),o=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=a.useCallback(c=>e?new Dr(e(c)):new Dr(c),[e]),i=a.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),s=Jp(t,l,i),u=a.useMemo(()=>new to(s,r,{layoutDelegate:n}),[s,r,n]);return Aa(s,u),{collection:s,disabledKeys:o,selectionManager:u}}function Kb(t,e){let n=a.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),r=t.selectionManager.withCollection(n);return Aa(n,r),{collection:n,selectionManager:r,disabledKeys:t.disabledKeys}}function Aa(t,e){const n=a.useRef(null);a.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){let r=n.current.getKeyAfter(e.focusedKey),o=null;for(;r!=null;){let l=t.getItem(r);if(l&&l.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyAfter(r)}if(o==null)for(r=n.current.getKeyBefore(e.focusedKey);r!=null;){let l=t.getItem(r);if(l&&l.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyBefore(r)}e.setFocusedKey(o)}n.current=t},[t,e])}const Fn=a.createContext(null),vt=a.createContext(null),Rb=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Fn);let r=a.useContext(vt);return r?y.createElement(La,{state:r,props:e,listBoxRef:n}):y.createElement(ks,{content:y.createElement(Cp,e)},o=>y.createElement(Fb,{props:e,listBoxRef:n,collection:o}))});function Fb({props:t,listBoxRef:e,collection:n}){t={...t,collection:n,children:null,items:null};let{layoutDelegate:r}=a.useContext(Zr),o=Ma({...t,layoutDelegate:r});return y.createElement(La,{state:o,props:t,listBoxRef:e})}function La({state:t,props:e,listBoxRef:n}){[e,n]=Ce(e,n,Dp);let{dragAndDropHooks:r,layout:o="stack",orientation:l="vertical",filter:i}=e,s=Kb(t,i),{collection:u,selectionManager:c}=s,d=!!(r!=null&&r.useDraggableCollectionState),f=!!(r!=null&&r.useDroppableCollectionState),{direction:b}=$t(),{disabledBehavior:p,disabledKeys:m}=c,v=eo({usage:"search",sensitivity:"base"}),{isVirtualized:g,layoutDelegate:x,dropTargetDelegate:$,CollectionRoot:D}=a.useContext(Zr),P=a.useMemo(()=>e.keyboardDelegate||new Qr({collection:u,collator:v,ref:n,disabledKeys:m,disabledBehavior:p,layout:o,orientation:l,direction:b,layoutDelegate:x}),[u,v,n,p,m,l,b,e.keyboardDelegate,o,x]),{listBoxProps:F}=Mb({...e,shouldSelectOnPressUp:d||e.shouldSelectOnPressUp,keyboardDelegate:P,isVirtualized:g},s,n);a.useRef(d),a.useRef(f),a.useEffect(()=>{},[d,f]);let R,I,k,B=!1,K=null,_=a.useRef(null);if(d&&r){R=r.useDraggableCollectionState({collection:u,selectionManager:c,preview:r.renderDragPreview?_:void 0}),r.useDraggableCollection({},R,n);let S=r.DragPreview;K=r.renderDragPreview?y.createElement(S,{ref:_},r.renderDragPreview):null}if(f&&r){I=r.useDroppableCollectionState({collection:u,selectionManager:c});let S=r.dropTargetDelegate||$||new r.ListDropTargetDelegate(u,n,{orientation:l,layout:o,direction:b});k=r.useDroppableCollection({keyboardDelegate:P,dropTargetDelegate:S},I,n),B=I.isDropTarget({type:"root"})}let{focusProps:U,isFocused:z,isFocusVisible:h}=kn(),C=s.collection.size===0,M={isDropTarget:B,isEmpty:C,isFocused:z,isFocusVisible:h,layout:e.layout||"stack",orientation:l,state:s},E=Ee({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:M}),w=null;C&&e.renderEmptyState&&(w=y.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(M)));let T=pe(e,{global:!0});return y.createElement(Fi,null,y.createElement(fe.div,{...J(T,E,F,U,k==null?void 0:k.collectionProps),ref:n,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":B||void 0,"data-empty":C||void 0,"data-focused":z||void 0,"data-focus-visible":h||void 0,"data-layout":e.layout||"stack","data-orientation":l},y.createElement(rt,{values:[[Fn,e],[vt,s],[Kn,{dragAndDropHooks:r,dragState:R,dropState:I}],[Fp,{elementType:"div"}],[Ta,{render:Nb}],[wp,{name:"ListBoxSection",render:Ka}]]},y.createElement(Kp,null,y.createElement(D,{collection:u,scrollRef:n,persistedKeys:kb(c,r,I),renderDropIndicator:ka(r,I)}))),w,K))}function Ka(t,e,n,r="react-aria-ListBoxSection"){let o=a.useContext(vt),{dragAndDropHooks:l,dropState:i}=a.useContext(Kn),{CollectionBranch:s}=a.useContext(Zr),[u,c]=jr(),{headingProps:d,groupProps:f}=Lb({heading:c,"aria-label":t["aria-label"]??void 0}),b=Ee({...t,id:void 0,children:void 0,defaultClassName:r,values:void 0}),p=pe(t,{global:!0});return delete p.id,y.createElement(fe.section,{...J(p,b,f),ref:e},y.createElement(Ap.Provider,{value:{...d,ref:u}},y.createElement(s,{collection:o.collection,parent:n,renderDropIndicator:ka(l,i)})))}const Ib=xp(Sr,Ka),Bb=Ms(wr,function(e,n,r){let o=nt(n),l=a.useContext(vt),{dragAndDropHooks:i,dragState:s,dropState:u}=a.useContext(Kn),c=s&&!(s.isDisabled||s.selectionManager.isDisabled(r.key)),{optionProps:d,labelProps:f,descriptionProps:b,...p}=Ab({key:r.key,"aria-label":e==null?void 0:e["aria-label"]},l,o),{hoverProps:m,isHovered:v}=Gt({isDisabled:!p.allowsSelection&&!p.hasAction&&!c,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{keyboardProps:g}=ki(e),{focusProps:x}=Hr(e),$=null;s&&i&&($=i.useDraggableItem({key:r.key,hasAction:p.hasAction},s));let D=null;u&&i&&(D=i.useDroppableItem({target:{type:"item",key:r.key,dropPosition:"on"}},u,o));let P=s&&s.isDragging(r.key),F=Ee({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...p,isHovered:v,selectionMode:l.selectionManager.selectionMode,selectionBehavior:l.selectionManager.selectionBehavior,allowsDragging:!!s,isDragging:P,isDropTarget:D==null?void 0:D.isDropTarget}});a.useEffect(()=>{r.textValue},[r.textValue]);let R=e.href?fe.a:fe.div,I=pe(e,{global:!0});return delete I.id,delete I.onClick,e.href&&d.tabIndex==null&&(d.tabIndex=-1),y.createElement(R,{...J(I,F,d,m,g,x,$==null?void 0:$.dragProps,D==null?void 0:D.dropProps),ref:o,"data-allows-dragging":!!s||void 0,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":P||void 0,"data-drop-target":(D==null?void 0:D.isDropTarget)||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode},y.createElement(rt,{values:[[Ut,{slots:{[bn]:f,label:f,description:b}}],[Rp,{isSelected:p.isSelected}]]},F.children))});function Nb(t,e){e=nt(e);let{dragAndDropHooks:n,dropState:r}=a.useContext(Kn),{dropIndicatorProps:o,isHidden:l,isDropTarget:i}=n.useDropIndicator(t,r,e);return l?null:y.createElement(Vb,{...t,dropIndicatorProps:o,isDropTarget:i,ref:e})}function Ob(t,e){let{dropIndicatorProps:n,isDropTarget:r,...o}=t,l=Ee({...o,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:r}});return y.createElement(y.Fragment,null,y.createElement(fe.div,{...n,...l,role:"option",ref:e,"data-drop-target":r||void 0}))}const Vb=a.forwardRef(Ob);Ms(Er,function(e,n,r){let o=a.useContext(vt),{isLoading:l,onLoadMore:i,scrollOffset:s,...u}=e,c=a.useRef(null),d=a.useMemo(()=>({onLoadMore:i,collection:o==null?void 0:o.collection,sentinelRef:c,scrollOffset:s}),[i,s,o==null?void 0:o.collection]);gc(d,c);let f=Ee({...u,id:void 0,children:r.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),b={tabIndex:-1};return y.createElement(y.Fragment,null,y.createElement("div",{style:{position:"relative",width:0,height:0},inert:$c(!0)},y.createElement("div",{"data-testid":"loadMoreSentinel",ref:c,style:{position:"absolute",height:1,width:1}})),l&&f.children&&y.createElement(y.Fragment,null,y.createElement(fe.div,{...J(pe(e,{global:!0}),b),...f,role:"option",ref:n},f.children)))});function _b(t){let{description:e,errorMessage:n,isInvalid:r,validationState:o}=t,{labelProps:l,fieldProps:i}=$i(t),s=Ft([!!e,!!n,r,o]),u=Ft([!!e,!!n,r,o]);return i=J(i,{"aria-describedby":[s,u,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:l,fieldProps:i,descriptionProps:{id:s},errorMessageProps:{id:u}}}function jb(t,e,n){let{validationBehavior:r,focus:o}=t;ne(()=>{if(r==="native"&&(n!=null&&n.current)&&!n.current.disabled){let c=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(c),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(Hb(n.current))}});let l=a.useRef(!1),i=Pe(()=>{l.current||e.resetValidation()}),s=Pe(c=>{var f,b;e.displayValidation.isInvalid||e.commitValidation();let d=(f=n==null?void 0:n.current)==null?void 0:f.form;!c.defaultPrevented&&n&&d&&Wb(d)===n.current&&(o?o():(b=n.current)==null||b.focus(),Qd("keyboard")),c.preventDefault()}),u=Pe(()=>{e.commitValidation()});a.useEffect(()=>{let c=n==null?void 0:n.current;if(!c)return;let d=c.form,f=d==null?void 0:d.reset;return d&&(d.reset=()=>{l.current=!window.event||window.event.type==="message"&&j(window.event)instanceof MessagePort,f==null||f.call(d),l.current=!1}),c.addEventListener("invalid",s),c.addEventListener("change",u),d==null||d.addEventListener("reset",i),()=>{c.removeEventListener("invalid",s),c.removeEventListener("change",u),d==null||d.removeEventListener("reset",i),d&&(d.reset=f)}},[n,r])}function zb(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function Hb(t){return{isInvalid:!t.validity.valid,validationDetails:zb(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function Wb(t){var e;for(let n=0;n{var $;($=f.onClick)==null||$.call(f,x),Vu(x,v,t.href,t.routerOptions)}})}}const Ub=a.createContext(null),qb=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Ub);let r=e.href&&!e.isDisabled?"a":"span",{linkProps:o,isPressed:l}=Gb({...e,elementType:r},n),i=fe[r],{hoverProps:s,isHovered:u}=Gt(e),{focusProps:c,isFocused:d,isFocusVisible:f}=kn(),b=Ee({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:l,isHovered:u,isFocused:d,isFocusVisible:f}}),p=pe(e,{global:!0});return delete p.onClick,y.createElement(i,{ref:n,slot:e.slot||void 0,...J(p,b,o,s,c),"data-focused":d||void 0,"data-hovered":u||void 0,"data-pressed":l||void 0,"data-focus-visible":f||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),Ra=a.createContext({}),Pl=({children:t,className:e,...n})=>{const r=y.useMemo(()=>Ad(),[]);return A.jsx(Ra,{value:{slots:r},children:A.jsx(qb,{...n,className:Te(e,r==null?void 0:r.base()),children:o=>A.jsx(A.Fragment,{children:typeof t=="function"?t(o):t})})})},Yb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ra);return A.jsx(Ae.span,{className:he(r==null?void 0:r.icon,e),"data-default-icon":Ai(!t),"data-slot":"link-icon",...n,children:t??A.jsx(gf,{"data-slot":"link-default-icon"})})},Ih=Object.assign(Pl,{Root:Pl,Icon:Yb}),Xb=a.createContext({}),Zb="__button_group_child",Tl=({children:t,className:e,fullWidth:n,isDisabled:r,isIconOnly:o,size:l,slot:i,style:s,variant:u,[Zb]:c,...d})=>{const f=a.useContext(Xb),b=c===!0,p=l??(b?f==null?void 0:f.size:void 0),m=u??(b?f==null?void 0:f.variant:void 0),v=r??(b?f==null?void 0:f.isDisabled:void 0),g=n??(b?f==null?void 0:f.fullWidth:void 0),x=Ed({fullWidth:g,isIconOnly:o,size:p,variant:m});return A.jsx(Gr,{className:Te(e,x),"data-slot":"button",isDisabled:v,slot:i,style:s,...d,children:$=>typeof t=="function"?t($):t})},Bh=Object.assign(Tl,{Root:Tl}),xt=a.createContext({}),kl=({children:t,className:e,variant:n="default",...r})=>{const o=y.useMemo(()=>wd({variant:n}),[n]),l=A.jsx(Ae.div,{className:o.base({className:e}),"data-slot":"card",...r,children:t});return A.jsx(xt,{value:{slots:o},children:n==="transparent"?l:A.jsx(Li,{value:{variant:n},children:l})})},Jb=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},Qb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(xt);return A.jsx(Ae.h3,{className:he(r==null?void 0:r.title,e),"data-slot":"card-title",...n,children:t})},eh=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(xt);return A.jsx(Ae.p,{className:he(r==null?void 0:r.description,e),"data-slot":"card-description",...n,children:t})},th=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},nh=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},Nh=Object.assign(kl,{Root:kl,Header:Jb,Title:Qb,Description:eh,Content:th,Footer:nh}),Fa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Ia={...Fa,customError:!0,valid:!1},St={isInvalid:!1,validationDetails:Fa,validationErrors:[]},rh=a.createContext({}),Mr="__reactAriaFormValidationState";function oh(t){if(t[Mr]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}=t[Mr];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}}return lh(t)}function lh(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:l,validate:i,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let u=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Ia}:null,c=a.useMemo(()=>{if(!i||o==null)return null;let K=ih(i,o);return Dl(K)},[i,o]);l!=null&&l.validationDetails.valid&&(l=void 0);let d=a.useContext(rh),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(K=>Ar(d[K])):Ar(d[r]):[],[d,r]),[b,p]=a.useState(d),[m,v]=a.useState(!1);d!==b&&(p(d),v(!1));let g=a.useMemo(()=>Dl(m?[]:f),[m,f]),x=a.useRef(St),[$,D]=a.useState(St),P=a.useRef(St),F=()=>{if(!R)return;I(!1);let K=c||l||x.current;nr(K,P.current)||(P.current=K,D(K))},[R,I]=a.useState(!1);return a.useEffect(F),{realtimeValidation:u||g||c||l||St,displayValidation:s==="native"?u||g||$:u||g||c||l||$,updateValidation(K){s==="aria"&&!nr($,K)?D(K):x.current=K},resetValidation(){let K=St;nr(K,P.current)||(P.current=K,D(K)),s==="native"&&I(!1),v(!0)},commitValidation(){s==="native"&&I(!0),v(!0)}}}function Ar(t){return t?Array.isArray(t)?t:[t]:[]}function ih(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return Ar(n)}return[]}function Dl(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Ia}:null}function nr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}const sh=typeof document<"u"?y.useInsertionEffect??y.useLayoutEffect:()=>{};function ah(t,e,n){let[r,o]=a.useState(t||e),l=a.useRef(r),i=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{i.current,i.current=s},[s]);let u=s?t:r;sh(()=>{l.current=u});let[,c]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(l.current):f;Object.is(l.current,p)||(l.current=p,o(p),c(),n==null||n(p,...b))},[n]);return[u,d]}const Ba=a.createContext({}),Ml=({children:t,className:e,color:n,size:r,variant:o,...l})=>{const i=y.useMemo(()=>Sd({color:n,size:r,variant:o}),[n,r,o]),s=y.useMemo(()=>typeof t=="string"||typeof t=="number"?A.jsx(Na,{children:t}):t,[t]);return A.jsx(Ba,{value:{slots:i},children:A.jsx(Ae.span,{...l,className:he(i.base,e),"data-slot":"chip",children:s})})},Na=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ba);return A.jsx(Ae.span,{className:he(r==null?void 0:r.label,e),"data-slot":"chip-label",...n,children:t})},Oh=Object.assign(Ml,{Root:Ml,Label:Na}),In=a.createContext({});let uh=t=>{let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,...o}=t;return o};const ch=Ht(function(e,n){[e,n]=Ce(e,n,In);let{hoverProps:r,isHovered:o}=Gt({...e,isDisabled:e.disabled}),{isFocused:l,isFocusVisible:i,focusProps:s}=kn({isTextInput:!0,autoFocus:e.autoFocus}),u=!!e["aria-invalid"]&&e["aria-invalid"]!=="false",c=Ee({...e,values:{isHovered:o,isFocused:l,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:u},defaultClassName:"react-aria-Input"});return y.createElement(fe.input,{...J(uh(e),s,r),...c,ref:n,"data-focused":l||void 0,"data-disabled":e.disabled||void 0,"data-hovered":o||void 0,"data-focus-visible":i||void 0,"data-invalid":u||void 0})});function Oa(t,e){let{inputElementType:n="input",isDisabled:r=!1,isRequired:o=!1,isReadOnly:l=!1,type:i="text",validationBehavior:s="aria"}=t,[u,c]=ah(t.value,t.defaultValue||"",t.onChange),{focusableProps:d}=Pn(t,e),f=oh({...t,value:u}),{isInvalid:b,validationErrors:p,validationDetails:m}=f.displayValidation,{labelProps:v,fieldProps:g,descriptionProps:x,errorMessageProps:$}=_b({...t,isInvalid:b,errorMessage:t.errorMessage||p}),D=pe(t,{labelable:!0});const P={type:i,pattern:t.pattern};let[F]=a.useState(u);return Xl(e,t.defaultValue??F,c),jb(t,f,e),{labelProps:v,inputProps:J(D,n==="input"?P:void 0,{disabled:r,readOnly:l,required:o&&s==="native","aria-required":o&&s==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":t["aria-errormessage"],"aria-activedescendant":t["aria-activedescendant"],"aria-autocomplete":t["aria-autocomplete"],"aria-haspopup":t["aria-haspopup"],"aria-controls":t["aria-controls"],value:u,onChange:R=>c(j(R).value),autoComplete:t.autoComplete,autoCapitalize:t.autoCapitalize,maxLength:t.maxLength,minLength:t.minLength,name:t.name,form:t.form,placeholder:t.placeholder,inputMode:t.inputMode,autoCorrect:t.autoCorrect,spellCheck:t.spellCheck,[parseInt(y.version,10)>=17?"enterKeyHint":"enterkeyhint"]:t.enterKeyHint,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onCompositionEnd:t.onCompositionEnd,onCompositionStart:t.onCompositionStart,onCompositionUpdate:t.onCompositionUpdate,onSelect:t.onSelect,onBeforeInput:t.onBeforeInput,onInput:t.onInput,...d,...g}),descriptionProps:x,errorMessageProps:$,isInvalid:b,validationErrors:p,validationDetails:m}}var Va={};Va={buttonLabel:"عرض المقترحات",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} خيار`,other:()=>`${e.number(t.optionCount)} خيارات`})} متاحة.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`المجموعة المدخلة ${t.groupTitle}, مع ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} خيار`,other:()=>`${e.number(t.groupCount)} خيارات`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", محدد",other:""},t.isSelected)}`,listboxLabel:"مقترحات",selectedAnnouncement:t=>`${t.optionText}، محدد`};var _a={};_a={buttonLabel:"Покажи предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} опция`,other:()=>`${e.number(t.optionCount)} опции`})} на разположение.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Въведена група ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} опция`,other:()=>`${e.number(t.groupCount)} опции`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", избрани",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, избрани`};var ja={};ja={buttonLabel:"Zobrazit doporučení",countAnnouncement:(t,e)=>`K dispozici ${e.plural(t.optionCount,{one:()=>`je ${e.number(t.optionCount)} možnost`,other:()=>`jsou/je ${e.number(t.optionCount)} možnosti/-í`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina „${t.groupTitle}“ ${e.plural(t.groupCount,{one:()=>`s ${e.number(t.groupCount)} možností`,other:()=>`se ${e.number(t.groupCount)} možnostmi`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:" (vybráno)",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybráno`};var za={};za={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} mulighed tilgængelig`,other:()=>`${e.number(t.optionCount)} muligheder tilgængelige`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angivet gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} mulighed`,other:()=>`${e.number(t.groupCount)} muligheder`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var Ha={};Ha={buttonLabel:"Empfehlungen anzeigen",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} Option`,other:()=>`${e.number(t.optionCount)} Optionen`})} verfügbar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Eingetretene Gruppe ${t.groupTitle}, mit ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} Option`,other:()=>`${e.number(t.groupCount)} Optionen`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", ausgewählt",other:""},t.isSelected)}`,listboxLabel:"Empfehlungen",selectedAnnouncement:t=>`${t.optionText}, ausgewählt`};var Wa={};Wa={buttonLabel:"Προβολή προτάσεων",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} επιλογή`,other:()=>`${e.number(t.optionCount)} επιλογές `})} διαθέσιμες.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Εισαγμένη ομάδα ${t.groupTitle}, με ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} επιλογή`,other:()=>`${e.number(t.groupCount)} επιλογές`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", επιλεγμένο",other:""},t.isSelected)}`,listboxLabel:"Προτάσεις",selectedAnnouncement:t=>`${t.optionText}, επιλέχθηκε`};var Ga={};Ga={focusAnnouncement:(t,e)=>`${e.select({true:()=>`Entered group ${t.groupTitle}, with ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selected",other:""},t.isSelected)}`,countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} available.`,selectedAnnouncement:t=>`${t.optionText}, selected`,buttonLabel:"Show suggestions",listboxLabel:"Suggestions"};var Ua={};Ua={buttonLabel:"Mostrar sugerencias",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opción`,other:()=>`${e.number(t.optionCount)} opciones`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Se ha unido al grupo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opción`,other:()=>`${e.number(t.groupCount)} opciones`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seleccionado",other:""},t.isSelected)}`,listboxLabel:"Sugerencias",selectedAnnouncement:t=>`${t.optionText}, seleccionado`};var qa={};qa={buttonLabel:"Kuva soovitused",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} valik`,other:()=>`${e.number(t.optionCount)} valikud`})} saadaval.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Sisestatud rühm ${t.groupTitle}, valikuga ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} valik`,other:()=>`${e.number(t.groupCount)} valikud`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valitud",other:""},t.isSelected)}`,listboxLabel:"Soovitused",selectedAnnouncement:t=>`${t.optionText}, valitud`};var Ya={};Ya={buttonLabel:"Näytä ehdotukset",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} vaihtoehto`,other:()=>`${e.number(t.optionCount)} vaihtoehdot`})} saatavilla.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Mentiin ryhmään ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} vaihtoehdon`,other:()=>`${e.number(t.groupCount)} vaihtoehdon`})} kanssa.`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valittu",other:""},t.isSelected)}`,listboxLabel:"Ehdotukset",selectedAnnouncement:t=>`${t.optionText}, valittu`};var Xa={};Xa={buttonLabel:"Afficher les suggestions",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groupe ${t.groupTitle} rejoint, avec ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", sélectionné(s)",other:""},t.isSelected)}`,listboxLabel:"Suggestions",selectedAnnouncement:t=>`${t.optionText}, sélectionné`};var Za={};Za={buttonLabel:"הצג הצעות",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`אפשרות ${e.number(t.optionCount)}`,other:()=>`${e.number(t.optionCount)} אפשרויות`})} במצב זמין.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`נכנס לקבוצה ${t.groupTitle}, עם ${e.plural(t.groupCount,{one:()=>`אפשרות ${e.number(t.groupCount)}`,other:()=>`${e.number(t.groupCount)} אפשרויות`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", נבחר",other:""},t.isSelected)}`,listboxLabel:"הצעות",selectedAnnouncement:t=>`${t.optionText}, נבחר`};var Ja={};Ja={buttonLabel:"Prikaži prijedloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} opcije/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", odabranih",other:""},t.isSelected)}`,listboxLabel:"Prijedlozi",selectedAnnouncement:t=>`${t.optionText}, odabrano`};var Qa={};Qa={buttonLabel:"Javaslatok megjelenítése",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} lehetőség`,other:()=>`${e.number(t.optionCount)} lehetőség`})} áll rendelkezésre.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Belépett a(z) ${t.groupTitle} csoportba, amely ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} lehetőséget`,other:()=>`${e.number(t.groupCount)} lehetőséget`})} tartalmaz. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", kijelölve",other:""},t.isSelected)}`,listboxLabel:"Javaslatok",selectedAnnouncement:t=>`${t.optionText}, kijelölve`};var eu={};eu={buttonLabel:"Mostra suggerimenti",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opzione disponibile`,other:()=>`${e.number(t.optionCount)} opzioni disponibili`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingresso nel gruppo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opzione`,other:()=>`${e.number(t.groupCount)} opzioni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selezionato",other:""},t.isSelected)}`,listboxLabel:"Suggerimenti",selectedAnnouncement:t=>`${t.optionText}, selezionato`};var tu={};tu={buttonLabel:"候補を表示",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 個のオプション`,other:()=>`${e.number(t.optionCount)} 個のオプション`})}を利用できます。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`入力されたグループ ${t.groupTitle}、${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 個のオプション`,other:()=>`${e.number(t.groupCount)} 個のオプション`})}を含む。`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:"、選択済み",other:""},t.isSelected)}`,listboxLabel:"候補",selectedAnnouncement:t=>`${t.optionText}、選択済み`};var nu={};nu={buttonLabel:"제안 사항 표시",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)}개 옵션`,other:()=>`${e.number(t.optionCount)}개 옵션`})}을 사용할 수 있습니다.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`입력한 그룹 ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)}개 옵션`,other:()=>`${e.number(t.groupCount)}개 옵션`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 선택됨",other:""},t.isSelected)}`,listboxLabel:"제안",selectedAnnouncement:t=>`${t.optionText}, 선택됨`};var ru={};ru={buttonLabel:"Rodyti pasiūlymus",countAnnouncement:(t,e)=>`Yra ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} parinktis`,other:()=>`${e.number(t.optionCount)} parinktys (-ių)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Įvesta grupė ${t.groupTitle}, su ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} parinktimi`,other:()=>`${e.number(t.groupCount)} parinktimis (-ių)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", pasirinkta",other:""},t.isSelected)}`,listboxLabel:"Pasiūlymai",selectedAnnouncement:t=>`${t.optionText}, pasirinkta`};var ou={};ou={buttonLabel:"Rādīt ieteikumus",countAnnouncement:(t,e)=>`Pieejamo opciju skaits: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcijas`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ievadīta grupa ${t.groupTitle}, ar ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opciju`,other:()=>`${e.number(t.groupCount)} opcijām`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", atlasīta",other:""},t.isSelected)}`,listboxLabel:"Ieteikumi",selectedAnnouncement:t=>`${t.optionText}, atlasīta`};var lu={};lu={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativer`})} finnes.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angitt gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativer`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var iu={};iu={buttonLabel:"Suggesties weergeven",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} optie`,other:()=>`${e.number(t.optionCount)} opties`})} beschikbaar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groep ${t.groupTitle} ingevoerd met ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} optie`,other:()=>`${e.number(t.groupCount)} opties`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", geselecteerd",other:""},t.isSelected)}`,listboxLabel:"Suggesties",selectedAnnouncement:t=>`${t.optionText}, geselecteerd`};var su={};su={buttonLabel:"Wyświetlaj sugestie",countAnnouncement:(t,e)=>`dostępna/dostępne(-nych) ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcja`,other:()=>`${e.number(t.optionCount)} opcje(-i)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Dołączono do grupy ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcją`,other:()=>`${e.number(t.groupCount)} opcjami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", wybrano",other:""},t.isSelected)}`,listboxLabel:"Sugestie",selectedAnnouncement:t=>`${t.optionText}, wybrano`};var au={};au={buttonLabel:"Mostrar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo inserido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var uu={};uu={buttonLabel:"Apresentar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo introduzido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var cu={};cu={buttonLabel:"Afișare sugestii",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opțiune`,other:()=>`${e.number(t.optionCount)} opțiuni`})} disponibile.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grup ${t.groupTitle} introdus, cu ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opțiune`,other:()=>`${e.number(t.groupCount)} opțiuni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selectat",other:""},t.isSelected)}`,listboxLabel:"Sugestii",selectedAnnouncement:t=>`${t.optionText}, selectat`};var du={};du={buttonLabel:"Показать предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметров`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введенная группа ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметром`,other:()=>`${e.number(t.groupCount)} параметрами`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", выбранными",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, выбрано`};var fu={};fu={buttonLabel:"Zobraziť návrhy",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} možnosť`,other:()=>`${e.number(t.optionCount)} možnosti/-í`})} k dispozícii.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} možnosťou`,other:()=>`${e.number(t.groupCount)} možnosťami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", vybraté",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybraté`};var pu={};pu={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Na voljo je ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Vnesena skupina ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcija`,other:()=>`${e.number(t.groupCount)} opcije`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izbrano",other:""},t.isSelected)}`,listboxLabel:"Predlogi",selectedAnnouncement:t=>`${t.optionText}, izbrano`};var bu={};bu={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena grupa ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} optione/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izabranih",other:""},t.isSelected)}`,listboxLabel:"Predlozi",selectedAnnouncement:t=>`${t.optionText}, izabrano`};var hu={};hu={buttonLabel:"Visa förslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativ`})} tillgängliga.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingick i gruppen ${t.groupTitle} med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativ`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valda",other:""},t.isSelected)}`,listboxLabel:"Förslag",selectedAnnouncement:t=>`${t.optionText}, valda`};var mu={};mu={buttonLabel:"Önerileri göster",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} seçenek`,other:()=>`${e.number(t.optionCount)} seçenekler`})} kullanılabilir.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Girilen grup ${t.groupTitle}, ile ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} seçenek`,other:()=>`${e.number(t.groupCount)} seçenekler`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seçildi",other:""},t.isSelected)}`,listboxLabel:"Öneriler",selectedAnnouncement:t=>`${t.optionText}, seçildi`};var gu={};gu={buttonLabel:"Показати пропозиції",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметри(-ів)`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введена група ${t.groupTitle}, з ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметр`,other:()=>`${e.number(t.groupCount)} параметри(-ів)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", вибрано",other:""},t.isSelected)}`,listboxLabel:"Пропозиції",selectedAnnouncement:t=>`${t.optionText}, вибрано`};var $u={};$u={buttonLabel:"显示建议",countAnnouncement:(t,e)=>`有 ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 个选项`,other:()=>`${e.number(t.optionCount)} 个选项`})}可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`进入了 ${t.groupTitle} 组,其中有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 个选项`,other:()=>`${e.number(t.groupCount)} 个选项`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已选择",other:""},t.isSelected)}`,listboxLabel:"建议",selectedAnnouncement:t=>`${t.optionText}, 已选择`};var yu={};yu={buttonLabel:"顯示建議",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 選項`,other:()=>`${e.number(t.optionCount)} 選項`})} 可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`輸入的群組 ${t.groupTitle}, 有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 選項`,other:()=>`${e.number(t.groupCount)} 選項`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已選取",other:""},t.isSelected)}`,listboxLabel:"建議",selectedAnnouncement:t=>`${t.optionText}, 已選取`};var vu={};vu={"ar-AE":Va,"bg-BG":_a,"cs-CZ":ja,"da-DK":za,"de-DE":Ha,"el-GR":Wa,"en-US":Ga,"es-ES":Ua,"et-EE":qa,"fi-FI":Ya,"fr-FR":Xa,"he-IL":Za,"hr-HR":Ja,"hu-HU":Qa,"it-IT":eu,"ja-JP":tu,"ko-KR":nu,"lt-LT":ru,"lv-LV":ou,"nb-NO":lu,"nl-NL":iu,"pl-PL":su,"pt-BR":au,"pt-PT":uu,"ro-RO":cu,"ru-RU":du,"sk-SK":fu,"sl-SI":pu,"sr-SP":bu,"sv-SE":hu,"tr-TR":mu,"uk-UA":gu,"zh-CN":$u,"zh-TW":yu};function dh(t){return t&&t.__esModule?t.default:t}function fh(t,e){let{buttonRef:n,popoverRef:r,inputRef:o,listBoxRef:l,keyboardDelegate:i,layoutDelegate:s,shouldFocusWrap:u,isReadOnly:c,isDisabled:d}=t,f=a.useRef(null);n=n??f;let b=Yr(dh(vu),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=Op({type:"listbox",isDisabled:d||c},e,n);Rn.set(e,{id:m.id});let{collection:v}=e,{disabledKeys:g}=e.selectionManager,x=a.useMemo(()=>i||new Qr({collection:v,disabledKeys:g,ref:l,layoutDelegate:s}),[i,s,v,g,l]),{collectionProps:$}=ga({selectionManager:e.selectionManager,keyboardDelegate:x,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:u,ref:o,isVirtualized:!0}),D=zt(),P=L=>{if(!L.nativeEvent.isComposing)switch(L.key){case"Enter":case"Tab":if(e.isOpen&&L.key==="Enter"&&L.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let H=e.collection.getItem(e.selectionManager.focusedKey);if(H!=null&&H.props.href){let oe=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);L.key==="Enter"&&oe instanceof HTMLAnchorElement&&D.open(oe,L,H.props.href,H.props.routerOptions),e.close();break}else if(H!=null&&H.props.onAction){H.props.onAction(),e.close();break}}(L.key==="Enter"||e.isOpen)&&e.commit();break;case"Escape":(!e.selectionManager.isEmpty||e.inputValue===""||t.allowsCustomValue)&&L.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},F=L=>{let H=(n==null?void 0:n.current)&&n.current===L.relatedTarget,oe=te(r.current,L.relatedTarget);H||oe||(t.onBlur&&t.onBlur(L),e.setFocused(!1))},R=L=>{e.isFocused||(t.onFocus&&t.onFocus(L),e.setFocused(!0))},I=ph([e.selectionManager.selectedKeys,e.selectionManager.selectionMode]),{isInvalid:k,validationErrors:B,validationDetails:K}=e.displayValidation,{labelProps:_,inputProps:U,descriptionProps:z,errorMessageProps:h}=Oa({...t,isRequired:t.selectionMode==="multiple"?t.isRequired&&e.selectionManager.isEmpty:t.isRequired,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:tt(e.isOpen&&$.onKeyDown,P,t.onKeyDown),onBlur:F,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:R,autoComplete:"off",validate:void 0,[Mr]:e,"aria-describedby":[I,t["aria-describedby"]].filter(Boolean).join(" ")||void 0},o);Xl(o,e.defaultValue,e.setValue);let C=L=>{var H;L.pointerType==="touch"&&((H=o.current)==null||H.focus(),e.toggle(null,"manual"))},M=L=>{var H;L.pointerType!=="touch"&&((H=o.current)==null||H.focus(),e.toggle(L.pointerType==="keyboard"||L.pointerType==="virtual"?"first":null,"manual"))},E=dn({id:p.id,"aria-label":b.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||_.id}),w=dn({id:m.id,"aria-label":b.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||_.id}),T=a.useRef(0),S=L=>{var it,Yt;if(d||c)return;if(L.timeStamp-T.current<500){L.preventDefault(),(it=o.current)==null||it.focus();return}let H=j(L).getBoundingClientRect(),oe=L.changedTouches[0],Se=Math.ceil(H.left+.5*H.width),Bn=Math.ceil(H.top+.5*H.height);oe.clientX===Se&&oe.clientY===Bn&&(L.preventDefault(),(Yt=o.current)==null||Yt.focus(),e.toggle(null,"manual"),T.current=L.timeStamp)},N=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0,q=(N==null?void 0:N.parentKey)??null,W=e.selectionManager.focusedKey??null,X=a.useRef(q),Q=a.useRef(W);a.useEffect(()=>{if(ln()&&N!=null&&W!=null&&W!==Q.current){let L=e.selectionManager.isSelected(W),H=q!=null?e.collection.getItem(q):null,oe=(H==null?void 0:H["aria-label"])||(typeof(H==null?void 0:H.rendered)=="string"?H.rendered:"")||"",Se=b.format("focusAnnouncement",{isGroupChange:(H&&q!==X.current)??!1,groupTitle:oe,groupCount:H?[...$a(H,e.collection)].length:0,optionText:N["aria-label"]||N.textValue||"",isSelected:L});Lt(Se)}X.current=q,Q.current=W});let le=ya(e.collection),Z=a.useRef(le),be=a.useRef(e.isOpen);a.useEffect(()=>{let L=e.isOpen!==be.current&&(e.selectionManager.focusedKey==null||ln());if(e.isOpen&&(L||le!==Z.current)){let H=b.format("countAnnouncement",{optionCount:le});Lt(H)}Z.current=le,be.current=e.isOpen});let we=a.useRef(e.selectedKey);return a.useEffect(()=>{if(ln()&&e.isFocused&&e.selectedItem&&e.selectedKey!==we.current){let L=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",H=b.format("selectedAnnouncement",{optionText:L});Lt(H)}we.current=e.selectedKey}),a.useEffect(()=>{if(e.isOpen)return Ur([o.current,r.current].filter(L=>L!=null))},[e.isOpen,o,r]),cc(()=>{!N&&o.current&&re(ee(o.current))===o.current&&Jr(o.current,null)},[N]),Tt(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:_,buttonProps:{...p,...E,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:C,onPressStart:M,isDisabled:d||c},inputProps:J(U,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":N?Da(e,N.key):void 0,onTouchEnd:S,autoCorrect:"off",spellCheck:"false"}),listBoxProps:J(m,w,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),valueProps:{id:I},descriptionProps:z,errorMessageProps:h,isInvalid:k,validationErrors:B,validationDetails:K}}function ph(t=[]){let e=ve(),[n,r]=a.useState(!0),[o,l]=a.useState(t);return o.some((i,s)=>!Object.is(i,t[s]))&&(r(!0),l(t)),a.useEffect(()=>{n&&!document.getElementById(e)&&r(!1)},[e,n,o]),n?e:void 0}function bh(t){var fo;let{defaultFilter:e,menuTrigger:n="input",allowsEmptyCollection:r=!1,allowsCustomValue:o,shouldCloseOnBlur:l=!0,selectionMode:i="single"}=t,[s,u]=a.useState(!1),[c,d]=a.useState(!1),[f,b]=a.useState(null),p=a.useMemo(()=>t.defaultValue!==void 0?t.defaultValue:i==="single"?t.defaultSelectedKey??null:[],[t.defaultValue,t.defaultSelectedKey,i]),m=a.useMemo(()=>t.value!==void 0?t.value:i==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,i]),[v,g]=$n(m,p,t.onChange),x=i==="single"&&Array.isArray(v)?v[0]:v,$=G=>{var se;if(i==="single"){let ue=Array.isArray(G)?G[0]??null:G;g(ue),ue!==x&&((se=t.onSelectionChange)==null||se.call(t,ue))}else{let ue=[];Array.isArray(G)?ue=G:G!=null&&(ue=[G]),g(ue)}},{collection:D,selectionManager:P,disabledKeys:F}=Ma({...t,items:t.items??t.defaultItems,selectionMode:i,disallowEmptySelection:i==="single",allowDuplicateSelectionEvents:!0,selectedKeys:a.useMemo(()=>mh(x),[x]),onSelectionChange:G=>{var se;if(G!=="all")if(i==="single"){let ue=G.values().next().value??null;ue===x?((se=t.onSelectionChange)==null||se.call(t,ue),le(),W()):$(ue)}else $([...G])}}),R=i==="single"?P.firstSelectedKey:null,I=a.useMemo(()=>[...P.selectedKeys].map(G=>D.getItem(G)).filter(G=>G!=null),[P.selectedKeys,D]),[k,B]=$n(t.inputValue,Al(t.defaultInputValue,R,D)||"",t.onInputChange),[K]=a.useState(x),[_]=a.useState(k),U=D,z=a.useMemo(()=>t.items!=null||!e?D:hh(D,k,e),[D,k,e,t.items]),[h,C]=a.useState(z),M=a.useRef("focus"),w=Ln({...t,onOpenChange:G=>{t.onOpenChange&&t.onOpenChange(G,G?M.current:void 0),P.setFocused(G),G||P.setFocusedKey(null)},isOpen:void 0,defaultOpen:void 0}),T=(G=null,se)=>{let ue=se==="manual"||se==="focus"&&n==="focus";(r||z.size>0||ue&&U.size>0||t.items)&&(ue&&!w.isOpen&&t.items===void 0&&u(!0),M.current=se,b(G),w.open())},S=(G=null,se)=>{let ue=se==="manual"||se==="focus"&&n==="focus";!(r||z.size>0||ue&&U.size>0||t.items)&&!w.isOpen||(ue&&!w.isOpen&&t.items===void 0&&u(!0),w.isOpen||(M.current=se),q(G))},N=a.useCallback(()=>{C(s?U:z)},[s,U,z]),q=a.useCallback((G=null)=>{w.isOpen&&N(),b(G),w.toggle()},[w,N]),W=a.useCallback(()=>{w.isOpen&&(N(),w.close())},[w,N]),[X,Q]=a.useState(k),le=()=>{var se;let G=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";Q(G),B(G)},Z=a.useRef(x),be=a.useRef(R!=null?((fo=D.getItem(R))==null?void 0:fo.textValue)??"":"");a.useEffect(()=>{var se;c&&(z.size>0||r)&&!w.isOpen&&k!==X&&n!=="manual"&&T(null,"input"),!s&&!r&&w.isOpen&&z.size===0&&W(),x!=null&&x!==Z.current&&i==="single"&&W(),k!==X&&(P.setFocusedKey(null),u(!1),i==="single"&&k===""&&(t.inputValue===void 0||m===void 0)&&$(null)),x!==Z.current&&(t.inputValue===void 0||m===void 0)?le():X!==k&&Q(k);let G=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";!c&&R!=null&&t.inputValue===void 0&&R===Z.current&&be.current!==G&&(Q(G),B(G)),Z.current=x,be.current=G});let we=wb({...t,value:a.useMemo(()=>Array.isArray(x)&&x.length===0?null:{inputValue:k,value:x,selectedKey:R},[k,R,x])}),L=()=>{o&&R==null?H():oe()},H=()=>{if(i==="multiple"){Q(k),W();return}let G=null;Z.current=G,$(G),W()},oe=(G=!1)=>{var se,ue,po;if(m!==void 0&&t.inputValue!==void 0){let bo=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";(G||i==="multiple"||k!==bo)&&((ue=t.onSelectionChange)==null||ue.call(t,R),(po=t.onChange)==null||po.call(t,x)),Q(bo),W()}else le(),W()};const Se=()=>{var G;if(o){const se=R!=null?((G=D.getItem(R))==null?void 0:G.textValue)??"":"";k===se?oe():H()}else oe()};let Bn=()=>{w.isOpen&&P.focusedKey!=null?P.isSelected(P.focusedKey)&&i==="single"?oe(!0):P.select(P.focusedKey):Se()},it=a.useRef([k,x]),Yt=G=>{G?(it.current=[k,x],n==="focus"&&!t.isReadOnly&&T(null,"focus")):(l&&Se(),(k!==it.current[0]||x!==it.current[1])&&we.commitValidation()),d(G)},Pu=a.useMemo(()=>w.isOpen?s?U:z:h,[w.isOpen,U,z,s,h]),co=t.defaultSelectedKey??(i==="single"?K:null);return{...we,...w,focusStrategy:f,toggle:S,open:T,close:Se,selectionManager:P,value:x,defaultValue:p??K,setValue:$,selectedKey:R,selectedItems:I,defaultSelectedKey:co,setSelectedKey:$,disabledKeys:F,isFocused:c,setFocused:Yt,selectedItem:I[0]??null,collection:Pu,inputValue:k,defaultInputValue:Al(t.defaultInputValue,co,D)??_,setInputValue:B,commit:Bn,revert:L}}function hh(t,e,n){return new Dr(xu(t,t,e,n))}function xu(t,e,n,r){let o=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let i=xu(t,va(l,t),n,r);[...i].some(s=>s.type==="item")&&o.push({...l,childNodes:i})}else l.type==="item"&&r(l.textValue,n)?o.push({...l}):l.type!=="item"&&o.push({...l});return o}function Al(t,e,n){var r;return t==null&&e!=null?((r=n.getItem(e))==null?void 0:r.textValue)??"":t}function mh(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}const gh=a.createContext(null),Cu=a.createContext(null),$h=Ht(function(e,n){[e,n]=Ce(e,n,gh);let{children:r,isDisabled:o=!1,isInvalid:l=!1,isRequired:i=!1,isReadOnly:s=!1}=e,u=a.useMemo(()=>y.createElement(Fn.Provider,{value:{items:e.items??e.defaultItems}},typeof r=="function"?r({isOpen:!1,isDisabled:o,isInvalid:l,isRequired:i,defaultChildren:null,isReadOnly:s}):r),[r,o,l,i,s,e.items,e.defaultItems]);return y.createElement(ks,{content:u},c=>y.createElement(vh,{props:e,collection:c,comboBoxRef:n}))}),yh=[wn,Dn,In,ro,Ut];function vh({props:t,collection:e,comboBoxRef:n}){let{name:r,formValue:o="key",allowsCustomValue:l}=t;l&&(o="text");let{validationBehavior:i}=_r(Pa)||{},s=t.validationBehavior??i??"native",{contains:u}=Cb({sensitivity:"base"}),c=bh({...t,defaultFilter:t.defaultFilter||u,items:t.items,children:void 0,collection:e,validationBehavior:s}),d=a.useRef(null),f=a.useRef(null),b=a.useRef(null),p=a.useRef(null),m=a.useRef(null),[v,g]=jr(!t["aria-label"]&&!t["aria-labelledby"]),{buttonProps:x,inputProps:$,listBoxProps:D,labelProps:P,descriptionProps:F,errorMessageProps:R,valueProps:I,...k}=fh({...gi(t),label:g,inputRef:f,buttonRef:d,listBoxRef:p,popoverRef:m,name:o==="text"?r:void 0,validationBehavior:s},c),[B,K]=a.useState(null),_=a.useCallback(()=>{var E;if(f.current&&!b.current){let w=(E=d.current)==null?void 0:E.getBoundingClientRect(),T=f.current.getBoundingClientRect(),S=w?Math.min(w.left,T.left):T.left,N=w?Math.max(w.right,T.right):T.right;K(N-S+"px")}},[d,f,K]);fn({ref:f,onResize:_});let U=a.useMemo(()=>({get current(){return b.current||f.current}}),[b,f]),z=a.useMemo(()=>({isOpen:c.isOpen,isDisabled:t.isDisabled||!1,isInvalid:k.isInvalid||!1,isRequired:t.isRequired||!1,isReadOnly:t.isReadOnly||!1}),[c.isOpen,t.isDisabled,k.isInvalid,t.isRequired,t.isReadOnly]),h=Ee({...t,values:z,defaultClassName:"react-aria-ComboBox"}),C=pe(t,{global:!0});delete C.id;let M=[];if(r&&o==="key"){let E=Array.isArray(c.value)?c.value:[c.value];E.length===0&&(E=[null]),M=E.map((w,T)=>y.createElement("input",{key:T,type:"hidden",name:r,form:t.form,value:w??""}))}return y.createElement(rt,{values:[[Cu,c],[wn,{...P,ref:v}],[Dn,{...x,ref:d,isPressed:c.isOpen}],[In,{...$,ref:f}],[lt,c],[Xr,{ref:m,triggerRef:U,scrollRef:p,placement:"bottom start",isNonModal:!0,trigger:"ComboBox",style:{"--trigger-width":B},clearContexts:yh}],[Fn,{...D,ref:p}],[vt,c],[Ut,{slots:{description:F,errorMessage:R}}],[ro,{ref:b,isInvalid:k.isInvalid,isDisabled:t.isDisabled||!1}],[Ea,k],[xh,I]]},y.createElement(fe.div,{...C,...h,ref:n,slot:t.slot||void 0,"data-focused":c.isFocused||void 0,"data-open":c.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":k.isInvalid||void 0,"data-required":t.isRequired||void 0},h.children,M))}const xh=a.createContext(null),qt=a.createContext({}),Ll=({children:t,className:e,fullWidth:n,menuTrigger:r="focus",variant:o,...l})=>{const i=y.useMemo(()=>Td({fullWidth:n}),[n]);return A.jsx(qt,{value:{slots:i,variant:o},children:A.jsx($h,{"data-slot":"combo-box",menuTrigger:r,...l,className:Te(e,i==null?void 0:i.base()),children:s=>A.jsx(A.Fragment,{children:typeof t=="function"?t(s):t})})})},Ch=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(qt),o=he(r==null?void 0:r.inputGroup,e);return A.jsx("div",{className:o,"data-slot":"combo-box-input-group",...n,children:t})},Eh=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(qt),o=a.useContext(Cu);return A.jsx(Gr,{className:Te(e,r==null?void 0:r.trigger()),"data-open":Ai(o==null?void 0:o.isOpen),"data-slot":"combo-box-trigger",...n,children:t??A.jsx(mf,{"data-slot":"combo-box-trigger-default-icon"})})},wh=({children:t,className:e,placement:n="bottom",...r})=>{const{slots:o}=a.useContext(qt);return A.jsx(Li,{value:{variant:"default"},children:A.jsx(ap,{...r,className:Te(e,o==null?void 0:o.popover()),"data-slot":"combo-box-popover",placement:n,children:t})})},Vh=Object.assign(Ll,{Root:Ll,InputGroup:Ch,Trigger:Eh,Popover:wh}),Sh=({...t})=>{const e=a.useId();return A.jsxs("svg",{"data-slot":"spinner-icon",viewBox:"0 0 24 24",...t,children:[A.jsxs("defs",{children:[A.jsxs("linearGradient",{id:`«data-slot-icon-def-1»-${e}`,x1:"50%",x2:"50%",y1:"5.271%",y2:"91.793%",children:[A.jsx("stop",{offset:"0%",stopColor:"currentColor"}),A.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]}),A.jsxs("linearGradient",{id:`«data-slot-icon-def-2»-${e}`,x1:"50%",x2:"50%",y1:"15.24%",y2:"87.15%",children:[A.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:0}),A.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]})]}),A.jsxs("g",{fill:"none",children:[A.jsx("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),A.jsx("path",{d:"M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",fill:`url(#«data-slot-icon-def-1»-${e})`,transform:"translate(1.5 1.625)"}),A.jsx("path",{d:"M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",fill:`url(#«data-slot-icon-def-2»-${e})`,transform:"translate(1.5 1.625)"})]})]})},Kl=({className:t,color:e,size:n,...r})=>A.jsx(Ae.span,{"data-slot":"spinner",...r,className:Fd({className:t,color:e,size:n}),children:A.jsx(Sh,{"aria-hidden":!0,"aria-label":"Loading",role:"presentation"})}),_h=Object.assign(Kl,{Root:Kl}),Ph=a.createContext({}),Th=a.createContext(null),kh=Ht(function(e,n){[e,n]=Ce(e,n,Th);let{validationBehavior:r}=_r(Pa)||{},o=e.validationBehavior??r??"native",l=a.useRef(null);[e,l]=Ce(e,l,Mp);let[i,s]=jr(!e["aria-label"]&&!e["aria-labelledby"]),[u,c]=a.useState("input"),{labelProps:d,inputProps:f,descriptionProps:b,errorMessageProps:p,...m}=Oa({...gi(e),inputElementType:u,label:s,validationBehavior:o},l),v=a.useCallback($=>{l.current=$,$&&c($ instanceof HTMLTextAreaElement?"textarea":"input")},[l]),g=Ee({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:m.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-TextField"}),x=pe(e,{global:!0});return delete x.id,y.createElement(fe.div,{...x,...g,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":m.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},y.createElement(rt,{values:[[wn,{...d,ref:i}],[In,{...f,ref:v}],[Ph,{...f,ref:v}],[ro,{role:"presentation",isInvalid:m.isInvalid,isDisabled:e.isDisabled||!1}],[Ut,{slots:{description:b,errorMessage:p}}],[Ea,m]]},g.children))}),Eu=a.createContext({}),Rl=({children:t,className:e,fullWidth:n,variant:r,...o})=>{const l=y.useMemo(()=>Id({fullWidth:n}),[n]);return A.jsx(kh,{"data-slot":"textfield",...o,className:Te(e,l),children:i=>A.jsx(Eu,{value:{variant:r},children:A.jsx(A.Fragment,{children:typeof t=="function"?t(i):t})})})},Fl=({className:t,fullWidth:e,variant:n,...r})=>{const o=a.useContext(Eu),l=a.useContext(qt),i=n??o.variant??l.variant;return A.jsx(ch,{className:Te(t,Dd({fullWidth:e,variant:i})),"data-slot":"input",...r})},jh=Object.assign(Fl,{Root:Fl}),zh=Object.assign(Rl,{Root:Rl}),Il=({children:t,className:e,isDisabled:n,isInvalid:r,isRequired:o,...l})=>A.jsx(_d,{className:Md({isRequired:o,isDisabled:n,isInvalid:r,className:e}),"data-slot":"label",...l,children:t}),Hh=Object.assign(Il,{Root:Il}),Bl=({children:t,className:e,...n})=>A.jsx(Ip,{className:kd({className:e}),"data-slot":"description",slot:"description",...n,children:t}),Wh=Object.assign(Bl,{Root:Bl}),wu=a.createContext({}),Nl=({children:t,className:e,variant:n,...r})=>{const o=y.useMemo(()=>Kd({variant:n}),[n]);return A.jsx(Bb,{className:Te(e,o.item()),"data-slot":"list-box-item",...r,children:l=>A.jsx(wu,{value:{slots:o,state:l},children:typeof t=="function"?t(l):t})})},Su=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(wu),l=o==null?void 0:o.isSelected,i=typeof t=="function"?t(o??{}):t||A.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:l?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:A.jsx("polyline",{points:"1 9 7 14 15 4"})});return A.jsx(Ae.span,{"aria-hidden":"true",className:he(r==null?void 0:r.indicator,e),"data-slot":"list-box-item-indicator","data-visible":l||void 0,...n,children:i})},Dh=Object.assign(Nl,{Root:Nl,Indicator:Su}),Mh=({children:t,className:e,...n})=>{const r=y.useMemo(()=>Rd({class:typeof e=="string"?e:void 0}),[e]);return A.jsx(Ib,{className:r,...n,children:t})},Ah=Mh;function Ol({className:t,variant:e,...n}){const r=y.useMemo(()=>Ld({variant:e}),[e]);return A.jsx(Rb,{className:Te(t,r),"data-slot":"list-box",...n})}const Gh=Object.assign(Ol,{Root:Ol,Item:Dh,ItemIndicator:Su,Section:Ah});export{Fh as A,Bh as B,Vh as C,Wh as D,jh as I,Hh as L,_h as S,zh as T,Gh as a,Dh as b,Nh as c,nc as d,Ih as e,Oh as f,Ed as g}; diff --git a/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js b/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js new file mode 100644 index 00000000..bc281fa6 --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-C0gVlZW-.js","assets/tanstack-query-W9y7rsMr.js","assets/react-q-ooZ0ti.js","assets/Table-DEsIhjZo.js","assets/heroui-CewI8xK4.js","assets/AliasesPage-mAjq9eh5.js","assets/Field-gj3-ox4q.js","assets/BudgetsPage-Us4jYLgv.js","assets/KeysPage-BhG598Pa.js","assets/ModelScopeControl-CNKA1fyP.js","assets/ModelsPage-DaewNAhO.js","assets/OverviewPage-BYSSsHzo.js","assets/ProvidersPage-swJiAs79.js","assets/SettingsPage-BNeqLlOB.js","assets/ToolsGuardrailsPage-ChC-YhRl.js","assets/UsagePage-BVzIiui8.js","assets/UsersPage-BxkuFQkF.js"])))=>i.map(i=>d[i]); +var we=Object.defineProperty;var Se=(e,r,s)=>r in e?we(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var re=(e,r,s)=>Se(e,typeof r!="symbol"?r+"":r,s);import{u as y,j as t,a as v,b as x,k as H,Q as ke,c as Pe}from"./tanstack-query-W9y7rsMr.js";import{d as Ee,r as o,N as le,O as Ne,H as Ce,R as Te,e as b,f as _e}from"./react-q-ooZ0ti.js";import{C as L,L as ce,I as ue,a as Ae,b as Ie,B as P,c as I,d as C,T as Le,e as qe}from"./heroui-CewI8xK4.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const f of l.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Re=Ee();const Oe="modulepreload",De=function(e){return"/"+e},se={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=f(s.map(m=>{if(m=De(m),m in se)return;se[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const h=document.createElement("link");if(h.rel=p?"stylesheet":Oe,p||(h.as="script"),h.crossOrigin="",h.href=m,d&&h.setAttribute("nonce",d),document.head.appendChild(h),p)return new Promise((u,j)=>{h.addEventListener("load",u),h.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(f){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=f,window.dispatchEvent(c),!c.defaultPrevented)throw f}return n.then(f=>{for(const c of f||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);re(this,"status");this.name="ApiError",this.status=s}}let R=null;function ne(e){R=e}let Q=null;function q(e){Q=e}async function V(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Fe(e){let r;try{r=await fetch("/v1/settings",{headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await V(r));return!0}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),Q&&s.set("Authorization",`Bearer ${Q}`);let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw R==null||R(),new E(a.status,await V(a));if(!a.ok)throw new E(a.status,await V(a));if(a.status!==204)return await a.json()}const O="otari.dashboard.masterKey",de=o.createContext(null);function Ke(){try{return window.sessionStorage.getItem(O)}catch{return null}}function Me({children:e}){const r=y(),[s,a]=o.useState(()=>{const d=Ke();return q(d),d}),n=o.useCallback(()=>{q(null),a(null),r.clear();try{window.sessionStorage.removeItem(O)}catch{}},[r]),l=o.useCallback(d=>{const m=d.trim();q(m),r.clear(),a(m);try{window.sessionStorage.setItem(O,m)}catch{}},[r]),f=o.useCallback(d=>{const m=d.trim();q(m),a(m);try{window.sessionStorage.setItem(O,m)}catch{}},[]);o.useEffect(()=>(ne(n),()=>ne(null)),[n]);const c=o.useMemo(()=>({masterKey:s,isAuthenticated:s!=null,login:l,replaceMasterKey:f,logout:n}),[s,l,f,n]);return t.jsx(de.Provider,{value:c,children:e})}function W(){const e=o.useContext(de);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ue(e){return e instanceof E&&e.status===0}function Be(){const e=y(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ue(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function $e(){return Be()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",F="pricing",me="settings",fe="tool-settings",G="aliases",J="discoverable",Y="providers",X="provider-health",he="stored-providers",ze="model-metadata",Qe="build",T="keys",_="budgets",xe="users",Z="usage",Ve=6e4,ae=60*6e4;function Ft(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function He(){return v({queryKey:[Qe],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Ve,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Kt(){return v({queryKey:[J],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[Y],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Ut(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Bt(){return v({queryKey:[X],queryFn:()=>i("/v1/providers/health"),staleTime:ae,refetchInterval:ae})}function $t(){const e=y();return x({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([X],r)})}function zt(){return v({queryKey:[he],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function K(e){e.invalidateQueries({queryKey:[he]}),e.invalidateQueries({queryKey:[Y]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]}),e.invalidateQueries({queryKey:[X]})}function Qt(){const e=y();return x({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>K(e)})}function Vt(){const e=y();return x({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>K(e)})}function Ht(){const e=y();return x({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>K(e)})}function Wt(){const e=y();return x({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>K(e)})}function Gt(){return x({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Jt(){return x({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Yt(){return v({queryKey:[ze],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Xt(){return v({queryKey:[G],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Zt(){const e=y();return x({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function er(){const e=y();return x({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function We(){return v({queryKey:[me],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function Ge(){const e=y();return x({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([me],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]})}})}function tr(){return x({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function rr(){return v({queryKey:[fe],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function sr(){const e=y();return x({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([fe],r)}})}function nr(){return x({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const M=1e3,Je=100;async function Ye(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function or(){const e=y();return x({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){return x({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function cr(){const e=y();return x({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[Y]})}})}function ur(){return x({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const U=1e3,Xe=100;async function Ze(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const B=1e3,et=100;async function tt(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function gr(){const e=y();return x({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=y();return x({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const $=1e3,rt=100;async function st(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>ee(e)})}function Sr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>ee(e)})}function kr(){const e=y();return x({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{ee(e),e.invalidateQueries({queryKey:[T]})}})}function te(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Pr(e,r,s){return v({queryKey:[Z,"list",e,r,s],queryFn:()=>{const a=te(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:H,staleTime:1e4})}function Er(e){return v({queryKey:[Z,"count",e],queryFn:()=>i(`/v1/usage/count?${te(e).toString()}`),placeholderData:H,staleTime:1e4})}function Nr(e,r,s=!0){return v({queryKey:[Z,"summary",e,r],queryFn:()=>{const a=te(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:H,staleTime:3e4})}function Cr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Tr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function _r(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ar(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${nt[s]} ${r[1]}`}const at=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ir(e){return at.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function it(e){return`${(e*100).toFixed(1)}%`}function qr(e,r){return r===void 0||r===0?null:(e-r)/r}function Rr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),f=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,d="second";for(const[p,g]of f){if(d=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",it(Math.abs(e))," vs prev"]})}function ot(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function lt({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:ot(e)}):null}function ct({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Fr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Kr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ut="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:f,disabled:c}){const d=o.useId(),m=e??(r?d:void 0),p=t.jsx("select",{id:m,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ut,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):f});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:m,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Ur({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:f=!1}){const c=h=>{var u;return((u=a.find(j=>j.value===h))==null?void 0:u.label)??h},[d,m]=o.useState(()=>c(r));o.useEffect(()=>{m(c(r))},[r]);const p=d.trim().toLowerCase(),g=a.filter(h=>!p||h.value.toLowerCase().includes(p)||h.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(L.Root,{allowsEmptyCollection:!0,allowsCustomValue:f,menuTrigger:"focus",inputValue:d,onInputChange:h=>{m(h),f?s(h.trim()):h.trim()===""&&s("")},onSelectionChange:h=>{h!=null&&s(String(h))},className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(L.InputGroup,{children:[t.jsx(ue,{placeholder:n,autoComplete:"off",onFocus:h=>h.currentTarget.select()}),t.jsx(L.Trigger,{})]}),t.jsx(L.Popover,{children:t.jsx(Ae,{items:g,className:"max-h-72 overflow-auto",children:h=>t.jsx(Ie,{id:h.value,textValue:h.label,children:h.label})})})]})}function dt(){var l;const e=We(),r=Ge(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(ct,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function mt(){const{data:e}=He(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function ft(){const e=mt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const ye=200,ve=480,z=240,ht=60,ge="otari.dashboard.sidebarWidth",pe="otari.dashboard.sidebarCollapsed",oe=16,D=e=>Math.min(ve,Math.max(ye,e));function xt(){if(typeof window>"u")return z;try{const e=window.localStorage.getItem(ge),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?z:D(r)}catch{return z}}function yt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pe)==="1"}catch{return!1}}const vt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],gt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function pt(){const{logout:e}=W(),r=o.useRef(null),[s,a]=o.useState(xt),[n,l]=o.useState(yt),[f,c]=o.useState(!1);o.useEffect(()=>{const u=window.setTimeout(()=>{try{window.localStorage.setItem(ge,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(u)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(pe,n?"1":"0")}catch{}},[n]);const d=o.useCallback(u=>{u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),c(!0)},[]),m=o.useCallback(u=>{var A;if(!u.currentTarget.hasPointerCapture(u.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(D(u.clientX-j))},[]),p=o.useCallback(u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId),c(!1)},[]),g=o.useCallback(u=>{u.key==="ArrowLeft"?(u.preventDefault(),a(j=>D(j-oe))):u.key==="ArrowRight"&&(u.preventDefault(),a(j=>D(j+oe)))},[]),h=n?ht:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(ft,{}),t.jsx($e,{}),t.jsx(dt,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:h},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!f&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(u=>!u),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:vt.map((u,j)=>{const A=gt.filter(k=>k.section===u.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&u.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:u.label}):null,j>0&&(n||!u.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(le,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:je})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",je?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},u.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":ye,"aria-valuemax":ve,tabIndex:0,onPointerDown:d,onPointerMove:m,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Ne,{})})})]})]})}function bt(){const{login:e}=W(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,f]=o.useState(!1),c=async()=>{const d=r.trim();if(!(!d||l)){f(!0),n(null);try{await Fe(d)?e(d):n(new Error("Invalid master key."))}catch(m){n(m)}finally{f(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(I,{className:"w-full max-w-md",children:t.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:d=>{d.preventDefault(),c()},children:[t.jsxs(Le,{value:r,onChange:d=>{s(d),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(ue,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(lt,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is held only in this browser tab (session storage) and sent directly to this gateway."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(qe,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const jt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-C0gVlZW-.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-mAjq9eh5.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-Us4jYLgv.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-BhG598Pa.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DaewNAhO.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Et=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BYSSsHzo.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,3,4]))).OverviewIndex})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-swJiAs79.js");return{ProvidersPage:e}},__vite__mapDeps([12,1,2,6,4,3]))).ProvidersPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-BNeqLlOB.js");return{SettingsPage:e}},__vite__mapDeps([13,1,2,4]))).SettingsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-ChC-YhRl.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([14,1,2,4]))).ToolsGuardrailsPage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-BVzIiui8.js");return{UsagePage:e}},__vite__mapDeps([15,1,2,3,4]))).UsagePage})),At=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-BxkuFQkF.js");return{UsersPage:e}},__vite__mapDeps([16,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function It(){const{isAuthenticated:e}=W();return e?t.jsx(Ce,{children:t.jsx(Te,{children:t.jsxs(b,{element:t.jsx(pt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(At,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"*",element:t.jsx(_e,{to:"/",replace:!0})})]})})}):t.jsx(bt,{})}function Lt({children:e}){const[r]=o.useState(()=>new ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Pe,{client:r,children:t.jsx(Me,{children:e})})}const be=document.getElementById("root");if(!be)throw new Error("Root element #root not found");Re.createRoot(be).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(It,{})})}));export{Jt as $,Ar as A,We as B,Kr as C,Tr as D,lt as E,Mr as F,ir as G,or as H,ct as I,Mt as J,Bt as K,qr as L,Ir as M,Dr as N,Lr as O,Fr as P,it as Q,Rr as R,Or as S,zt as T,Ht as U,Gt as V,Ge as W,Vt as X,$t as Y,Ut as Z,Qt as _,Pr as a,lr as a0,cr as a1,ur as a2,tr as a3,W as a4,Wt as a5,rr as a6,sr as a7,nr as a8,kr as a9,wr as aa,Er as b,Nr as c,Ur as d,Kt as e,Xt as f,er as g,ot as h,Zt as i,yr as j,gr as k,pr as l,br as m,Sr as n,vr as o,dr as p,fr as q,hr as r,xr as s,mr as t,jr as u,Ft as v,ar as w,Yt as x,_r as y,Cr as z}; diff --git a/src/gateway/static/dashboard/assets/index-D1FfVwkg.js b/src/gateway/static/dashboard/assets/index-D1FfVwkg.js new file mode 100644 index 00000000..86d60c14 --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-D1FfVwkg.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-Dm6r6wPy.js","assets/tanstack-query-W9y7rsMr.js","assets/react-q-ooZ0ti.js","assets/Table-DEsIhjZo.js","assets/heroui-CewI8xK4.js","assets/AliasesPage-AOThQmDL.js","assets/Field-gj3-ox4q.js","assets/BudgetsPage-o3Sj5U5B.js","assets/KeysPage-CbUCEimJ.js","assets/ModelScopeControl-Bpbo36Ko.js","assets/ModelsPage-WLlH9ed9.js","assets/OverviewPage-DXIwdDWG.js","assets/ProvidersPage-Bz-mLWy0.js","assets/SettingsPage-BzPdd2gR.js","assets/ToolsGuardrailsPage-qp13etCg.js","assets/UsagePage-DU8IagMv.js","assets/UsersPage-DjQ_32XA.js"])))=>i.map(i=>d[i]); +var be=Object.defineProperty;var je=(e,r,s)=>r in e?be(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var ee=(e,r,s)=>je(e,typeof r!="symbol"?r+"":r,s);import{u as f,j as t,a as v,b as h,k as Q,Q as we,c as Se}from"./tanstack-query-W9y7rsMr.js";import{d as ke,r as o,N as ie,O as Pe,H as Ee,R as Ne,e as b,f as Ce}from"./react-q-ooZ0ti.js";import{C as I,L as oe,I as le,a as Te,b as _e,B as P,c as L,d as C,T as Ae,e as Le}from"./heroui-CewI8xK4.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Ie=ke();const qe="modulepreload",Re=function(e){return"/"+e},te={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let m=function(y){return Promise.all(y.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),x=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=m(s.map(y=>{if(y=Re(y),y in te)return;te[y]=!0;const p=y.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${g}`))return;const d=document.createElement("link");if(d.rel=p?"stylesheet":qe,p||(d.as="script"),d.crossOrigin="",d.href=y,x&&d.setAttribute("nonce",x),document.head.appendChild(d),p)return new Promise((u,j)=>{d.addEventListener("load",u),d.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return n.then(m=>{for(const c of m||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);ee(this,"status");this.name="ApiError",this.status=s}}let q=null;function re(e){q=e}async function $(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Oe(e){let r;try{r=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await $(r));return!0}async function De(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json");let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw q==null||q(),new E(a.status,await $(a));if(!a.ok)throw new E(a.status,await $(a));if(a.status!==204)return await a.json()}const z="otari.dashboard.hasSession",ce=o.createContext(null);function Fe(){try{return window.localStorage.getItem(z)==="1"}catch{return!1}}function Me({children:e}){const r=f(),[s,a]=o.useState(Fe),n=o.useCallback(()=>{De(),a(!1),r.clear();try{window.localStorage.removeItem(z)}catch{}},[r]),l=o.useCallback(()=>{r.clear(),a(!0);try{window.localStorage.setItem(z,"1")}catch{}},[r]);o.useEffect(()=>(re(n),()=>re(null)),[n]);const m=o.useMemo(()=>({isAuthenticated:s,login:l,logout:n}),[s,l,n]);return t.jsx(ce.Provider,{value:m,children:e})}function V(){const e=o.useContext(ce);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ke(e){return e instanceof E&&e.status===0}function Ue(){const e=f(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ke(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function Be(){return Ue()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",O="pricing",ue="settings",de="tool-settings",H="aliases",W="discoverable",G="providers",J="provider-health",me="stored-providers",$e="model-metadata",ze="build",T="keys",_="budgets",he="users",Y="usage",Qe=6e4,se=60*6e4;function Dt(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function Ve(){return v({queryKey:[ze],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Qe,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Ft(){return v({queryKey:[W],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[G],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Kt(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Ut(){return v({queryKey:[J],queryFn:()=>i("/v1/providers/health"),staleTime:se,refetchInterval:se})}function Bt(){const e=f();return h({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([J],r)})}function $t(){return v({queryKey:[me],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function D(e){e.invalidateQueries({queryKey:[me]}),e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]}),e.invalidateQueries({queryKey:[J]})}function zt(){const e=f();return h({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>D(e)})}function Qt(){const e=f();return h({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>D(e)})}function Vt(){const e=f();return h({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>D(e)})}function Ht(){const e=f();return h({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>D(e)})}function Wt(){return h({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Gt(){return h({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Jt(){return v({queryKey:[$e],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Yt(){return v({queryKey:[H],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Xt(){const e=f();return h({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function Zt(){const e=f();return h({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function He(){return v({queryKey:[ue],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function We(){const e=f();return h({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([ue],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]})}})}function er(){return h({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function tr(){return v({queryKey:[de],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function rr(){const e=f();return h({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([de],r)}})}function sr(){return h({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const F=1e3,Ge=100;async function Je(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function ir(){const e=f();return h({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function or(){return h({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function lr(){const e=f();return h({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[G]})}})}function cr(){return h({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const M=1e3,Ye=100;async function Xe(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function mr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=f();return h({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=f();return h({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const K=1e3,Ze=100;async function et(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function vr(){const e=f();return h({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function gr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=f();return h({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const U=1e3,tt=100;async function rt(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>X(e)})}function wr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>X(e)})}function Sr(){const e=f();return h({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:[T]})}})}function Z(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function kr(e,r,s){return v({queryKey:[Y,"list",e,r,s],queryFn:()=>{const a=Z(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:Q,staleTime:1e4})}function Pr(e){return v({queryKey:[Y,"count",e],queryFn:()=>i(`/v1/usage/count?${Z(e).toString()}`),placeholderData:Q,staleTime:1e4})}function Er(e,r,s=!0){return v({queryKey:[Y,"summary",e,r],queryFn:()=>{const a=Z(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:Q,staleTime:3e4})}function Nr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Cr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function Tr(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _r(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${st[s]} ${r[1]}`}const nt=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ar(e){return nt.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function at(e){return`${(e*100).toFixed(1)}%`}function Ir(e,r){return r===void 0||r===0?null:(e-r)/r}function qr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),m=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,x="second";for(const[p,g]of m){if(x=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",at(Math.abs(e))," vs prev"]})}function it(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function ot({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:it(e)}):null}function lt({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Dr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Fr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ct="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:m,disabled:c}){const x=o.useId(),y=e??(r?x:void 0),p=t.jsx("select",{id:y,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ct,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):m});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Kr({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:m=!1}){const c=d=>{var u;return((u=a.find(j=>j.value===d))==null?void 0:u.label)??d},[x,y]=o.useState(()=>c(r));o.useEffect(()=>{y(c(r))},[r]);const p=x.trim().toLowerCase(),g=a.filter(d=>!p||d.value.toLowerCase().includes(p)||d.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(I.Root,{allowsEmptyCollection:!0,allowsCustomValue:m,menuTrigger:"focus",inputValue:x,onInputChange:d=>{y(d),m?s(d.trim()):d.trim()===""&&s("")},onSelectionChange:d=>{d!=null&&s(String(d))},className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(I.InputGroup,{children:[t.jsx(le,{placeholder:n,autoComplete:"off",onFocus:d=>d.currentTarget.select()}),t.jsx(I.Trigger,{})]}),t.jsx(I.Popover,{children:t.jsx(Te,{items:g,className:"max-h-72 overflow-auto",children:d=>t.jsx(_e,{id:d.value,textValue:d.label,children:d.label})})})]})}function ut(){var l;const e=He(),r=We(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(lt,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function dt(){const{data:e}=Ve(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function mt(){const e=dt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const fe=200,xe=480,B=240,ht=60,ye="otari.dashboard.sidebarWidth",ve="otari.dashboard.sidebarCollapsed",ae=16,R=e=>Math.min(xe,Math.max(fe,e));function ft(){if(typeof window>"u")return B;try{const e=window.localStorage.getItem(ye),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?B:R(r)}catch{return B}}function xt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ve)==="1"}catch{return!1}}const yt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],vt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function gt(){const{logout:e}=V(),r=o.useRef(null),[s,a]=o.useState(ft),[n,l]=o.useState(xt),[m,c]=o.useState(!1);o.useEffect(()=>{const u=window.setTimeout(()=>{try{window.localStorage.setItem(ye,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(u)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(ve,n?"1":"0")}catch{}},[n]);const x=o.useCallback(u=>{u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),c(!0)},[]),y=o.useCallback(u=>{var A;if(!u.currentTarget.hasPointerCapture(u.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(R(u.clientX-j))},[]),p=o.useCallback(u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId),c(!1)},[]),g=o.useCallback(u=>{u.key==="ArrowLeft"?(u.preventDefault(),a(j=>R(j-ae))):u.key==="ArrowRight"&&(u.preventDefault(),a(j=>R(j+ae)))},[]),d=n?ht:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",m&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(mt,{}),t.jsx(Be,{}),t.jsx(ut,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:d},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!m&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(u=>!u),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:yt.map((u,j)=>{const A=vt.filter(k=>k.section===u.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&u.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:u.label}):null,j>0&&(n||!u.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(ie,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:pe})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",pe?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},u.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":fe,"aria-valuemax":xe,tabIndex:0,onPointerDown:x,onPointerMove:y,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",m?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Pe,{})})})]})]})}function pt(){const{login:e}=V(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,m]=o.useState(!1),c=async()=>{const x=r.trim();if(!(!x||l)){m(!0),n(null);try{await Oe(x)?e():n(new Error("Invalid master key."))}catch(y){n(y)}finally{m(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(L,{className:"w-full max-w-md",children:t.jsxs(L.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:x=>{x.preventDefault(),c()},children:[t.jsxs(Ae,{value:r,onChange:x=>{s(x),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(le,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(ot,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(Le,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const bt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-Dm6r6wPy.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),jt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-AOThQmDL.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-o3Sj5U5B.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-CbUCEimJ.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-WLlH9ed9.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-DXIwdDWG.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,3,4]))).OverviewIndex})),Et=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-Bz-mLWy0.js");return{ProvidersPage:e}},__vite__mapDeps([12,1,2,6,4,3]))).ProvidersPage})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-BzPdd2gR.js");return{SettingsPage:e}},__vite__mapDeps([13,1,2,4]))).SettingsPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-qp13etCg.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([14,1,2,4]))).ToolsGuardrailsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-DU8IagMv.js");return{UsagePage:e}},__vite__mapDeps([15,1,2,3,4]))).UsagePage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-DjQ_32XA.js");return{UsersPage:e}},__vite__mapDeps([16,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function At(){const{isAuthenticated:e}=V();return e?t.jsx(Ee,{children:t.jsx(Ne,{children:t.jsxs(b,{element:t.jsx(gt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(bt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"*",element:t.jsx(Ce,{to:"/",replace:!0})})]})})}):t.jsx(pt,{})}function Lt({children:e}){const[r]=o.useState(()=>new we({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Se,{client:r,children:t.jsx(Me,{children:e})})}const ge=document.getElementById("root");if(!ge)throw new Error("Root element #root not found");Ie.createRoot(ge).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(At,{})})}));export{Gt as $,_r as A,He as B,Fr as C,Cr as D,ot as E,Mr as F,ar as G,ir as H,lt as I,Mt as J,Ut as K,Ir as L,Ar as M,Or as N,Lr as O,Dr as P,at as Q,qr as R,Rr as S,$t as T,Vt as U,Wt as V,We as W,Qt as X,Bt as Y,Kt as Z,zt as _,kr as a,or as a0,lr as a1,cr as a2,er as a3,Ht as a4,tr as a5,rr as a6,sr as a7,Sr as a8,jr as a9,Pr as b,Er as c,Kr as d,Ft as e,Yt as f,Zt as g,it as h,Xt as i,xr as j,vr as k,gr as l,pr as m,wr as n,yr as o,ur as p,mr as q,hr as r,fr as s,dr as t,br as u,Dt as v,nr as w,Jt as x,Tr as y,Nr as z}; diff --git a/src/gateway/static/dashboard/assets/index-D6YDX-oj.js b/src/gateway/static/dashboard/assets/index-D6YDX-oj.js new file mode 100644 index 00000000..73fb376a --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-D6YDX-oj.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BS_KZH0z.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/Table-CLdjdyTx.js","assets/heroui-BX6JwHY-.js","assets/AliasesPage-O7ZGijD-.js","assets/Field-HzRk1KDP.js","assets/BudgetsPage-9zpV4nTH.js","assets/KeysPage-DAGeWeBS.js","assets/ModelScopeControl-CxWug9wa.js","assets/ModelsPage-DI7qj4qI.js","assets/OverviewPage-BHX_G4X9.js","assets/charts-Cr3Dij9t.js","assets/recharts-CR3TAEof.js","assets/ProvidersPage-BJkEklg1.js","assets/SettingsPage-CLdo7bKV.js","assets/ToolsGuardrailsPage-OKm-s8Wi.js","assets/UsagePage-DLrkG3qL.js","assets/UsersPage-CNthhRRV.js"])))=>i.map(i=>d[i]); +var we=Object.defineProperty;var Se=(e,r,s)=>r in e?we(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var re=(e,r,s)=>Se(e,typeof r!="symbol"?r+"":r,s);import{u as y,j as t,a as v,b as x,k as H,Q as ke,c as Pe}from"./tanstack-query-1t81HyiD.js";import{d as Ee,r as o,N as le,O as Ne,H as Ce,e as Te,f as b,h as _e}from"./react-dgEcD0HR.js";import{C as L,L as ce,I as ue,a as Ae,b as Ie,B as P,d as I,c as C,T as Le,e as qe}from"./heroui-BX6JwHY-.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Re=Ee();const Oe="modulepreload",De=function(e){return"/"+e},se={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let m=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=m(s.map(u=>{if(u=De(u),u in se)return;se[u]=!0;const p=u.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${g}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":Oe,p||(f.as="script"),f.crossOrigin="",f.href=u,h&&f.setAttribute("nonce",h),document.head.appendChild(f),p)return new Promise((d,j)=>{f.addEventListener("load",d),f.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return n.then(m=>{for(const c of m||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);re(this,"status");this.name="ApiError",this.status=s}}let R=null;function ne(e){R=e}let Q=null;function q(e){Q=e}async function V(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Fe(e){let r;try{r=await fetch("/v1/settings",{headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await V(r));return!0}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),Q&&s.set("Authorization",`Bearer ${Q}`);let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw R==null||R(),new E(a.status,await V(a));if(!a.ok)throw new E(a.status,await V(a));if(a.status!==204)return await a.json()}const O="otari.dashboard.masterKey",de=o.createContext(null);function Ke(){try{return window.sessionStorage.getItem(O)}catch{return null}}function Me({children:e}){const r=y(),[s,a]=o.useState(()=>{const h=Ke();return q(h),h}),n=o.useCallback(()=>{q(null),a(null),r.clear();try{window.sessionStorage.removeItem(O)}catch{}},[r]),l=o.useCallback(h=>{const u=h.trim();q(u),r.clear(),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[r]),m=o.useCallback(h=>{const u=h.trim();q(u),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[]);o.useEffect(()=>(ne(n),()=>ne(null)),[n]);const c=o.useMemo(()=>({masterKey:s,isAuthenticated:s!=null,login:l,replaceMasterKey:m,logout:n}),[s,l,m,n]);return t.jsx(de.Provider,{value:c,children:e})}function W(){const e=o.useContext(de);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ue(e){return e instanceof E&&e.status===0}function Be(){const e=y(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ue(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function $e(){return Be()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",F="pricing",me="settings",he="tool-settings",G="aliases",J="discoverable",Y="providers",X="provider-health",fe="stored-providers",ze="model-metadata",Qe="build",T="keys",_="budgets",xe="users",Z="usage",Ve=6e4,ae=60*6e4;function Ft(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function He(){return v({queryKey:[Qe],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Ve,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Kt(){return v({queryKey:[J],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[Y],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Ut(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Bt(){return v({queryKey:[X],queryFn:()=>i("/v1/providers/health"),staleTime:ae,refetchInterval:ae})}function $t(){const e=y();return x({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([X],r)})}function zt(){return v({queryKey:[fe],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function K(e){e.invalidateQueries({queryKey:[fe]}),e.invalidateQueries({queryKey:[Y]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]}),e.invalidateQueries({queryKey:[X]})}function Qt(){const e=y();return x({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>K(e)})}function Vt(){const e=y();return x({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>K(e)})}function Ht(){const e=y();return x({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>K(e)})}function Wt(){const e=y();return x({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>K(e)})}function Gt(){return x({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Jt(){return x({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Yt(){return v({queryKey:[ze],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Xt(){return v({queryKey:[G],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Zt(){const e=y();return x({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function er(){const e=y();return x({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function We(){return v({queryKey:[me],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function Ge(){const e=y();return x({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([me],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]})}})}function tr(){return x({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function rr(){return v({queryKey:[he],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function sr(){const e=y();return x({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([he],r)}})}function nr(){return x({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const M=1e3,Je=100;async function Ye(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function or(){const e=y();return x({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){return x({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function cr(){const e=y();return x({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[Y]})}})}function ur(){return x({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const U=1e3,Xe=100;async function Ze(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const B=1e3,et=100;async function tt(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function gr(){const e=y();return x({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=y();return x({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const $=1e3,rt=100;async function st(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>ee(e)})}function Sr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>ee(e)})}function kr(){const e=y();return x({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{ee(e),e.invalidateQueries({queryKey:[T]})}})}function te(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Pr(e,r,s){return v({queryKey:[Z,"list",e,r,s],queryFn:()=>{const a=te(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:H,staleTime:1e4})}function Er(e){return v({queryKey:[Z,"count",e],queryFn:()=>i(`/v1/usage/count?${te(e).toString()}`),placeholderData:H,staleTime:1e4})}function Nr(e,r,s=!0){return v({queryKey:[Z,"summary",e,r],queryFn:()=>{const a=te(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:H,staleTime:3e4})}function Cr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Tr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function _r(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ar(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${nt[s]} ${r[1]}`}const at=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ir(e){return at.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function it(e){return`${(e*100).toFixed(1)}%`}function qr(e,r){return r===void 0||r===0?null:(e-r)/r}function Rr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),m=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,h="second";for(const[p,g]of m){if(h=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",it(Math.abs(e))," vs prev"]})}function ot(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function lt({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:ot(e)}):null}function ct({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Fr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Kr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ut="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:m,disabled:c}){const h=o.useId(),u=e??(r?h:void 0),p=t.jsx("select",{id:u,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ut,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):m});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Ur({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:m=!1}){const c=f=>{var d;return((d=a.find(j=>j.value===f))==null?void 0:d.label)??f},[h,u]=o.useState(()=>c(r));o.useEffect(()=>{u(c(r))},[r]);const p=h.trim().toLowerCase(),g=a.filter(f=>!p||f.value.toLowerCase().includes(p)||f.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(L.Root,{allowsEmptyCollection:!0,allowsCustomValue:m,menuTrigger:"focus",inputValue:h,onInputChange:f=>{u(f),m?s(f.trim()):f.trim()===""&&s("")},onSelectionChange:f=>{f!=null&&s(String(f))},className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(L.InputGroup,{children:[t.jsx(ue,{placeholder:n,autoComplete:"off",onFocus:f=>f.currentTarget.select()}),t.jsx(L.Trigger,{})]}),t.jsx(L.Popover,{children:t.jsx(Ae,{items:g,className:"max-h-72 overflow-auto",children:f=>t.jsx(Ie,{id:f.value,textValue:f.label,children:f.label})})})]})}function dt(){var l;const e=We(),r=Ge(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(ct,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function mt(){const{data:e}=He(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function ht(){const e=mt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const ye=200,ve=480,z=240,ft=60,ge="otari.dashboard.sidebarWidth",pe="otari.dashboard.sidebarCollapsed",oe=16,D=e=>Math.min(ve,Math.max(ye,e));function xt(){if(typeof window>"u")return z;try{const e=window.localStorage.getItem(ge),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?z:D(r)}catch{return z}}function yt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pe)==="1"}catch{return!1}}const vt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],gt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function pt(){const{logout:e}=W(),r=o.useRef(null),[s,a]=o.useState(xt),[n,l]=o.useState(yt),[m,c]=o.useState(!1);o.useEffect(()=>{const d=window.setTimeout(()=>{try{window.localStorage.setItem(ge,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(d)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(pe,n?"1":"0")}catch{}},[n]);const h=o.useCallback(d=>{d.preventDefault(),d.currentTarget.setPointerCapture(d.pointerId),c(!0)},[]),u=o.useCallback(d=>{var A;if(!d.currentTarget.hasPointerCapture(d.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(D(d.clientX-j))},[]),p=o.useCallback(d=>{d.currentTarget.hasPointerCapture(d.pointerId)&&d.currentTarget.releasePointerCapture(d.pointerId),c(!1)},[]),g=o.useCallback(d=>{d.key==="ArrowLeft"?(d.preventDefault(),a(j=>D(j-oe))):d.key==="ArrowRight"&&(d.preventDefault(),a(j=>D(j+oe)))},[]),f=n?ft:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",m&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(ht,{}),t.jsx($e,{}),t.jsx(dt,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:f},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!m&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(d=>!d),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:vt.map((d,j)=>{const A=gt.filter(k=>k.section===d.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&d.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:d.label}):null,j>0&&(n||!d.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(le,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:je})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",je?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},d.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":ye,"aria-valuemax":ve,tabIndex:0,onPointerDown:h,onPointerMove:u,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",m?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Ne,{})})})]})]})}function bt(){const{login:e}=W(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,m]=o.useState(!1),c=async()=>{const h=r.trim();if(!(!h||l)){m(!0),n(null);try{await Fe(h)?e(h):n(new Error("Invalid master key."))}catch(u){n(u)}finally{m(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(I,{className:"w-full max-w-md",children:t.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:h=>{h.preventDefault(),c()},children:[t.jsxs(Le,{value:r,onChange:h=>{s(h),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(ue,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(lt,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is held only in this browser tab (session storage) and sent directly to this gateway."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(qe,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const jt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BS_KZH0z.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-O7ZGijD-.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-9zpV4nTH.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-DAGeWeBS.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DI7qj4qI.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Et=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BHX_G4X9.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,12,13,4,3]))).OverviewIndex})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-BJkEklg1.js");return{ProvidersPage:e}},__vite__mapDeps([14,1,2,6,4,3]))).ProvidersPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CLdo7bKV.js");return{SettingsPage:e}},__vite__mapDeps([15,1,2,4]))).SettingsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-OKm-s8Wi.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([16,1,2,4]))).ToolsGuardrailsPage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-DLrkG3qL.js");return{UsagePage:e}},__vite__mapDeps([17,1,2,12,13,4,3]))).UsagePage})),At=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-CNthhRRV.js");return{UsersPage:e}},__vite__mapDeps([18,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function It(){const{isAuthenticated:e}=W();return e?t.jsx(Ce,{children:t.jsx(Te,{children:t.jsxs(b,{element:t.jsx(pt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(At,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"*",element:t.jsx(_e,{to:"/",replace:!0})})]})})}):t.jsx(bt,{})}function Lt({children:e}){const[r]=o.useState(()=>new ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Pe,{client:r,children:t.jsx(Me,{children:e})})}const be=document.getElementById("root");if(!be)throw new Error("Root element #root not found");Re.createRoot(be).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(It,{})})}));export{lr as $,Ar as A,We as B,Kr as C,Tr as D,lt as E,Mr as F,ir as G,or as H,ct as I,Mt as J,Bt as K,qr as L,Ir as M,Dr as N,it as O,Fr as P,Rr as Q,zt as R,Or as S,Ht as T,Gt as U,Ge as V,Vt as W,$t as X,Ut as Y,Qt as Z,Jt as _,Pr as a,cr as a0,ur as a1,tr as a2,W as a3,Wt as a4,rr as a5,sr as a6,nr as a7,Lr as a8,kr as a9,wr as aa,Er as b,Nr as c,Ur as d,Kt as e,Xt as f,er as g,ot as h,Zt as i,yr as j,gr as k,pr as l,br as m,Sr as n,vr as o,dr as p,hr as q,fr as r,xr as s,mr as t,jr as u,Ft as v,ar as w,Yt as x,_r as y,Cr as z}; diff --git a/src/gateway/static/dashboard/assets/index-DFtD8NLS.css b/src/gateway/static/dashboard/assets/index-DFtD8NLS.css new file mode 100644 index 00000000..6a095ba3 --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-DFtD8NLS.css @@ -0,0 +1 @@ +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\]{background-color:var(--otari-brand)}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-\[var\(--otari-brand\)\]{fill:var(--otari-brand)}.fill-\[var\(--otari-muted\)\]{fill:var(--otari-muted)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:w-0\.5:is(:where(.group):hover *){width:calc(var(--spacing) * .5)}.group-hover\:bg-\[var\(--otari-brand\)\]:is(:where(.group):hover *){background-color:var(--otari-brand)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover{background-color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:-2px}.focus-visible\:outline-\[var\(--otari-brand\)\]:focus-visible{outline-color:var(--otari-brand)}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/index-Dl_VAUga.css b/src/gateway/static/dashboard/assets/index-Dl_VAUga.css new file mode 100644 index 00000000..4eab1b93 --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-Dl_VAUga.css @@ -0,0 +1 @@ +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\]{background-color:var(--otari-brand)}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-\[var\(--otari-brand\)\]{fill:var(--otari-brand)}.fill-\[var\(--otari-muted\)\]{fill:var(--otari-muted)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:w-0\.5:is(:where(.group):hover *){width:calc(var(--spacing) * .5)}.group-hover\:bg-\[var\(--otari-brand\)\]:is(:where(.group):hover *){background-color:var(--otari-brand)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover{background-color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:-2px}.focus-visible\:outline-\[var\(--otari-brand\)\]:focus-visible{outline-color:var(--otari-brand)}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js b/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js new file mode 100644 index 00000000..efce07b7 --- /dev/null +++ b/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js @@ -0,0 +1,52 @@ +function od(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var _c={exports:{}},k={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wh;function ev(){if(Wh)return k;Wh=1;var f=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.iterator;function Z(g){return g===null||typeof g!="object"?null:(g=B&&g[B]||g["@@iterator"],typeof g=="function"?g:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,L={};function q(g,H,Y){this.props=g,this.context=H,this.refs=L,this.updater=Y||V}q.prototype.isReactComponent={},q.prototype.setState=function(g,H){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,H,"setState")},q.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function W(){}W.prototype=q.prototype;function w(g,H,Y){this.props=g,this.context=H,this.refs=L,this.updater=Y||V}var mt=w.prototype=new W;mt.constructor=w,G(mt,q.prototype),mt.isPureReactComponent=!0;var st=Array.isArray;function Et(){}var F={H:null,A:null,T:null,S:null},Mt=Object.prototype.hasOwnProperty;function Kt(g,H,Y){var X=Y.ref;return{$$typeof:f,type:g,key:H,ref:X!==void 0?X:null,props:Y}}function Hl(g,H){return Kt(g.type,H,g.props)}function yl(g){return typeof g=="object"&&g!==null&&g.$$typeof===f}function Jt(g){var H={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(Y){return H[Y]})}var Bl=/\/+/g;function vl(g,H){return typeof g=="object"&&g!==null&&g.key!=null?Jt(""+g.key):H.toString(36)}function Nt(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(Et,Et):(g.status="pending",g.then(function(H){g.status==="pending"&&(g.status="fulfilled",g.value=H)},function(H){g.status==="pending"&&(g.status="rejected",g.reason=H)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function U(g,H,Y,X,I){var lt=typeof g;(lt==="undefined"||lt==="boolean")&&(g=null);var ot=!1;if(g===null)ot=!0;else switch(lt){case"bigint":case"string":case"number":ot=!0;break;case"object":switch(g.$$typeof){case f:case o:ot=!0;break;case D:return ot=g._init,U(ot(g._payload),H,Y,X,I)}}if(ot)return I=I(g),ot=X===""?"."+vl(g,0):X,st(I)?(Y="",ot!=null&&(Y=ot.replace(Bl,"$&/")+"/"),U(I,H,Y,"",function(xa){return xa})):I!=null&&(yl(I)&&(I=Hl(I,Y+(I.key==null||g&&g.key===I.key?"":(""+I.key).replace(Bl,"$&/")+"/")+ot)),H.push(I)),1;ot=0;var $t=X===""?".":X+":";if(st(g))for(var Dt=0;Dt>>1,pt=U[yt];if(0>>1;ytd(Y,$))Xd(I,Y)?(U[yt]=I,U[X]=$,yt=X):(U[yt]=Y,U[H]=$,yt=H);else if(Xd(I,$))U[yt]=I,U[X]=$,yt=X;else break t}}return x}function d(U,x){var $=U.sortIndex-x.sortIndex;return $!==0?$:U.id-x.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;f.unstable_now=function(){return v.now()}}else{var b=Date,O=b.now();f.unstable_now=function(){return b.now()-O}}var p=[],y=[],D=1,R=null,B=3,Z=!1,V=!1,G=!1,L=!1,q=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function mt(U){for(var x=s(y);x!==null;){if(x.callback===null)c(y);else if(x.startTime<=U)c(y),x.sortIndex=x.expirationTime,o(p,x);else break;x=s(y)}}function st(U){if(G=!1,mt(U),!V)if(s(p)!==null)V=!0,Et||(Et=!0,Jt());else{var x=s(y);x!==null&&Nt(st,x.startTime-U)}}var Et=!1,F=-1,Mt=5,Kt=-1;function Hl(){return L?!0:!(f.unstable_now()-KtU&&Hl());){var yt=R.callback;if(typeof yt=="function"){R.callback=null,B=R.priorityLevel;var pt=yt(R.expirationTime<=U);if(U=f.unstable_now(),typeof pt=="function"){R.callback=pt,mt(U),x=!0;break l}R===s(p)&&c(p),mt(U)}else c(p);R=s(p)}if(R!==null)x=!0;else{var g=s(y);g!==null&&Nt(st,g.startTime-U),x=!1}}break t}finally{R=null,B=$,Z=!1}x=void 0}}finally{x?Jt():Et=!1}}}var Jt;if(typeof w=="function")Jt=function(){w(yl)};else if(typeof MessageChannel<"u"){var Bl=new MessageChannel,vl=Bl.port2;Bl.port1.onmessage=yl,Jt=function(){vl.postMessage(null)}}else Jt=function(){q(yl,0)};function Nt(U,x){F=q(function(){U(f.unstable_now())},x)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(U){U.callback=null},f.unstable_forceFrameRate=function(U){0>U||125yt?(U.sortIndex=$,o(y,U),s(p)===null&&U===s(y)&&(G?(W(F),F=-1):G=!0,Nt(st,$-yt))):(U.sortIndex=pt,o(p,U),V||Z||(V=!0,Et||(Et=!0,Jt()))),U},f.unstable_shouldYield=Hl,f.unstable_wrapCallback=function(U){var x=B;return function(){var $=B;B=x;try{return U.apply(this,arguments)}finally{B=$}}}})(Dc)),Dc}var Ih;function uv(){return Ih||(Ih=1,Mc.exports=av()),Mc.exports}var Uc={exports:{}},wt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ph;function nv(){if(Ph)return wt;Ph=1;var f=Yc();function o(p){var y="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(o){console.error(o)}}return f(),Uc.exports=nv(),Uc.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ld;function iv(){if(ld)return Mu;ld=1;var f=uv(),o=Yc(),s=sd();function c(t){var l="https://react.dev/errors/"+t;if(1pt||(t.current=yt[pt],yt[pt]=null,pt--)}function Y(t,l){pt++,yt[pt]=t.current,t.current=l}var X=g(null),I=g(null),lt=g(null),ot=g(null);function $t(t,l){switch(Y(lt,l),Y(I,t),Y(X,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?Sh(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=Sh(l),t=ph(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(X),Y(X,t)}function Dt(){H(X),H(I),H(lt)}function xa(t){t.memoizedState!==null&&Y(ot,t);var l=X.current,e=ph(l,t.type);l!==e&&(Y(I,t),Y(X,e))}function Hu(t){I.current===t&&(H(X),H(I)),ot.current===t&&(H(ot),Au._currentValue=$)}var fi,wc;function De(t){if(fi===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);fi=l&&l[1]||"",wc=-1)":-1u||h[a]!==T[u]){var M=` +`+h[a].replace(" at new "," at ");return t.displayName&&M.includes("")&&(M=M.replace("",t.displayName)),M}while(1<=a&&0<=u);break}}}finally{ci=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?De(e):""}function Hd(t,l){switch(t.tag){case 26:case 27:case 5:return De(t.type);case 16:return De("Lazy");case 13:return t.child!==l&&l!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return ri(t.type,!1);case 11:return ri(t.type.render,!1);case 1:return ri(t.type,!0);case 31:return De("Activity");default:return""}}function $c(t){try{var l="",e=null;do l+=Hd(t,e),e=t,t=t.return;while(t);return l}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}var oi=Object.prototype.hasOwnProperty,si=f.unstable_scheduleCallback,hi=f.unstable_cancelCallback,Bd=f.unstable_shouldYield,xd=f.unstable_requestPaint,al=f.unstable_now,qd=f.unstable_getCurrentPriorityLevel,Wc=f.unstable_ImmediatePriority,Fc=f.unstable_UserBlockingPriority,Bu=f.unstable_NormalPriority,Yd=f.unstable_LowPriority,kc=f.unstable_IdlePriority,Ld=f.log,Gd=f.unstable_setDisableYieldValue,qa=null,ul=null;function ue(t){if(typeof Ld=="function"&&Gd(t),ul&&typeof ul.setStrictMode=="function")try{ul.setStrictMode(qa,t)}catch{}}var nl=Math.clz32?Math.clz32:Qd,jd=Math.log,Xd=Math.LN2;function Qd(t){return t>>>=0,t===0?32:31-(jd(t)/Xd|0)|0}var xu=256,qu=262144,Yu=4194304;function Ue(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Lu(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var u=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var r=a&134217727;return r!==0?(a=r&~n,a!==0?u=Ue(a):(i&=r,i!==0?u=Ue(i):e||(e=r&~t,e!==0&&(u=Ue(e))))):(r=a&~n,r!==0?u=Ue(r):i!==0?u=Ue(i):e||(e=a&~t,e!==0&&(u=Ue(e)))),u===0?0:l!==0&&l!==u&&(l&n)===0&&(n=u&-u,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:u}function Ya(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function Zd(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ic(){var t=Yu;return Yu<<=1,(Yu&62914560)===0&&(Yu=4194304),t}function di(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function La(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Vd(t,l,e,a,u,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var r=t.entanglements,h=t.expirationTimes,T=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Fd=/[\n"\\]/g;function Sl(t){return t.replace(Fd,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pi(t,l,e,a,u,n,i,r){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+gl(l)):t.value!==""+gl(l)&&(t.value=""+gl(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?bi(t,i,gl(l)):e!=null?bi(t,i,gl(e)):a!=null&&t.removeAttribute("value"),u==null&&n!=null&&(t.defaultChecked=!!n),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.name=""+gl(r):t.removeAttribute("name")}function sr(t,l,e,a,u,n,i,r){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){Si(t);return}e=e!=null?""+gl(e):"",l=l!=null?""+gl(l):e,r||l===t.value||(t.value=l),t.defaultValue=l}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=r?t.checked:!!a,t.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Si(t)}function bi(t,l,e){l==="number"&&Xu(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function ta(t,l,e,a){if(t=t.options,l){l={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ri=!1;if(Xl)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Ri=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Ri=!1}var ie=null,_i=null,Zu=null;function Sr(){if(Zu)return Zu;var t,l=_i,e=l.length,a,u="value"in ie?ie.value:ie.textContent,n=u.length;for(t=0;t=Ka),Ar=" ",Rr=!1;function _r(t,l){switch(t){case"keyup":return Am.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Or(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ua=!1;function _m(t,l){switch(t){case"compositionend":return Or(l);case"keypress":return l.which!==32?null:(Rr=!0,Ar);case"textInput":return t=l.data,t===Ar&&Rr?null:t;default:return null}}function Om(t,l){if(ua)return t==="compositionend"||!Ci&&_r(t,l)?(t=Sr(),Zu=_i=ie=null,ua=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=xr(e)}}function Yr(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?Yr(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function Lr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Xu(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Xu(t.document)}return l}function Bi(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var xm=Xl&&"documentMode"in document&&11>=document.documentMode,na=null,xi=null,Wa=null,qi=!1;function Gr(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;qi||na==null||na!==Xu(a)||(a=na,"selectionStart"in a&&Bi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Wa&&$a(Wa,a)||(Wa=a,a=Yn(xi,"onSelect"),0>=i,u-=i,xl=1<<32-nl(l)+u|e<tt?(nt=Q,Q=null):nt=Q.sibling;var ct=z(S,Q,E[tt],C);if(ct===null){Q===null&&(Q=nt);break}t&&Q&&ct.alternate===null&&l(S,Q),m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct,Q=nt}if(tt===E.length)return e(S,Q),it&&Zl(S,tt),K;if(Q===null){for(;tttt?(nt=Q,Q=null):nt=Q.sibling;var Me=z(S,Q,ct.value,C);if(Me===null){Q===null&&(Q=nt);break}t&&Q&&Me.alternate===null&&l(S,Q),m=n(Me,m,tt),ft===null?K=Me:ft.sibling=Me,ft=Me,Q=nt}if(ct.done)return e(S,Q),it&&Zl(S,tt),K;if(Q===null){for(;!ct.done;tt++,ct=E.next())ct=N(S,ct.value,C),ct!==null&&(m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct);return it&&Zl(S,tt),K}for(Q=a(Q);!ct.done;tt++,ct=E.next())ct=A(Q,S,tt,ct.value,C),ct!==null&&(t&&ct.alternate!==null&&Q.delete(ct.key===null?tt:ct.key),m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct);return t&&Q.forEach(function(lv){return l(S,lv)}),it&&Zl(S,tt),K}function St(S,m,E,C){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Z:t:{for(var K=E.key;m!==null;){if(m.key===K){if(K=E.type,K===G){if(m.tag===7){e(S,m.sibling),C=u(m,E.props.children),C.return=S,S=C;break t}}else if(m.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Mt&&Xe(K)===m.type){e(S,m.sibling),C=u(m,E.props),lu(C,E),C.return=S,S=C;break t}e(S,m);break}else l(S,m);m=m.sibling}E.type===G?(C=qe(E.props.children,S.mode,C,E.key),C.return=S,S=C):(C=Pu(E.type,E.key,E.props,null,S.mode,C),lu(C,E),C.return=S,S=C)}return i(S);case V:t:{for(K=E.key;m!==null;){if(m.key===K)if(m.tag===4&&m.stateNode.containerInfo===E.containerInfo&&m.stateNode.implementation===E.implementation){e(S,m.sibling),C=u(m,E.children||[]),C.return=S,S=C;break t}else{e(S,m);break}else l(S,m);m=m.sibling}C=Zi(E,S.mode,C),C.return=S,S=C}return i(S);case Mt:return E=Xe(E),St(S,m,E,C)}if(Nt(E))return j(S,m,E,C);if(Jt(E)){if(K=Jt(E),typeof K!="function")throw Error(c(150));return E=K.call(E),J(S,m,E,C)}if(typeof E.then=="function")return St(S,m,fn(E),C);if(E.$$typeof===w)return St(S,m,en(S,E),C);cn(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,m!==null&&m.tag===6?(e(S,m.sibling),C=u(m,E),C.return=S,S=C):(e(S,m),C=Qi(E,S.mode,C),C.return=S,S=C),i(S)):e(S,m)}return function(S,m,E,C){try{tu=0;var K=St(S,m,E,C);return va=null,K}catch(Q){if(Q===ya||Q===un)throw Q;var ft=fl(29,Q,null,S.mode);return ft.lanes=C,ft.return=S,ft}finally{}}}var Ze=co(!0),ro=co(!1),se=!1;function lf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ef(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function he(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function de(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(rt&2)!==0){var u=a.pending;return u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l,l=Iu(t),Jr(t,null,e),l}return ku(t,a,l,e),Iu(t)}function eu(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,tr(t,e)}}function af(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var u=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?u=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?u=n=l:n=n.next=l}else u=n=l;e={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var uf=!1;function au(){if(uf){var t=ma;if(t!==null)throw t}}function uu(t,l,e,a){uf=!1;var u=t.updateQueue;se=!1;var n=u.firstBaseUpdate,i=u.lastBaseUpdate,r=u.shared.pending;if(r!==null){u.shared.pending=null;var h=r,T=h.next;h.next=null,i===null?n=T:i.next=T,i=h;var M=t.alternate;M!==null&&(M=M.updateQueue,r=M.lastBaseUpdate,r!==i&&(r===null?M.firstBaseUpdate=T:r.next=T,M.lastBaseUpdate=h))}if(n!==null){var N=u.baseState;i=0,M=T=h=null,r=n;do{var z=r.lane&-536870913,A=z!==r.lane;if(A?(ut&z)===z:(a&z)===z){z!==0&&z===da&&(uf=!0),M!==null&&(M=M.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});t:{var j=t,J=r;z=l;var St=e;switch(J.tag){case 1:if(j=J.payload,typeof j=="function"){N=j.call(St,N,z);break t}N=j;break t;case 3:j.flags=j.flags&-65537|128;case 0:if(j=J.payload,z=typeof j=="function"?j.call(St,N,z):j,z==null)break t;N=R({},N,z);break t;case 2:se=!0}}z=r.callback,z!==null&&(t.flags|=64,A&&(t.flags|=8192),A=u.callbacks,A===null?u.callbacks=[z]:A.push(z))}else A={lane:z,tag:r.tag,payload:r.payload,callback:r.callback,next:null},M===null?(T=M=A,h=N):M=M.next=A,i|=z;if(r=r.next,r===null){if(r=u.shared.pending,r===null)break;A=r,r=A.next,A.next=null,u.lastBaseUpdate=A,u.shared.pending=null}}while(!0);M===null&&(h=N),u.baseState=h,u.firstBaseUpdate=T,u.lastBaseUpdate=M,n===null&&(u.shared.lanes=0),Se|=i,t.lanes=i,t.memoizedState=N}}function oo(t,l){if(typeof t!="function")throw Error(c(191,t));t.call(l)}function so(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=U.T,r={};U.T=r,Af(t,!1,l,e);try{var h=u(),T=U.S;if(T!==null&&T(r,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var M=Vm(h,a);fu(t,l,M,hl(t))}else fu(t,l,a,hl(t))}catch(N){fu(t,l,{then:function(){},status:"rejected",reason:N},hl())}finally{x.p=n,i!==null&&r.types!==null&&(i.types=r.types),U.T=i}}function Fm(){}function Tf(t,l,e,a){if(t.tag!==5)throw Error(c(476));var u=Vo(t).queue;Zo(t,u,l,$,e===null?Fm:function(){return Ko(t),e(a)})}function Vo(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wl,lastRenderedState:$},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function Ko(t){var l=Vo(t);l.next===null&&(l=t.alternate.memoizedState),fu(t,l.next.queue,{},hl())}function zf(){return Qt(Au)}function Jo(){return Ct().memoizedState}function wo(){return Ct().memoizedState}function km(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=hl();t=he(e);var a=de(l,t,e);a!==null&&(el(a,l,e),eu(a,l,e)),l={cache:ki()},t.payload=l;return}l=l.return}}function Im(t,l,e){var a=hl();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},Sn(t)?Wo(l,e):(e=ji(t,l,e,a),e!==null&&(el(e,t,a),Fo(e,l,a)))}function $o(t,l,e){var a=hl();fu(t,l,e,a)}function fu(t,l,e,a){var u={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(Sn(t))Wo(l,u);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,r=n(i,e);if(u.hasEagerState=!0,u.eagerState=r,il(r,i))return ku(t,l,u,0),bt===null&&Fu(),!1}catch{}finally{}if(e=ji(t,l,u,a),e!==null)return el(e,t,a),Fo(e,l,a),!0}return!1}function Af(t,l,e,a){if(a={lane:2,revertLane:ec(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Sn(t)){if(l)throw Error(c(479))}else l=ji(t,e,a,2),l!==null&&el(l,t,2)}function Sn(t){var l=t.alternate;return t===P||l!==null&&l===P}function Wo(t,l){Sa=sn=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function Fo(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,tr(t,e)}}var cu={readContext:Qt,use:mn,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};cu.useEffectEvent=_t;var ko={readContext:Qt,use:mn,useCallback:function(t,l){return Wt().memoizedState=[t,l===void 0?null:l],t},useContext:Qt,useEffect:Bo,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,vn(4194308,4,Lo.bind(null,l,t),e)},useLayoutEffect:function(t,l){return vn(4194308,4,t,l)},useInsertionEffect:function(t,l){vn(4,2,t,l)},useMemo:function(t,l){var e=Wt();l=l===void 0?null:l;var a=t();if(Ve){ue(!0);try{t()}finally{ue(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=Wt();if(e!==void 0){var u=e(l);if(Ve){ue(!0);try{e(l)}finally{ue(!1)}}}else u=l;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=Im.bind(null,P,t),[a.memoizedState,t]},useRef:function(t){var l=Wt();return t={current:t},l.memoizedState=t},useState:function(t){t=gf(t);var l=t.queue,e=$o.bind(null,P,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:bf,useDeferredValue:function(t,l){var e=Wt();return Ef(e,t,l)},useTransition:function(){var t=gf(!1);return t=Zo.bind(null,P,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=P,u=Wt();if(it){if(e===void 0)throw Error(c(407));e=e()}else{if(e=l(),bt===null)throw Error(c(349));(ut&127)!==0||So(a,l,e)}u.memoizedState=e;var n={value:e,getSnapshot:l};return u.queue=n,Bo(bo.bind(null,a,n,t),[t]),a.flags|=2048,ba(9,{destroy:void 0},po.bind(null,a,n,e,l),null),e},useId:function(){var t=Wt(),l=bt.identifierPrefix;if(it){var e=ql,a=xl;e=(a&~(1<<32-nl(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=hn++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?i.createElement(u,{is:a.is}):i.createElement(u)}}n[jt]=l,n[Ft]=a;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Vt(n,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&Wl(l)}}return zt(l),Lf(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&Wl(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(c(166));if(t=lt.current,sa(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,u=Xt,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}t[jt]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||vh(t.nodeValue,e)),t||re(l,!0)}else t=Ln(t).createTextNode(a),t[jt]=l,l.stateNode=t}return zt(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=sa(l),e!==null){if(t===null){if(!a)throw Error(c(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[jt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;zt(l),t=!1}else e=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(rl(l),l):(rl(l),null);if((l.flags&128)!==0)throw Error(c(558))}return zt(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=sa(l),a!==null&&a.dehydrated!==null){if(t===null){if(!u)throw Error(c(318));if(u=l.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[jt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;zt(l),u=!1}else u=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return l.flags&256?(rl(l),l):(rl(l),null)}return rl(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==u&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),zn(l,l.updateQueue),zt(l),null);case 4:return Dt(),t===null&&ic(l.stateNode.containerInfo),zt(l),null;case 10:return Kl(l.type),zt(l),null;case 19:if(H(Ut),a=l.memoizedState,a===null)return zt(l),null;if(u=(l.flags&128)!==0,n=a.rendering,n===null)if(u)ou(a,!1);else{if(Ot!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(n=on(t),n!==null){for(l.flags|=128,ou(a,!1),t=n.updateQueue,l.updateQueue=t,zn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)wr(e,t),e=e.sibling;return Y(Ut,Ut.current&1|2),it&&Zl(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&al()>Mn&&(l.flags|=128,u=!0,ou(a,!1),l.lanes=4194304)}else{if(!u)if(t=on(n),t!==null){if(l.flags|=128,u=!0,t=t.updateQueue,l.updateQueue=t,zn(l,t),ou(a,!0),a.tail===null&&a.tailMode==="hidden"&&!n.alternate&&!it)return zt(l),null}else 2*al()-a.renderingStartTime>Mn&&e!==536870912&&(l.flags|=128,u=!0,ou(a,!1),l.lanes=4194304);a.isBackwards?(n.sibling=l.child,l.child=n):(t=a.last,t!==null?t.sibling=n:l.child=n,a.last=n)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=al(),t.sibling=null,e=Ut.current,Y(Ut,u?e&1|2:e&1),it&&Zl(l,a.treeForkCount),t):(zt(l),null);case 22:case 23:return rl(l),ff(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(zt(l),l.subtreeFlags&6&&(l.flags|=8192)):zt(l),e=l.updateQueue,e!==null&&zn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&H(je),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),Kl(Ht),zt(l),null;case 25:return null;case 30:return null}throw Error(c(156,l.tag))}function ay(t,l){switch(Ki(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return Kl(Ht),Dt(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Hu(l),null;case 31:if(l.memoizedState!==null){if(rl(l),l.alternate===null)throw Error(c(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(rl(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(c(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return H(Ut),null;case 4:return Dt(),null;case 10:return Kl(l.type),null;case 22:case 23:return rl(l),ff(),t!==null&&H(je),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return Kl(Ht),null;case 25:return null;default:return null}}function Es(t,l){switch(Ki(l),l.tag){case 3:Kl(Ht),Dt();break;case 26:case 27:case 5:Hu(l);break;case 4:Dt();break;case 31:l.memoizedState!==null&&rl(l);break;case 13:rl(l);break;case 19:H(Ut);break;case 10:Kl(l.type);break;case 22:case 23:rl(l),ff(),t!==null&&H(je);break;case 24:Kl(Ht)}}function su(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var u=a.next;e=u;do{if((e.tag&t)===t){a=void 0;var n=e.create,i=e.inst;a=n(),i.destroy=a}e=e.next}while(e!==u)}}catch(r){dt(l,l.return,r)}}function ve(t,l,e){try{var a=l.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var n=u.next;a=n;do{if((a.tag&t)===t){var i=a.inst,r=i.destroy;if(r!==void 0){i.destroy=void 0,u=l;var h=e,T=r;try{T()}catch(M){dt(u,h,M)}}}a=a.next}while(a!==n)}}catch(M){dt(l,l.return,M)}}function Ts(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{so(l,e)}catch(a){dt(t,t.return,a)}}}function zs(t,l,e){e.props=Ke(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){dt(t,l,a)}}function hu(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(u){dt(t,l,u)}}function Yl(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(u){dt(t,l,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(u){dt(t,l,u)}else e.current=null}function As(t){var l=t.type,e=t.memoizedProps,a=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break t;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(u){dt(t,t.return,u)}}function Gf(t,l,e){try{var a=t.stateNode;Ry(a,t.type,e,l),a[Ft]=l}catch(u){dt(t,t.return,u)}}function Rs(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ze(t.type)||t.tag===4}function jf(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Rs(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ze(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xf(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=jl));else if(a!==4&&(a===27&&ze(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Xf(t,l,e),t=t.sibling;t!==null;)Xf(t,l,e),t=t.sibling}function An(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(a!==4&&(a===27&&ze(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(An(t,l,e),t=t.sibling;t!==null;)An(t,l,e),t=t.sibling}function _s(t){var l=t.stateNode,e=t.memoizedProps;try{for(var a=t.type,u=l.attributes;u.length;)l.removeAttributeNode(u[0]);Vt(l,a,e),l[jt]=t,l[Ft]=e}catch(n){dt(t,t.return,n)}}var Fl=!1,qt=!1,Qf=!1,Os=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function uy(t,l){if(t=t.containerInfo,rc=Kn,t=Lr(t),Bi(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var u=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,r=-1,h=-1,T=0,M=0,N=t,z=null;l:for(;;){for(var A;N!==e||u!==0&&N.nodeType!==3||(r=i+u),N!==n||a!==0&&N.nodeType!==3||(h=i+a),N.nodeType===3&&(i+=N.nodeValue.length),(A=N.firstChild)!==null;)z=N,N=A;for(;;){if(N===t)break l;if(z===e&&++T===u&&(r=i),z===n&&++M===a&&(h=i),(A=N.nextSibling)!==null)break;N=z,z=N.parentNode}N=A}e=r===-1||h===-1?null:{start:r,end:h}}else e=null}e=e||{start:0,end:0}}else e=null;for(oc={focusedElem:t,selectionRange:e},Kn=!1,Gt=l;Gt!==null;)if(l=Gt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,Gt=t;else for(;Gt!==null;){switch(l=Gt,n=l.alternate,t=l.flags,l.tag){case 0:if((t&4)!==0&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Vt(n,a,e),n[jt]=t,Lt(n),a=n;break t;case"link":var i=Hh("link","href",u).get(a+(e.href||""));if(i){for(var r=0;rSt&&(i=St,St=J,J=i);var S=qr(r,J),m=qr(r,St);if(S&&m&&(A.rangeCount!==1||A.anchorNode!==S.node||A.anchorOffset!==S.offset||A.focusNode!==m.node||A.focusOffset!==m.offset)){var E=N.createRange();E.setStart(S.node,S.offset),A.removeAllRanges(),J>St?(A.addRange(E),A.extend(m.node,m.offset)):(E.setEnd(m.node,m.offset),A.addRange(E))}}}}for(N=[],A=r;A=A.parentNode;)A.nodeType===1&&N.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;re?32:e,U.T=null,e=Wf,Wf=null;var n=be,i=le;if(Yt=0,Ra=be=null,le=0,(rt&6)!==0)throw Error(c(331));var r=rt;if(rt|=4,Ls(n.current),xs(n,n.current,i,e),rt=r,Su(0,!1),ul&&typeof ul.onPostCommitFiberRoot=="function")try{ul.onPostCommitFiberRoot(qa,n)}catch{}return!0}finally{x.p=u,U.T=a,eh(t,l)}}function uh(t,l,e){l=bl(e,l),l=Mf(t.stateNode,l,2),t=de(t,l,2),t!==null&&(La(t,2),Ll(t))}function dt(t,l,e){if(t.tag===3)uh(t,t,e);else for(;l!==null;){if(l.tag===3){uh(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(pe===null||!pe.has(a))){t=bl(e,t),e=ns(2),a=de(l,e,2),a!==null&&(is(e,a,l,t),La(a,2),Ll(a));break}}l=l.return}}function Pf(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new fy;var u=new Set;a.set(l,u)}else u=a.get(l),u===void 0&&(u=new Set,a.set(l,u));u.has(e)||(Kf=!0,u.add(e),t=hy.bind(null,t,l,e),l.then(t,t))}function hy(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,bt===t&&(ut&e)===e&&(Ot===4||Ot===3&&(ut&62914560)===ut&&300>al()-On?(rt&2)===0&&_a(t,0):Jf|=e,Aa===ut&&(Aa=0)),Ll(t)}function nh(t,l){l===0&&(l=Ic()),t=xe(t,l),t!==null&&(La(t,l),Ll(t))}function dy(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),nh(t,e)}function my(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,u=t.memoizedState;u!==null&&(e=u.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(l),nh(t,e)}function yy(t,l){return si(t,l)}var Bn=null,Ma=null,tc=!1,xn=!1,lc=!1,Te=0;function Ll(t){t!==Ma&&t.next===null&&(Ma===null?Bn=Ma=t:Ma=Ma.next=t),xn=!0,tc||(tc=!0,gy())}function Su(t,l){if(!lc&&xn){lc=!0;do for(var e=!1,a=Bn;a!==null;){if(t!==0){var u=a.pendingLanes;if(u===0)var n=0;else{var i=a.suspendedLanes,r=a.pingedLanes;n=(1<<31-nl(42|t)+1)-1,n&=u&~(i&~r),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,rh(a,n))}else n=ut,n=Lu(a,a===bt?n:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(n&3)===0||Ya(a,n)||(e=!0,rh(a,n));a=a.next}while(e);lc=!1}}function vy(){ih()}function ih(){xn=tc=!1;var t=0;Te!==0&&Oy()&&(t=Te);for(var l=al(),e=null,a=Bn;a!==null;){var u=a.next,n=fh(a,l);n===0?(a.next=null,e===null?Bn=u:e.next=u,u===null&&(Ma=e)):(e=a,(t!==0||(n&3)!==0)&&(xn=!0)),a=u}Yt!==0&&Yt!==5||Su(t),Te!==0&&(Te=0)}function fh(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,u=t.expirationTimes,n=t.pendingLanes&-62914561;0r)break;var M=h.transferSize,N=h.initiatorType;M&&gh(N)&&(h=h.responseEnd,i+=M*(h"u"?null:document;function Dh(t,l,e){var a=Da;if(a&&typeof l=="string"&&l){var u=Sl(l);u='link[rel="'+t+'"][href="'+u+'"]',typeof e=="string"&&(u+='[crossorigin="'+e+'"]'),Mh.has(u)||(Mh.add(u),t={rel:t,crossOrigin:e,href:l},a.querySelector(u)===null&&(l=a.createElement("link"),Vt(l,"link",t),Lt(l),a.head.appendChild(l)))}}function qy(t){ee.D(t),Dh("dns-prefetch",t,null)}function Yy(t,l){ee.C(t,l),Dh("preconnect",t,l)}function Ly(t,l,e){ee.L(t,l,e);var a=Da;if(a&&t&&l){var u='link[rel="preload"][as="'+Sl(l)+'"]';l==="image"&&e&&e.imageSrcSet?(u+='[imagesrcset="'+Sl(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(u+='[imagesizes="'+Sl(e.imageSizes)+'"]')):u+='[href="'+Sl(t)+'"]';var n=u;switch(l){case"style":n=Ua(t);break;case"script":n=Ca(t)}_l.has(n)||(t=R({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),_l.set(n,t),a.querySelector(u)!==null||l==="style"&&a.querySelector(Tu(n))||l==="script"&&a.querySelector(zu(n))||(l=a.createElement("link"),Vt(l,"link",t),Lt(l),a.head.appendChild(l)))}}function Gy(t,l){ee.m(t,l);var e=Da;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",u='link[rel="modulepreload"][as="'+Sl(a)+'"][href="'+Sl(t)+'"]',n=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ca(t)}if(!_l.has(n)&&(t=R({rel:"modulepreload",href:t},l),_l.set(n,t),e.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(zu(n)))return}a=e.createElement("link"),Vt(a,"link",t),Lt(a),e.head.appendChild(a)}}}function jy(t,l,e){ee.S(t,l,e);var a=Da;if(a&&t){var u=Ie(a).hoistableStyles,n=Ua(t);l=l||"default";var i=u.get(n);if(!i){var r={loading:0,preload:null};if(i=a.querySelector(Tu(n)))r.loading=5;else{t=R({rel:"stylesheet",href:t,"data-precedence":l},e),(e=_l.get(n))&&gc(t,e);var h=i=a.createElement("link");Lt(h),Vt(h,"link",t),h._p=new Promise(function(T,M){h.onload=T,h.onerror=M}),h.addEventListener("load",function(){r.loading|=1}),h.addEventListener("error",function(){r.loading|=2}),r.loading|=4,jn(i,l,a)}i={type:"stylesheet",instance:i,count:1,state:r},u.set(n,i)}}}function Xy(t,l){ee.X(t,l);var e=Da;if(e&&t){var a=Ie(e).hoistableScripts,u=Ca(t),n=a.get(u);n||(n=e.querySelector(zu(u)),n||(t=R({src:t,async:!0},l),(l=_l.get(u))&&Sc(t,l),n=e.createElement("script"),Lt(n),Vt(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function Qy(t,l){ee.M(t,l);var e=Da;if(e&&t){var a=Ie(e).hoistableScripts,u=Ca(t),n=a.get(u);n||(n=e.querySelector(zu(u)),n||(t=R({src:t,async:!0,type:"module"},l),(l=_l.get(u))&&Sc(t,l),n=e.createElement("script"),Lt(n),Vt(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function Uh(t,l,e,a){var u=(u=lt.current)?Gn(u):null;if(!u)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Ua(e.href),e=Ie(u).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Ua(e.href);var n=Ie(u).hoistableStyles,i=n.get(t);if(i||(u=u.ownerDocument||u,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=u.querySelector(Tu(t)))&&!n._p&&(i.instance=n,i.state.loading=5),_l.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},_l.set(t,e),n||Zy(u,t,e,i.state))),l&&a===null)throw Error(c(528,""));return i}if(l&&a!==null)throw Error(c(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ca(e),e=Ie(u).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function Ua(t){return'href="'+Sl(t)+'"'}function Tu(t){return'link[rel="stylesheet"]['+t+"]"}function Ch(t){return R({},t,{"data-precedence":t.precedence,precedence:null})}function Zy(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),Vt(l,"link",e),Lt(l),t.head.appendChild(l))}function Ca(t){return'[src="'+Sl(t)+'"]'}function zu(t){return"script[async]"+t}function Nh(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Sl(e.href)+'"]');if(a)return l.instance=a,Lt(a),a;var u=R({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Lt(a),Vt(a,"style",u),jn(a,e.precedence,t),l.instance=a;case"stylesheet":u=Ua(e.href);var n=t.querySelector(Tu(u));if(n)return l.state.loading|=4,l.instance=n,Lt(n),n;a=Ch(e),(u=_l.get(u))&&gc(a,u),n=(t.ownerDocument||t).createElement("link"),Lt(n);var i=n;return i._p=new Promise(function(r,h){i.onload=r,i.onerror=h}),Vt(n,"link",a),l.state.loading|=4,jn(n,e.precedence,t),l.instance=n;case"script":return n=Ca(e.src),(u=t.querySelector(zu(n)))?(l.instance=u,Lt(u),u):(a=e,(u=_l.get(n))&&(a=R({},e),Sc(a,u)),t=t.ownerDocument||t,u=t.createElement("script"),Lt(u),Vt(u,"link",a),t.head.appendChild(u),l.instance=u);case"void":return null;default:throw Error(c(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,jn(a,e.precedence,t));return l.instance}function jn(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,n=u,i=0;i title"):null)}function Vy(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function xh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ky(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var u=Ua(a.href),n=l.querySelector(Tu(u));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Qn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,Lt(n);return}n=l.ownerDocument||l,a=Ch(a),(u=_l.get(u))&&gc(a,u),n=n.createElement("link"),Lt(n);var i=n;i._p=new Promise(function(r,h){i.onload=r,i.onerror=h}),Vt(n,"link",a),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=Qn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var pc=0;function Jy(t,l){return t.stylesheets&&t.count===0&&Vn(t,t.stylesheets),0pc?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Qn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Zn=null;function Vn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Zn=new Map,l.forEach(wy,t),Zn=null,Qn.call(t))}function wy(t,l){if(!(l.state.loading&4)){var e=Zn.get(t);if(e)var a=e.get(null);else{e=new Map,Zn.set(t,e);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(o){console.error(o)}}return f(),Oc.exports=iv(),Oc.exports}/** + * react-router v7.18.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var Lc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,hd=/^[\\/]{2}/;function fv(f,o){return o+f.replace(/\\/g,"/")}var ad="popstate";function ud(f){return typeof f=="object"&&f!=null&&"pathname"in f&&"search"in f&&"hash"in f&&"state"in f&&"key"in f}function cv(f={}){function o(d,v){let{pathname:b="/",search:O="",hash:p=""}=$e(d.location.hash.substring(1));return!b.startsWith("/")&&!b.startsWith(".")&&(b="/"+b),Bc("",{pathname:b,search:O,hash:p},v.state&&v.state.usr||null,v.state&&v.state.key||"default")}function s(d,v){let b=d.document.querySelector("base"),O="";if(b&&b.getAttribute("href")){let p=d.location.href,y=p.indexOf("#");O=y===-1?p:p.slice(0,y)}return O+"#"+(typeof v=="string"?v:Uu(v))}function c(d,v){dl(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(v)})`)}return ov(o,s,c,f)}function Rt(f,o){if(f===!1||f===null||typeof f>"u")throw new Error(o)}function dl(f,o){if(!f){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function rv(){return Math.random().toString(36).substring(2,10)}function nd(f,o){return{usr:f.state,key:f.key,idx:o,masked:f.mask?{pathname:f.pathname,search:f.search,hash:f.hash}:void 0}}function Bc(f,o,s=null,c,d){return{pathname:typeof f=="string"?f:f.pathname,search:"",hash:"",...typeof o=="string"?$e(o):o,state:s,key:o&&o.key||c||rv(),mask:d}}function Uu({pathname:f="/",search:o="",hash:s=""}){return o&&o!=="?"&&(f+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(f+=s.charAt(0)==="#"?s:"#"+s),f}function $e(f){let o={};if(f){let s=f.indexOf("#");s>=0&&(o.hash=f.substring(s),f=f.substring(0,s));let c=f.indexOf("?");c>=0&&(o.search=f.substring(c),f=f.substring(0,c)),f&&(o.pathname=f)}return o}function ov(f,o,s,c={}){let{window:d=document.defaultView,v5Compat:v=!1}=c,b=d.history,O="POP",p=null,y=D();y==null&&(y=0,b.replaceState({...b.state,idx:y},""));function D(){return(b.state||{idx:null}).idx}function R(){O="POP";let L=D(),q=L==null?null:L-y;y=L,p&&p({action:O,location:G.location,delta:q})}function B(L,q){O="PUSH";let W=ud(L)?L:Bc(G.location,L,q);s&&s(W,L),y=D()+1;let w=nd(W,y),mt=G.createHref(W.mask||W);try{b.pushState(w,"",mt)}catch(st){if(st instanceof DOMException&&st.name==="DataCloneError")throw st;d.location.assign(mt)}v&&p&&p({action:O,location:G.location,delta:1})}function Z(L,q){O="REPLACE";let W=ud(L)?L:Bc(G.location,L,q);s&&s(W,L),y=D();let w=nd(W,y),mt=G.createHref(W.mask||W);b.replaceState(w,"",mt),v&&p&&p({action:O,location:G.location,delta:0})}function V(L){return sv(d,L)}let G={get action(){return O},get location(){return f(d,b)},listen(L){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(ad,R),p=L,()=>{d.removeEventListener(ad,R),p=null}},createHref(L){return o(d,L)},createURL:V,encodeLocation(L){let q=V(L);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:B,replace:Z,go(L){return b.go(L)}};return G}function sv(f,o,s=!1){let c="http://localhost";f&&(c=f.location.origin!=="null"?f.location.origin:f.location.href),Rt(c,"No window.location.(origin|href) available to create URL");let d=typeof o=="string"?o:Uu(o);return d=d.replace(/ $/,"%20"),!s&&hd.test(d)&&(d=c+d),new URL(d,c)}function dd(f,o,s="/"){return hv(f,o,s,!1)}function hv(f,o,s,c,d){let v=typeof o=="string"?$e(o):o,b=ae(v.pathname||"/",s);if(b==null)return null;let O=dv(f),p=null,y=Av(b);for(let D=0;p==null&&D{let D={relativePath:y===void 0?b.path||"":y,caseSensitive:b.caseSensitive===!0,childrenIndex:O,route:b};if(D.relativePath.startsWith("/")){if(!D.relativePath.startsWith(c)&&p)return;Rt(D.relativePath.startsWith(c),`Absolute route path "${D.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),D.relativePath=D.relativePath.slice(c.length)}let R=Ul([c,D.relativePath]),B=s.concat(D);b.children&&b.children.length>0&&(Rt(b.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${R}".`),md(b.children,o,B,R,p)),!(b.path==null&&!b.index)&&o.push({path:R,score:Ev(R,b.index),routesMeta:B.map((Z,V)=>{let[G,L]=gd(Z.relativePath,Z.caseSensitive,V===B.length-1);return{...Z,matcher:G,compiledParams:L}})})};return f.forEach((b,O)=>{var p;if(b.path===""||!((p=b.path)!=null&&p.includes("?")))v(b,O);else for(let y of yd(b.path))v(b,O,!0,y)}),o}function yd(f){let o=f.split("/");if(o.length===0)return[];let[s,...c]=o,d=s.endsWith("?"),v=s.replace(/\?$/,"");if(c.length===0)return d?[v,""]:[v];let b=yd(c.join("/")),O=[];return O.push(...b.map(p=>p===""?v:[v,p].join("/"))),d&&O.push(...b),O.map(p=>f.startsWith("/")&&p===""?"/":p)}function mv(f){f.sort((o,s)=>o.score!==s.score?s.score-o.score:Tv(o.routesMeta.map(c=>c.childrenIndex),s.routesMeta.map(c=>c.childrenIndex)))}var yv=/^:[\w-]+$/,vv=3,gv=2,Sv=1,pv=10,bv=-2,id=f=>f==="*";function Ev(f,o){let s=f.split("/"),c=s.length;return s.some(id)&&(c+=bv),o&&(c+=gv),s.filter(d=>!id(d)).reduce((d,v)=>d+(yv.test(v)?vv:v===""?Sv:pv),c)}function Tv(f,o){return f.length===o.length&&f.slice(0,-1).every((c,d)=>c===o[d])?f[f.length-1]-o[o.length-1]:0}function zv(f,o,s=!1){let{routesMeta:c}=f,d={},v="/",b=[];for(let O=0;O{if(D==="*"){let V=O[B]||"";b=v.slice(0,v.length-V.length).replace(/(.)\/+$/,"$1")}const Z=O[B];return R&&!Z?y[D]=void 0:y[D]=(Z||"").replace(/%2F/g,"/"),y},{}),pathname:v,pathnameBase:b,pattern:f}}function gd(f,o=!1,s=!0){dl(f==="*"||!f.endsWith("*")||f.endsWith("/*"),`Route path "${f}" will be treated as if it were "${f.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${f.replace(/\*$/,"/*")}".`);let c=[],d="^"+f.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(b,O,p,y,D)=>{if(c.push({paramName:O,isOptional:p!=null}),p){let R=D.charAt(y+b.length);return R&&R!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return f.endsWith("*")?(c.push({paramName:"*"}),d+=f==="*"||f==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":f!==""&&f!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function Av(f){try{return f.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return dl(!1,`The URL path "${f}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),f}}function ae(f,o){if(o==="/")return f;if(!f.toLowerCase().startsWith(o.toLowerCase()))return null;let s=o.endsWith("/")?o.length-1:o.length,c=f.charAt(s);return c&&c!=="/"?null:f.slice(s)||"/"}function Rv(f,o="/"){let{pathname:s,search:c="",hash:d=""}=typeof f=="string"?$e(f):f,v;return s?(s=Sd(s),s.startsWith("/")?v=fd(s.substring(1),"/"):v=fd(s,o)):v=o,{pathname:v,search:Mv(c),hash:Dv(d)}}function fd(f,o){let s=ei(o).split("/");return f.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Cc(f,o,s,c){return`Cannot include a '${f}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function _v(f){return f.filter((o,s)=>s===0||o.route.path&&o.route.path.length>0)}function Gc(f){let o=_v(f);return o.map((s,c)=>c===o.length-1?s.pathname:s.pathnameBase)}function ai(f,o,s,c=!1){let d;typeof f=="string"?d=$e(f):(d={...f},Rt(!d.pathname||!d.pathname.includes("?"),Cc("?","pathname","search",d)),Rt(!d.pathname||!d.pathname.includes("#"),Cc("#","pathname","hash",d)),Rt(!d.search||!d.search.includes("#"),Cc("#","search","hash",d)));let v=f===""||d.pathname==="",b=v?"/":d.pathname,O;if(b==null)O=s;else{let R=o.length-1;if(!c&&b.startsWith("..")){let B=b.split("/");for(;B[0]==="..";)B.shift(),R-=1;d.pathname=B.join("/")}O=R>=0?o[R]:"/"}let p=Rv(d,O),y=b&&b!=="/"&&b.endsWith("/"),D=(v||b===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(y||D)&&(p.pathname+="/"),p}var Sd=f=>f.replace(/[\\/]{2,}/g,"/"),Ul=f=>Sd(f.join("/")),ei=f=>f.replace(/\/+$/,""),Ov=f=>ei(f).replace(/^\/*/,"/"),Mv=f=>!f||f==="?"?"":f.startsWith("?")?f:"?"+f,Dv=f=>!f||f==="#"?"":f.startsWith("#")?f:"#"+f,Uv=class{constructor(f,o,s,c=!1){this.status=f,this.statusText=o||"",this.internal=c,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Cv(f){return f!=null&&typeof f.status=="number"&&typeof f.statusText=="string"&&typeof f.internal=="boolean"&&"data"in f}function Nv(f){let o=f.map(s=>s.route.path).filter(Boolean);return Ul(o)||"/"}var pd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bd(f,o){let s=f;if(typeof s!="string"||!Lc.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let c=s,d=!1;if(pd)try{let v=new URL(window.location.href),b=hd.test(s)?new URL(fv(s,v.protocol)):new URL(s),O=ae(b.pathname,o);b.origin===v.origin&&O!=null?s=O+b.search+b.hash:d=!0}catch{dl(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ed=["POST","PUT","PATCH","DELETE"];new Set(Ed);var Hv=["GET",...Ed];new Set(Hv);var Bv=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function xv(f){try{return Bv.includes(new URL(f).protocol)}catch{return!1}}var Ha=_.createContext(null);Ha.displayName="DataRouter";var ui=_.createContext(null);ui.displayName="DataRouterState";var Td=_.createContext(!1);function qv(){return _.useContext(Td)}var zd=_.createContext({isTransitioning:!1});zd.displayName="ViewTransition";var Yv=_.createContext(new Map);Yv.displayName="Fetchers";var Lv=_.createContext(null);Lv.displayName="Await";var ml=_.createContext(null);ml.displayName="Navigation";var Cu=_.createContext(null);Cu.displayName="Location";var Cl=_.createContext({outlet:null,matches:[],isDataRoute:!1});Cl.displayName="Route";var jc=_.createContext(null);jc.displayName="RouteError";var Ad="REACT_ROUTER_ERROR",Gv="REDIRECT",jv="ROUTE_ERROR_RESPONSE";function Xv(f){if(f.startsWith(`${Ad}:${Gv}:{`))try{let o=JSON.parse(f.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function Qv(f){if(f.startsWith(`${Ad}:${jv}:{`))try{let o=JSON.parse(f.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Uv(o.status,o.statusText,o.data)}catch{}}function Zv(f,{relative:o}={}){Rt(Ba(),"useHref() may be used only in the context of a component.");let{basename:s,navigator:c}=_.useContext(ml),{hash:d,pathname:v,search:b}=Nu(f,{relative:o}),O=v;return s!=="/"&&(O=v==="/"?s:Ul([s,v])),c.createHref({pathname:O,search:b,hash:d})}function Ba(){return _.useContext(Cu)!=null}function Nl(){return Rt(Ba(),"useLocation() may be used only in the context of a component."),_.useContext(Cu).location}var Rd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _d(f){_.useContext(ml).static||_.useLayoutEffect(f)}function Xc(){let{isDataRoute:f}=_.useContext(Cl);return f?u0():Vv()}function Vv(){Rt(Ba(),"useNavigate() may be used only in the context of a component.");let f=_.useContext(Ha),{basename:o,navigator:s}=_.useContext(ml),{matches:c}=_.useContext(Cl),{pathname:d}=Nl(),v=JSON.stringify(Gc(c)),b=_.useRef(!1);return _d(()=>{b.current=!0}),_.useCallback((p,y={})=>{if(dl(b.current,Rd),!b.current)return;if(typeof p=="number"){s.go(p);return}let D=ai(p,JSON.parse(v),d,y.relative==="path");f==null&&o!=="/"&&(D.pathname=D.pathname==="/"?o:Ul([o,D.pathname])),(y.replace?s.replace:s.push)(D,y.state,y)},[o,s,v,d,f])}var Kv=_.createContext(null);function Jv(f){let o=_.useContext(Cl).outlet;return _.useMemo(()=>o&&_.createElement(Kv.Provider,{value:f},o),[o,f])}function Nu(f,{relative:o}={}){let{matches:s}=_.useContext(Cl),{pathname:c}=Nl(),d=JSON.stringify(Gc(s));return _.useMemo(()=>ai(f,JSON.parse(d),c,o==="path"),[f,d,c,o])}function wv(f,o){return Od(f,o)}function Od(f,o,s){var L;Rt(Ba(),"useRoutes() may be used only in the context of a component.");let{navigator:c}=_.useContext(ml),{matches:d}=_.useContext(Cl),v=d[d.length-1],b=v?v.params:{},O=v?v.pathname:"/",p=v?v.pathnameBase:"/",y=v&&v.route;{let q=y&&y.path||"";Dd(O,!y||q.endsWith("*")||q.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${O}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let D=Nl(),R;if(o){let q=typeof o=="string"?$e(o):o;Rt(p==="/"||((L=q.pathname)==null?void 0:L.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${q.pathname}" was given in the \`location\` prop.`),R=q}else R=D;let B=R.pathname||"/",Z=B;if(p!=="/"){let q=p.replace(/^\//,"").split("/");Z="/"+B.replace(/^\//,"").split("/").slice(q.length).join("/")}let V=s&&s.state.matches.length?s.state.matches.map(q=>Object.assign(q,{route:s.manifest[q.route.id]||q.route})):dd(f,{pathname:Z});dl(y||V!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),dl(V==null||V[V.length-1].route.element!==void 0||V[V.length-1].route.Component!==void 0||V[V.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let G=Iv(V&&V.map(q=>Object.assign({},q,{params:Object.assign({},b,q.params),pathname:Ul([p,c.encodeLocation?c.encodeLocation(q.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathname]),pathnameBase:q.pathnameBase==="/"?p:Ul([p,c.encodeLocation?c.encodeLocation(q.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathnameBase])})),d,s);return o&&G?_.createElement(Cu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...R},navigationType:"POP"}},G):G}function $v(){let f=a0(),o=Cv(f)?`${f.status} ${f.statusText}`:f instanceof Error?f.message:JSON.stringify(f),s=f instanceof Error?f.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},v={padding:"2px 4px",backgroundColor:c},b=null;return console.error("Error handled by React Router default ErrorBoundary:",f),b=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:v},"ErrorBoundary")," or"," ",_.createElement("code",{style:v},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},o),s?_.createElement("pre",{style:d},s):null,b)}var Wv=_.createElement($v,null),Md=class extends _.Component{constructor(f){super(f),this.state={location:f.location,revalidation:f.revalidation,error:f.error}}static getDerivedStateFromError(f){return{error:f}}static getDerivedStateFromProps(f,o){return o.location!==f.location||o.revalidation!=="idle"&&f.revalidation==="idle"?{error:f.error,location:f.location,revalidation:f.revalidation}:{error:f.error!==void 0?f.error:o.error,location:o.location,revalidation:f.revalidation||o.revalidation}}componentDidCatch(f,o){this.props.onError?this.props.onError(f,o):console.error("React Router caught the following error during render",f)}render(){let f=this.state.error;if(this.context&&typeof f=="object"&&f&&"digest"in f&&typeof f.digest=="string"){const s=Qv(f.digest);s&&(f=s)}let o=f!==void 0?_.createElement(Cl.Provider,{value:this.props.routeContext},_.createElement(jc.Provider,{value:f,children:this.props.component})):this.props.children;return this.context?_.createElement(Fv,{error:f},o):o}};Md.contextType=Td;var Nc=new WeakMap;function Fv({children:f,error:o}){let{basename:s}=_.useContext(ml);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Xv(o.digest);if(c){let d=Nc.get(o);if(d)throw d;let v=bd(c.location,s),b=v.absoluteURL||v.to;if(xv(b))throw new Error("Invalid redirect location");if(pd&&!Nc.get(o))if(v.isExternal||c.reloadDocument)window.location.href=b;else{const O=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(v.to,{replace:c.replace}));throw Nc.set(o,O),O}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${b}`})}}return f}function kv({routeContext:f,match:o,children:s}){let c=_.useContext(Ha);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),_.createElement(Cl.Provider,{value:f},s)}function Iv(f,o=[],s){let c=s==null?void 0:s.state;if(f==null){if(!c)return null;if(c.errors)f=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)f=c.matches;else return null}let d=f,v=c==null?void 0:c.errors;if(v!=null){let D=d.findIndex(R=>R.route.id&&(v==null?void 0:v[R.route.id])!==void 0);Rt(D>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),d=d.slice(0,Math.min(d.length,D+1))}let b=!1,O=-1;if(s&&c){b=c.renderFallback;for(let D=0;D=0?d=d.slice(0,O+1):d=[d[0]];break}}}}let p=s==null?void 0:s.onError,y=c&&p?(D,R)=>{var B,Z;p(D,{location:c.location,params:((Z=(B=c.matches)==null?void 0:B[0])==null?void 0:Z.params)??{},pattern:Nv(c.matches),errorInfo:R})}:void 0;return d.reduceRight((D,R,B)=>{let Z,V=!1,G=null,L=null;c&&(Z=v&&R.route.id?v[R.route.id]:void 0,G=R.route.errorElement||Wv,b&&(O<0&&B===0?(Dd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),V=!0,L=null):O===B&&(V=!0,L=R.route.hydrateFallbackElement||null)));let q=o.concat(d.slice(0,B+1)),W=()=>{let w;return Z?w=G:V?w=L:R.route.Component?w=_.createElement(R.route.Component,null):R.route.element?w=R.route.element:w=D,_.createElement(kv,{match:R,routeContext:{outlet:D,matches:q,isDataRoute:c!=null},children:w})};return c&&(R.route.ErrorBoundary||R.route.errorElement||B===0)?_.createElement(Md,{location:c.location,revalidation:c.revalidation,component:G,error:Z,children:W(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:y}):W()},null)}function Qc(f){return`${f} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pv(f){let o=_.useContext(Ha);return Rt(o,Qc(f)),o}function t0(f){let o=_.useContext(ui);return Rt(o,Qc(f)),o}function l0(f){let o=_.useContext(Cl);return Rt(o,Qc(f)),o}function Zc(f){let o=l0(f),s=o.matches[o.matches.length-1];return Rt(s.route.id,`${f} can only be used on routes that contain a unique "id"`),s.route.id}function e0(){return Zc("useRouteId")}function a0(){var c;let f=_.useContext(jc),o=t0("useRouteError"),s=Zc("useRouteError");return f!==void 0?f:(c=o.errors)==null?void 0:c[s]}function u0(){let{router:f}=Pv("useNavigate"),o=Zc("useNavigate"),s=_.useRef(!1);return _d(()=>{s.current=!0}),_.useCallback(async(d,v={})=>{dl(s.current,Rd),s.current&&(typeof d=="number"?await f.navigate(d):await f.navigate(d,{fromRouteId:o,...v}))},[f,o])}var cd={};function Dd(f,o,s){!o&&!cd[f]&&(cd[f]=!0,dl(!1,s))}_.memo(n0);function n0({routes:f,manifest:o,future:s,state:c,isStatic:d,onError:v}){return Od(f,void 0,{manifest:o,state:c,isStatic:d,onError:v})}function V0({to:f,replace:o,state:s,relative:c}){Rt(Ba()," may be used only in the context of a component.");let{static:d}=_.useContext(ml);dl(!d," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:v}=_.useContext(Cl),{pathname:b}=Nl(),O=Xc(),p=ai(f,Gc(v),b,c==="path"),y=JSON.stringify(p);return _.useEffect(()=>{O(JSON.parse(y),{replace:o,state:s,relative:c})},[O,y,c,o,s]),null}function K0(f){return Jv(f.context)}function i0(f){Rt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function f0({basename:f="/",children:o=null,location:s,navigationType:c="POP",navigator:d,static:v=!1,useTransitions:b}){Rt(!Ba(),"You cannot render a inside another . You should never have more than one in your app.");let O=f.replace(/^\/*/,"/"),p=_.useMemo(()=>({basename:O,navigator:d,static:v,useTransitions:b,future:{}}),[O,d,v,b]);typeof s=="string"&&(s=$e(s));let{pathname:y="/",search:D="",hash:R="",state:B=null,key:Z="default",mask:V}=s,G=_.useMemo(()=>{let L=ae(y,O);return L==null?null:{location:{pathname:L,search:D,hash:R,state:B,key:Z,mask:V},navigationType:c}},[O,y,D,R,B,Z,c,V]);return dl(G!=null,` is not able to match the URL "${y}${D}${R}" because it does not start with the basename, so the won't render anything.`),G==null?null:_.createElement(ml.Provider,{value:p},_.createElement(Cu.Provider,{children:o,value:G}))}function J0({children:f,location:o}){return wv(xc(f),o)}function xc(f,o=[]){let s=[];return _.Children.forEach(f,(c,d)=>{if(!_.isValidElement(c))return;let v=[...o,d];if(c.type===_.Fragment){s.push.apply(s,xc(c.props.children,v));return}Rt(c.type===i0,`[${typeof c.type=="string"?c.type:c.type.name}] is not a component. All component children of must be a or `),Rt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let b={id:c.props.id||v.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(b.children=xc(c.props.children,v)),s.push(b)}),s}var Pn="get",ti="application/x-www-form-urlencoded";function ni(f){return typeof HTMLElement<"u"&&f instanceof HTMLElement}function c0(f){return ni(f)&&f.tagName.toLowerCase()==="button"}function r0(f){return ni(f)&&f.tagName.toLowerCase()==="form"}function o0(f){return ni(f)&&f.tagName.toLowerCase()==="input"}function s0(f){return!!(f.metaKey||f.altKey||f.ctrlKey||f.shiftKey)}function h0(f,o){return f.button===0&&(!o||o==="_self")&&!s0(f)}function qc(f=""){return new URLSearchParams(typeof f=="string"||Array.isArray(f)||f instanceof URLSearchParams?f:Object.keys(f).reduce((o,s)=>{let c=f[s];return o.concat(Array.isArray(c)?c.map(d=>[s,d]):[[s,c]])},[]))}function d0(f,o){let s=qc(f);return o&&o.forEach((c,d)=>{s.has(d)||o.getAll(d).forEach(v=>{s.append(d,v)})}),s}var In=null;function m0(){if(In===null)try{new FormData(document.createElement("form"),0),In=!1}catch{In=!0}return In}var y0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hc(f){return f!=null&&!y0.has(f)?(dl(!1,`"${f}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${ti}"`),null):f}function v0(f,o){let s,c,d,v,b;if(r0(f)){let O=f.getAttribute("action");c=O?ae(O,o):null,s=f.getAttribute("method")||Pn,d=Hc(f.getAttribute("enctype"))||ti,v=new FormData(f)}else if(c0(f)||o0(f)&&(f.type==="submit"||f.type==="image")){let O=f.form;if(O==null)throw new Error('Cannot submit a + ) : ( +
SIGNED OUT
+ ); +} + +describe("AuthProvider", () => { + afterEach(() => { + vi.restoreAllMocks(); + window.localStorage.clear(); + }); + + it("restores the signed-in state on load without asking for the key again", () => { + // The session credential is an HttpOnly cookie the page cannot read; the + // persisted marker is what tells a fresh tab/restart it is signed in. + window.localStorage.setItem("otari.dashboard.hasSession", "1"); + + render( + + + , + ); + + expect(screen.getByRole("button", { name: "Sign out" })).toBeInTheDocument(); + }); + + it("starts signed out when no session marker is present", () => { + render( + + + , + ); + + expect(screen.getByText("SIGNED OUT")).toBeInTheDocument(); + }); + + it("revokes the server-side session and drops the marker on sign-out", async () => { + window.localStorage.setItem("otari.dashboard.hasSession", "1"); + const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(null, { status: 204 })); + const user = userEvent.setup(); + + render( + + + , + ); + + await user.click(screen.getByRole("button", { name: "Sign out" })); + + expect(screen.getByText("SIGNED OUT")).toBeInTheDocument(); + expect(window.localStorage.getItem("otari.dashboard.hasSession")).toBeNull(); + await waitFor(() => { + const call = fetchMock.mock.calls.find(([url]) => url === "/v1/auth/session"); + expect(call?.[1]?.method).toBe("DELETE"); + }); + }); +}); diff --git a/web/src/auth/AuthContext.tsx b/web/src/auth/AuthContext.tsx index d9e89313..8623e041 100644 --- a/web/src/auth/AuthContext.tsx +++ b/web/src/auth/AuthContext.tsx @@ -2,95 +2,72 @@ import { useQueryClient } from "@tanstack/react-query"; import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react"; import type { ReactNode } from "react"; -import { setMasterKey, setUnauthorizedHandler } from "@/api/client"; +import { deleteSession, setUnauthorizedHandler } from "@/api/client"; -const STORAGE_KEY = "otari.dashboard.masterKey"; +// Non-secret marker that a session cookie was minted for this browser. The +// credential itself is an HttpOnly cookie the page cannot read, so this flag is +// what lets the app render signed-in synchronously on load instead of probing +// the server first. If it is ever stale (cookie expired or revoked), the first +// 401 drops it and bounces to sign-in, exactly like any mid-session revocation. +const STORAGE_KEY = "otari.dashboard.hasSession"; interface AuthContextValue { - masterKey: string | null; isAuthenticated: boolean; - login: (key: string) => void; - replaceMasterKey: (key: string) => void; + login: () => void; logout: () => void; } const AuthContext = createContext(null); -function readStoredKey(): string | null { +function readStoredMarker(): boolean { try { - return window.sessionStorage.getItem(STORAGE_KEY); + return window.localStorage.getItem(STORAGE_KEY) === "1"; } catch { - return null; + return false; } } export function AuthProvider({ children }: { children: ReactNode }) { const queryClient = useQueryClient(); - // Seed the api client synchronously during the first render so a restored - // session key is in place before any child query fires. Doing this in an - // effect would let the first request go out unauthenticated (effects run - // child-first, so React Query's fetch would race ahead of the sync). - const [masterKey, setKey] = useState(() => { - const stored = readStoredKey(); - setMasterKey(stored); - return stored; - }); + const [isAuthenticated, setAuthenticated] = useState(readStoredMarker); const logout = useCallback(() => { - setMasterKey(null); - setKey(null); - // Drop any admin data cached under the old key so it can't render to a + // Best-effort server-side revocation; local sign-out proceeds regardless. + void deleteSession(); + setAuthenticated(false); + // Drop any admin data cached under the old session so it can't render to a // later, possibly different, session in the same tab. queryClient.clear(); try { - window.sessionStorage.removeItem(STORAGE_KEY); + window.localStorage.removeItem(STORAGE_KEY); } catch { // Ignore storage errors (e.g. private mode); in-memory state still clears. } }, [queryClient]); - const login = useCallback( - (key: string) => { - const trimmed = key.trim(); - // Set the client key synchronously (before the re-render that mounts the - // dashboard) so the first authenticated request carries the header. - setMasterKey(trimmed); - // Clear any cache from a prior session before the new key's queries run. - queryClient.clear(); - setKey(trimmed); - try { - window.sessionStorage.setItem(STORAGE_KEY, trimmed); - } catch { - // Ignore storage errors; the key still lives in memory for this session. - } - }, - [queryClient], - ); - - const replaceMasterKey = useCallback((key: string) => { - const trimmed = key.trim(); - // A freshly rotated generated master key grants the same dashboard access - // as the key it replaces. Keep the current view stable while subsequent - // requests begin using the new credential. - setMasterKey(trimmed); - setKey(trimmed); + // Called after POST /v1/auth/session succeeded, i.e. the browser already + // holds the session cookie; this only flips the rendered state. + const login = useCallback(() => { + // Clear any cache from a prior session before the new session's queries run. + queryClient.clear(); + setAuthenticated(true); try { - window.sessionStorage.setItem(STORAGE_KEY, trimmed); + window.localStorage.setItem(STORAGE_KEY, "1"); } catch { - // Ignore storage errors; the key still lives in memory for this session. + // Ignore storage errors; the sign-in still works for this tab. } - }, []); + }, [queryClient]); - // A 401 from any request means the key is wrong or was revoked: drop it. + // A 401 from any request means the session expired or was revoked: drop it. useEffect(() => { setUnauthorizedHandler(logout); return () => setUnauthorizedHandler(null); }, [logout]); const value = useMemo( - () => ({ masterKey, isAuthenticated: masterKey != null, login, replaceMasterKey, logout }), - [masterKey, login, replaceMasterKey, logout], + () => ({ isAuthenticated, login, logout }), + [isAuthenticated, login, logout], ); return {children}; diff --git a/web/src/components/Login.test.tsx b/web/src/components/Login.test.tsx index c69566db..955718b4 100644 --- a/web/src/components/Login.test.tsx +++ b/web/src/components/Login.test.tsx @@ -21,11 +21,11 @@ function jsonResponse(body: unknown, status = 200): Response { describe("Login", () => { afterEach(() => { vi.restoreAllMocks(); - window.sessionStorage.clear(); + window.localStorage.clear(); }); - it("signs in when the master key is accepted and sends it as a Bearer token", async () => { - const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValue(jsonResponse([])); + it("signs in by exchanging the master key for a session, never storing the key", async () => { + const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValue(jsonResponse({ expires_at: "2026-07-30T00:00:00Z" })); const user = userEvent.setup(); render( @@ -39,8 +39,14 @@ describe("Login", () => { expect(await screen.findByText("SIGNED IN")).toBeInTheDocument(); - const [, init] = fetchMock.mock.calls[0]; - expect(new Headers(init?.headers).get("Authorization")).toBe("Bearer sk-correct"); + const [url, init] = fetchMock.mock.calls[0]; + expect(url).toBe("/v1/auth/session"); + expect(init?.method).toBe("POST"); + expect(init?.body).toBe(JSON.stringify({ master_key: "sk-correct" })); + // The raw key must not land in any JS-readable storage. + expect(window.localStorage.getItem("otari.dashboard.hasSession")).toBe("1"); + expect(Object.values({ ...window.localStorage })).not.toContain("sk-correct"); + expect(Object.values({ ...window.sessionStorage })).not.toContain("sk-correct"); }); it("links to the auth-free welcome page", () => { diff --git a/web/src/components/Login.tsx b/web/src/components/Login.tsx index 6b21365b..de00ccfd 100644 --- a/web/src/components/Login.tsx +++ b/web/src/components/Login.tsx @@ -1,7 +1,7 @@ import { Button, Card, Input, Label, Link, TextField } from "@heroui/react"; import { useState } from "react"; -import { validateMasterKey } from "@/api/client"; +import { createSession } from "@/api/client"; import { useAuth } from "@/auth/AuthContext"; import { ErrorBanner } from "@/components/ui"; @@ -19,9 +19,9 @@ export function Login() { setIsSubmitting(true); setError(null); try { - const valid = await validateMasterKey(trimmed); + const valid = await createSession(trimmed); if (valid) { - login(trimmed); + login(); } else { setError(new Error("Invalid master key.")); } @@ -85,7 +85,7 @@ export function Login() {

- The key is held only in this browser tab (session storage) and sent directly to this gateway. + The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser.

diff --git a/web/src/components/PricingWarning.test.tsx b/web/src/components/PricingWarning.test.tsx index 6b8271a4..d89049e2 100644 --- a/web/src/components/PricingWarning.test.tsx +++ b/web/src/components/PricingWarning.test.tsx @@ -2,9 +2,8 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { GatewaySettings } from "@/api/types"; import { PricingWarning } from "@/components/PricingWarning"; @@ -41,10 +40,8 @@ function renderPage(ui: ReactElement) { } describe("PricingWarning", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("alarms and enables default pricing when require_pricing rejects requests", async () => { diff --git a/web/src/components/UpdatePrompt.test.tsx b/web/src/components/UpdatePrompt.test.tsx index 63f13ba5..929ea44e 100644 --- a/web/src/components/UpdatePrompt.test.tsx +++ b/web/src/components/UpdatePrompt.test.tsx @@ -4,7 +4,6 @@ import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import { UpdatePrompt } from "@/components/UpdatePrompt"; // The build the fake gateway is currently serving. Tests flip it to stand in @@ -41,11 +40,9 @@ describe("UpdatePrompt", () => { beforeEach(() => { servedBuild = "build-a"; - setMasterKey("test-master-key"); }); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); if (originalLocation) { Object.defineProperty(window, "location", originalLocation); originalLocation = undefined; diff --git a/web/src/components/UpdatePrompt.tsx b/web/src/components/UpdatePrompt.tsx index b83bfdeb..5b6d1095 100644 --- a/web/src/components/UpdatePrompt.tsx +++ b/web/src/components/UpdatePrompt.tsx @@ -44,7 +44,8 @@ export function UpdatePrompt() { {/* A plain reload is enough: the gateway serves index.html with no-store, so this fetches the new bundle rather than the cached one, - and the master key lives in sessionStorage, which survives it. */} + and the sign-in lives in an HttpOnly session cookie, which + survives it. */} diff --git a/web/src/pages/ActivityPage.test.tsx b/web/src/pages/ActivityPage.test.tsx index 187eeed2..5a44fbda 100644 --- a/web/src/pages/ActivityPage.test.tsx +++ b/web/src/pages/ActivityPage.test.tsx @@ -3,9 +3,8 @@ import { render, screen, waitFor, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { MemoryRouter } from "react-router-dom"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { UsageEntry } from "@/api/types"; import { ActivityPage, copyToClipboard } from "@/pages/ActivityPage"; @@ -98,12 +97,8 @@ function listCalls(fetchMock: ReturnType): string[] { } describe("ActivityPage", () => { - beforeEach(() => { - setMasterKey("test-master-key"); - }); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("renders a request row with humanized latency, tokens, and status", async () => { diff --git a/web/src/pages/AliasesPage.test.tsx b/web/src/pages/AliasesPage.test.tsx index b6e6b2f1..56241a0b 100644 --- a/web/src/pages/AliasesPage.test.tsx +++ b/web/src/pages/AliasesPage.test.tsx @@ -3,9 +3,8 @@ import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { MemoryRouter } from "react-router-dom"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { AliasResponse } from "@/api/types"; import { AliasesPage } from "@/pages/AliasesPage"; @@ -53,10 +52,8 @@ function renderPage(ui: ReactElement, route = "/aliases") { } describe("AliasesPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("lists aliases with provenance; config is read-only, stored is deletable", async () => { diff --git a/web/src/pages/BudgetsPage.test.tsx b/web/src/pages/BudgetsPage.test.tsx index 2165b77c..e388d75e 100644 --- a/web/src/pages/BudgetsPage.test.tsx +++ b/web/src/pages/BudgetsPage.test.tsx @@ -2,9 +2,8 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { act, render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { Budget, BudgetResetLog, User } from "@/api/types"; import { BudgetsPage } from "@/pages/BudgetsPage"; @@ -113,10 +112,8 @@ function renderPage(ui: ReactElement) { } describe("BudgetsPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("shows onboarding when there are no budgets", async () => { diff --git a/web/src/pages/KeysPage.test.tsx b/web/src/pages/KeysPage.test.tsx index 2bc4b52b..5fdb49f2 100644 --- a/web/src/pages/KeysPage.test.tsx +++ b/web/src/pages/KeysPage.test.tsx @@ -2,9 +2,8 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { ApiKey, User } from "@/api/types"; import { KeysPage } from "@/pages/KeysPage"; @@ -120,10 +119,8 @@ function renderPage(ui: ReactElement) { } describe("KeysPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("lists keys with status and prefix, never the full secret", async () => { diff --git a/web/src/pages/ModelsPage.test.tsx b/web/src/pages/ModelsPage.test.tsx index 5cc0066e..b18cf3af 100644 --- a/web/src/pages/ModelsPage.test.tsx +++ b/web/src/pages/ModelsPage.test.tsx @@ -235,14 +235,12 @@ function modelOrder(): string[] { describe("ModelsPage", () => { beforeEach(() => { - apiClient.setMasterKey("test-master-key"); // The page persists sort choice in localStorage; start each test clean so // one test's sort does not leak into the next. window.localStorage.clear(); }); afterEach(() => { vi.restoreAllMocks(); - apiClient.setMasterKey(null); window.localStorage.clear(); }); diff --git a/web/src/pages/OverviewPage.test.tsx b/web/src/pages/OverviewPage.test.tsx index 3da96fdf..c26c9ea0 100644 --- a/web/src/pages/OverviewPage.test.tsx +++ b/web/src/pages/OverviewPage.test.tsx @@ -3,9 +3,8 @@ import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { MemoryRouter, Route, Routes, useLocation } from "react-router-dom"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { UsageSummary } from "@/api/types"; import { localDayKey, OverviewIndex, OverviewPage } from "@/pages/OverviewPage"; @@ -93,11 +92,9 @@ function renderPage(ui: ReactElement, initial = "/overview") { } describe("OverviewPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); vi.useRealTimers(); - setMasterKey(null); }); it("uses a zero-padded, one-based local calendar date as its refresh key", () => { @@ -250,10 +247,8 @@ describe("OverviewPage", () => { }); describe("OverviewIndex routing", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("renders the overview when a provider is configured", async () => { diff --git a/web/src/pages/ProvidersPage.test.tsx b/web/src/pages/ProvidersPage.test.tsx index 0615041b..f745d323 100644 --- a/web/src/pages/ProvidersPage.test.tsx +++ b/web/src/pages/ProvidersPage.test.tsx @@ -3,9 +3,8 @@ import { render, screen, waitFor, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { MemoryRouter } from "react-router-dom"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import { PROVIDER_HEALTH_REFRESH_MS } from "@/api/hooks"; import type { GatewaySettings, @@ -169,10 +168,8 @@ function healthRequestCount(fetchMock: ReturnType): number { } describe("ProvidersPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("lists config and stored providers with provenance and redacted keys", async () => { diff --git a/web/src/pages/SettingsPage.test.tsx b/web/src/pages/SettingsPage.test.tsx index 0aec8e2f..0342b913 100644 --- a/web/src/pages/SettingsPage.test.tsx +++ b/web/src/pages/SettingsPage.test.tsx @@ -4,7 +4,6 @@ import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { ConfigField, GatewaySettings, ReencryptProviderCredentialsResult, StoredProvider } from "@/api/types"; import { AuthProvider } from "@/auth/AuthContext"; import { SettingsPage, fieldMatches } from "@/pages/SettingsPage"; @@ -158,13 +157,11 @@ function mockApi( describe("SettingsPage", () => { beforeEach(() => { - window.sessionStorage.setItem("otari.dashboard.masterKey", "test-master-key"); - setMasterKey("test-master-key"); + window.localStorage.setItem("otari.dashboard.hasSession", "1"); }); afterEach(() => { vi.restoreAllMocks(); - window.sessionStorage.clear(); - setMasterKey(null); + window.localStorage.clear(); }); it("reflects the current settings on its switches", async () => { @@ -217,7 +214,6 @@ describe("SettingsPage", () => { expect(revealedKey).toHaveAttribute("data-lpignore", "true"); expect(screen.getByRole("alertdialog", { name: "Master key regenerated" })).toBeInTheDocument(); expect(screen.getByText("Credential security")).toBeInTheDocument(); - expect(window.sessionStorage.getItem("otari.dashboard.masterKey")).toBe("otari-mk-new"); await user.keyboard("{Escape}"); expect(screen.getByDisplayValue("otari-mk-new")).toBeInTheDocument(); @@ -225,9 +221,11 @@ describe("SettingsPage", () => { await user.click(screen.getByRole("button", { name: "I’ve saved this key" })); expect(screen.queryByDisplayValue("otari-mk-new")).not.toBeInTheDocument(); + // Auth rides the HttpOnly session cookie (re-minted server-side by the + // rotation response), so requests carry no Authorization header at all. await user.click(screen.getByRole("switch", { name: "default_pricing" })); const patch = fetchMock.mock.calls.find(([, init]) => (init?.method ?? "") === "PATCH"); - expect(new Headers(patch?.[1]?.headers).get("Authorization")).toBe("Bearer otari-mk-new"); + expect(new Headers(patch?.[1]?.headers).get("Authorization")).toBeNull(); }); it("explains when a master key is managed in configuration", async () => { diff --git a/web/src/pages/SettingsPage.tsx b/web/src/pages/SettingsPage.tsx index 25eaa3c5..0990f8d4 100644 --- a/web/src/pages/SettingsPage.tsx +++ b/web/src/pages/SettingsPage.tsx @@ -12,7 +12,6 @@ import { useUpdateSettings, } from "@/api/hooks"; import type { ConfigField, PricingRefreshPreview, UpdateSettingsRequest } from "@/api/types"; -import { useAuth } from "@/auth/AuthContext"; import { ErrorBanner, FilterSelect, InfoBanner, PageHeader } from "@/components/ui"; // A single settable field maps onto one key of UpdateSettingsRequest. The keys @@ -397,16 +396,17 @@ function MasterKeyRotationDialog({ function MasterKeyRow({ source }: { source: "configured" | "generated" }) { const rotateMasterKey = useRotateMasterKey(); - const { replaceMasterKey } = useAuth(); const [dialogOpen, setDialogOpen] = useState(false); const [newKey, setNewKey] = useState(); const isGenerated = source === "generated"; + // Rotation revokes every dashboard session server-side and re-mints this + // tab's session cookie on the response, so no client-side credential swap + // is needed; the dialog only has to reveal the new key once. const rotate = () => rotateMasterKey.mutate(undefined, { onSuccess: (result) => { setNewKey(result.master_key); - replaceMasterKey(result.master_key); }, }); diff --git a/web/src/pages/ToolsGuardrailsPage.test.tsx b/web/src/pages/ToolsGuardrailsPage.test.tsx index 120055ce..f0cf2d67 100644 --- a/web/src/pages/ToolsGuardrailsPage.test.tsx +++ b/web/src/pages/ToolsGuardrailsPage.test.tsx @@ -2,9 +2,8 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { ToolSettingField, ToolSettingsResponse } from "@/api/types"; import { ToolsGuardrailsPage } from "@/pages/ToolsGuardrailsPage"; @@ -61,10 +60,8 @@ function mockApi(opts: MockOpts = {}) { } describe("ToolsGuardrailsPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("renders the three service sections and effective values", async () => { diff --git a/web/src/pages/UsagePage.test.tsx b/web/src/pages/UsagePage.test.tsx index e8a0d761..38112316 100644 --- a/web/src/pages/UsagePage.test.tsx +++ b/web/src/pages/UsagePage.test.tsx @@ -3,9 +3,8 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; import { MemoryRouter, Route, Routes, useLocation } from "react-router-dom"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { UsageSummary } from "@/api/types"; import { UsagePage } from "@/pages/UsagePage"; @@ -81,10 +80,8 @@ function renderPage(ui: ReactElement) { } describe("UsagePage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("renders totals tiles with compact currency and error rate", async () => { diff --git a/web/src/pages/UsersPage.test.tsx b/web/src/pages/UsersPage.test.tsx index f5c4cdb0..db519be9 100644 --- a/web/src/pages/UsersPage.test.tsx +++ b/web/src/pages/UsersPage.test.tsx @@ -2,9 +2,8 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ReactElement } from "react"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; -import { setMasterKey } from "@/api/client"; import type { Budget, User } from "@/api/types"; import { UsersPage } from "@/pages/UsersPage"; @@ -102,10 +101,8 @@ function renderPage(ui: ReactElement) { } describe("UsersPage", () => { - beforeEach(() => setMasterKey("test-master-key")); afterEach(() => { vi.restoreAllMocks(); - setMasterKey(null); }); it("shows onboarding when there are no users", async () => { From fcb0d3f9d9fddc7ccace3073558b077a2d38d3a6 Mon Sep 17 00:00:00 2001 From: njbrake Date: Thu, 23 Jul 2026 13:03:54 +0000 Subject: [PATCH 2/6] fix(dashboard): revoke sessions when the master key changes at startup Two follow-ups from self-review of the session-cookie change: - A dashboard session only proves possession of the master key at mint time, so it must not outlive the key. The generated key already revoked sessions inline at rotation, but a configured key rotates by changing OTARI_MASTER_KEY and restarting, which no request handler observes; pre-rotation sessions survived until their TTL. Store a hash of the effective key in runtime_settings and revoke every session at startup when it changes (covering configured-key rotation and configured/generated regime switches). The rotation endpoint keeps the marker in step so its re-minted session survives restarts. - Regenerate the Postman collection from the updated OpenAPI spec (make postman), which the openapi-spec CI job checks. Co-Authored-By: Claude Fable 5 --- docs/public/otari.postman_collection.json | 59 ++++++++++++++++++- src/gateway/api/routes/settings.py | 4 ++ src/gateway/main.py | 5 ++ .../services/dashboard_session_service.py | 58 +++++++++++++++++- tests/unit/test_dashboard_session.py | 39 ++++++++++++ 5 files changed, 162 insertions(+), 3 deletions(-) diff --git a/docs/public/otari.postman_collection.json b/docs/public/otari.postman_collection.json index 1c89d0ad..5ae52acb 100644 --- a/docs/public/otari.postman_collection.json +++ b/docs/public/otari.postman_collection.json @@ -211,6 +211,63 @@ ], "name": "audio" }, + { + "item": [ + { + "name": "Create Session", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"master_key\": \"string\"\n}" + }, + "description": "Verify the master key and set the HttpOnly session cookie.", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "auth", + "session" + ], + "raw": "{{baseUrl}}/v1/auth/session" + } + } + }, + { + "name": "Delete Session", + "request": { + "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore.", + "header": [], + "method": "DELETE", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "auth", + "session" + ], + "raw": "{{baseUrl}}/v1/auth/session" + } + } + } + ], + "name": "auth" + }, { "item": [ { @@ -1877,7 +1934,7 @@ { "name": "Rotate Master Key", "request": { - "description": "Regenerate the database-backed master key and invalidate the old one.\n\nOnly the first-run generated master key can be rotated here. When a master\nkey is supplied through config or ``OTARI_MASTER_KEY``, the dashboard cannot\ninvalidate it; the operator must change that value and restart instead.", + "description": "Regenerate the database-backed master key and invalidate the old one.\n\nOnly the first-run generated master key can be rotated here. When a master\nkey is supplied through config or ``OTARI_MASTER_KEY``, the dashboard cannot\ninvalidate it; the operator must change that value and restart instead.\n\nEvery dashboard session is revoked with the rotation (a session only proves\npossession of the now-dead key); the caller's own session is re-minted under\nthe new key so the tab that performed the rotation stays signed in.", "header": [], "method": "POST", "url": { diff --git a/src/gateway/api/routes/settings.py b/src/gateway/api/routes/settings.py index 9c50df11..aeb609f0 100644 --- a/src/gateway/api/routes/settings.py +++ b/src/gateway/api/routes/settings.py @@ -28,6 +28,7 @@ SESSION_COOKIE_NAME, apply_session_cookie, create_dashboard_session, + record_session_key_marker, revoke_all_dashboard_sessions, ) from gateway.services.master_key_service import ( @@ -395,6 +396,9 @@ async def rotate_master_key( try: token, hashed = await stage_generated_master_key_rotation(db, current_hash) await revoke_all_dashboard_sessions(db) + # Keep the startup key-change check in step, so a restart after this + # rotation does not revoke the session re-minted below. + await record_session_key_marker(db, hashed) if SESSION_COOKIE_NAME in request.cookies: session_token, session_expires_at = await create_dashboard_session( db, config.dashboard_session_ttl_hours diff --git a/src/gateway/main.py b/src/gateway/main.py index dd31856c..fba57e7d 100644 --- a/src/gateway/main.py +++ b/src/gateway/main.py @@ -19,6 +19,7 @@ from gateway.root_page import FAVICON_SVG, ROOT_TUTORIAL_HTML from gateway.services.alias_service import load_aliases_at_startup, reset_alias_cache, run_alias_refresher from gateway.services.bootstrap_service import bootstrap_first_api_key +from gateway.services.dashboard_session_service import revoke_sessions_on_master_key_change from gateway.services.file_store import build_file_store from gateway.services.log_writer import LogWriter, NoopLogWriter, create_log_writer from gateway.services.master_key_service import ensure_master_key @@ -122,6 +123,10 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: # so the dashboard is reachable without hand-editing config, and # the management API is never left unauthenticated. await ensure_master_key(config, session) + # Dashboard sessions must not outlive the key they were minted + # under: revoke them all when the master key changed across a + # restart (e.g. OTARI_MASTER_KEY was rotated). + await revoke_sessions_on_master_key_change(config, session) # Overlay dashboard-stored providers before pricing init, so a # provider added at runtime is visible to everything that reads # config.providers (pricing seeding, discovery, dispatch). diff --git a/src/gateway/services/dashboard_session_service.py b/src/gateway/services/dashboard_session_service.py index 63ac090c..d42dd06c 100644 --- a/src/gateway/services/dashboard_session_service.py +++ b/src/gateway/services/dashboard_session_service.py @@ -15,15 +15,26 @@ import hashlib import secrets from datetime import UTC, datetime, timedelta +from typing import Any, cast from fastapi import Response -from sqlalchemy import delete +from sqlalchemy import delete, update +from sqlalchemy.engine import CursorResult +from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.ext.asyncio import AsyncSession -from gateway.models.entities import DashboardSession +from gateway.core.config import GatewayConfig +from gateway.log_config import logger +from gateway.models.entities import DashboardSession, RuntimeSetting +from gateway.services.master_key_service import hash_master_key SESSION_COOKIE_NAME = "otari_dashboard_session" _SESSION_TOKEN_PREFIX = "otari-sess-" +# Stored in runtime_settings; ignored by runtime_settings_service (not a +# SETTABLE_KEY). Hash of the master key that existing sessions were minted +# under, so a key change across a restart revokes them (see +# revoke_sessions_on_master_key_change). +SESSION_KEY_MARKER = "dashboard_session_master_key_hash" def hash_session_token(token: str) -> str: @@ -69,6 +80,49 @@ async def revoke_all_dashboard_sessions(db: AsyncSession) -> None: await db.execute(delete(DashboardSession)) +async def record_session_key_marker(db: AsyncSession, key_hash: str) -> None: + """Stage the marker naming the master key sessions are minted under. + + Update-then-insert so it works whether or not the row exists yet; the + caller commits. + """ + result = cast( + CursorResult[Any], + await db.execute(update(RuntimeSetting).where(RuntimeSetting.key == SESSION_KEY_MARKER).values(value=key_hash)), + ) + if result.rowcount == 0: + db.add(RuntimeSetting(key=SESSION_KEY_MARKER, value=key_hash)) + + +async def revoke_sessions_on_master_key_change(config: GatewayConfig, db: AsyncSession) -> None: + """At startup, revoke every dashboard session if the master key changed. + + A session only proves possession of the master key at mint time, so it must + not outlive the key. The generated key rotates through the dashboard, which + revokes sessions inline; a configured key rotates by changing + ``OTARI_MASTER_KEY``/config and restarting, which no request handler + observes. Comparing a stored hash of the effective key here closes that + path (and any configured/generated regime switch). + + Best-effort like ``ensure_master_key``: a failure only skips this check for + the boot, and concurrent workers racing the first marker INSERT are benign. + """ + current = hash_master_key(config.master_key) if config.master_key is not None else config._master_key_hash + if current is None: + return + try: + row = await db.get(RuntimeSetting, SESSION_KEY_MARKER) + if row is not None and row.value == current: + return + if row is not None: + await revoke_all_dashboard_sessions(db) + await record_session_key_marker(db, current) + await db.commit() + except SQLAlchemyError: + await db.rollback() + logger.warning("Could not check dashboard sessions against the current master key; skipping for this boot.") + + def apply_session_cookie(response: Response, token: str, expires_at: datetime, *, secure: bool) -> None: """Set the session cookie with its security attributes in one place. diff --git a/tests/unit/test_dashboard_session.py b/tests/unit/test_dashboard_session.py index aa1b40be..c57016c4 100644 --- a/tests/unit/test_dashboard_session.py +++ b/tests/unit/test_dashboard_session.py @@ -119,6 +119,45 @@ def test_expired_sessions_stop_authenticating(tmp_path: Path) -> None: assert client.get("/v1/settings").status_code == 401 +def test_sessions_survive_a_restart_but_not_a_configured_key_change(tmp_path: Path) -> None: + db_url = f"sqlite:///{tmp_path / 'restart.db'}" + + def config_with(key: str) -> GatewayConfig: + return GatewayConfig(database_url=db_url, master_key=key, require_pricing=False) + + with TestClient(create_app(config_with(MASTER_KEY))) as client: + _sign_in(client) + cookie = client.cookies[SESSION_COOKIE_NAME] + + # Same key across a restart: the session (the whole point of #338) survives. + with TestClient(create_app(config_with(MASTER_KEY))) as client: + client.cookies.set(SESSION_COOKIE_NAME, cookie) + assert client.get("/v1/settings").status_code == 200 + + # Rotating OTARI_MASTER_KEY across a restart revokes every session: a + # session only proves possession of the old key and must die with it. + with TestClient(create_app(config_with("sk-rotated-master"))) as client: + client.cookies.set(SESSION_COOKIE_NAME, cookie) + assert client.get("/v1/settings").status_code == 401 + + +def test_rotation_then_restart_keeps_the_reminted_session(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + db_url = f"sqlite:///{tmp_path / 'rotate-restart.db'}" + monkeypatch.setattr(master_key_service, "generate_master_key", lambda: "otari-mk-first") + + with TestClient(create_app(GatewayConfig(database_url=db_url, require_pricing=False))) as client: + _sign_in(client, "otari-mk-first") + monkeypatch.setattr(master_key_service, "generate_master_key", lambda: "otari-mk-second") + assert client.post("/v1/settings/master-key/rotate").status_code == 200 + reminted = client.cookies[SESSION_COOKIE_NAME] + + # The startup key-change check must recognize the rotated key as current + # and keep the session the rotation re-minted. + with TestClient(create_app(GatewayConfig(database_url=db_url, require_pricing=False))) as client: + client.cookies.set(SESSION_COOKIE_NAME, reminted) + assert client.get("/v1/settings").status_code == 200 + + def test_rotation_revokes_other_sessions_and_reminting_keeps_the_caller_signed_in( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> None: From 67d1dc01ed12352cd255e12d0955b5af19ff2c80 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Thu, 23 Jul 2026 13:57:43 +0000 Subject: [PATCH 3/6] fix(dashboard): keep sign-out best-effort when revocation fails Raising a 500 on a DB failure during DELETE /v1/auth/session made FastAPI discard the injected response, so the cookie was never cleared while the frontend had already dropped its local marker: the browser kept a live session cookie the operator believed was gone. Sign-out now always clears the cookie and returns 204, logging the failed revocation; the unrevoked row dies on its TTL. Flagged by Copilot review on #384. Co-Authored-By: Claude Fable 5 --- src/gateway/api/routes/auth_session.py | 10 ++++++---- tests/unit/test_dashboard_session.py | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/gateway/api/routes/auth_session.py b/src/gateway/api/routes/auth_session.py index 43ec9332..218c29d0 100644 --- a/src/gateway/api/routes/auth_session.py +++ b/src/gateway/api/routes/auth_session.py @@ -17,6 +17,7 @@ from gateway.api.deps import get_config, get_db, is_valid_master_key from gateway.core.config import GatewayConfig +from gateway.log_config import logger from gateway.metrics import record_auth_failure from gateway.services.dashboard_session_service import ( SESSION_COOKIE_NAME, @@ -85,8 +86,9 @@ async def delete_session( await db.commit() except SQLAlchemyError: await db.rollback() - raise HTTPException( - status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - detail="Database error", - ) from None + # Raising here would skip the cookie clear below (FastAPI discards + # the injected response on an exception), leaving the browser with + # a live cookie the operator believes is gone. Clear it and return + # 204 anyway; the unrevoked row dies on its TTL. + logger.warning("Failed to revoke the dashboard session on sign-out", exc_info=True) clear_session_cookie(response) diff --git a/tests/unit/test_dashboard_session.py b/tests/unit/test_dashboard_session.py index c57016c4..2565ec44 100644 --- a/tests/unit/test_dashboard_session.py +++ b/tests/unit/test_dashboard_session.py @@ -12,8 +12,10 @@ import pytest from fastapi.testclient import TestClient from sqlalchemy import create_engine, update +from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.orm import sessionmaker +from gateway.api.routes import auth_session as auth_session_route from gateway.core.config import GatewayConfig from gateway.main import create_app from gateway.models.entities import DashboardSession @@ -103,6 +105,25 @@ def test_sign_out_without_a_session_is_a_no_op(tmp_path: Path) -> None: assert client.delete("/v1/auth/session").status_code == 204 +def test_sign_out_clears_the_cookie_even_when_revocation_fails( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + # A DB failure during revocation must not leave the browser holding a live + # cookie: sign-out stays best-effort (204 + cookie cleared) and the + # unrevoked session dies on its TTL. + async def _boom(db: object, token: str) -> None: + raise SQLAlchemyError("db down") + + monkeypatch.setattr(auth_session_route, "revoke_dashboard_session", _boom) + with TestClient(create_app(_config(tmp_path))) as client: + _sign_in(client) + response = client.delete("/v1/auth/session") + assert response.status_code == 204 + set_cookie = response.headers.get("set-cookie", "") + assert SESSION_COOKIE_NAME in set_cookie + assert 'expires=' in set_cookie.lower() or "max-age=0" in set_cookie.lower() + + def test_expired_sessions_stop_authenticating(tmp_path: Path) -> None: config = _config(tmp_path) with TestClient(create_app(config)) as client: From 22816af0e09263114d8033f415df00ca52bc0b25 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Thu, 23 Jul 2026 14:01:18 +0000 Subject: [PATCH 4/6] fix(dashboard): honor X-Forwarded-Proto for the session cookie Secure flag Behind a TLS-terminating proxy, uvicorn only trusts X-Forwarded-Proto from loopback by default, so request.url.scheme reads "http" on typical PaaS ingress and the session cookie was minted without Secure despite an HTTPS browser leg. Decide the Secure attribute from the effective scheme (direct https, or the first X-Forwarded-Proto value). Honoring the header regardless of source is safe for this decision alone: a spoofed "https" over plain HTTP only denies the spoofer their own cookie. Also covers the Secure=true branch in tests (direct HTTPS and forwarded proto), and documents two review-noted asymmetries: DELETE skipping the Sec-Fetch-Site check (SameSite already covers it; worst case is a forced sign-out) and Path=/ (management routes live beside inference under /v1, and the cookie grants nothing beyond master authority). Addresses khaledosman's review on #384. Co-Authored-By: Claude Fable 5 --- src/gateway/api/routes/auth_session.py | 8 +++-- src/gateway/api/routes/settings.py | 3 +- .../services/dashboard_session_service.py | 34 +++++++++++++++---- tests/unit/test_dashboard_session.py | 22 ++++++++++++ 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/gateway/api/routes/auth_session.py b/src/gateway/api/routes/auth_session.py index 218c29d0..7a36cad1 100644 --- a/src/gateway/api/routes/auth_session.py +++ b/src/gateway/api/routes/auth_session.py @@ -24,6 +24,7 @@ apply_session_cookie, clear_session_cookie, create_dashboard_session, + request_is_https, revoke_dashboard_session, ) @@ -63,7 +64,7 @@ async def create_session( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Database error", ) from None - apply_session_cookie(response, token, expires_at, secure=request.url.scheme == "https") + apply_session_cookie(response, token, expires_at, secure=request_is_https(request)) return SessionResponse(expires_at=expires_at) @@ -77,7 +78,10 @@ async def delete_session( Deliberately unauthenticated and idempotent: it only ever revokes the session named by the caller's own cookie, and the dashboard calls it on the - 401-bounce path where no valid credential exists anymore. + 401-bounce path where no valid credential exists anymore. Unlike the read + path in ``deps.py`` it applies no Sec-Fetch-Site check: ``SameSite=Strict`` + already keeps cross-site requests from carrying the cookie, and the worst a + forged call could do is sign the operator out. """ token = request.cookies.get(SESSION_COOKIE_NAME) if token: diff --git a/src/gateway/api/routes/settings.py b/src/gateway/api/routes/settings.py index aeb609f0..4d936eb4 100644 --- a/src/gateway/api/routes/settings.py +++ b/src/gateway/api/routes/settings.py @@ -29,6 +29,7 @@ apply_session_cookie, create_dashboard_session, record_session_key_marker, + request_is_https, revoke_all_dashboard_sessions, ) from gateway.services.master_key_service import ( @@ -412,5 +413,5 @@ async def rotate_master_key( raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Database error") from None config._master_key_hash = hashed if session_token is not None and session_expires_at is not None: - apply_session_cookie(response, session_token, session_expires_at, secure=request.url.scheme == "https") + apply_session_cookie(response, session_token, session_expires_at, secure=request_is_https(request)) return RotateMasterKeyResponse(master_key=token) diff --git a/src/gateway/services/dashboard_session_service.py b/src/gateway/services/dashboard_session_service.py index d42dd06c..f983e341 100644 --- a/src/gateway/services/dashboard_session_service.py +++ b/src/gateway/services/dashboard_session_service.py @@ -17,7 +17,7 @@ from datetime import UTC, datetime, timedelta from typing import Any, cast -from fastapi import Response +from fastapi import Request, Response from sqlalchemy import delete, update from sqlalchemy.engine import CursorResult from sqlalchemy.exc import SQLAlchemyError @@ -123,15 +123,35 @@ async def revoke_sessions_on_master_key_change(config: GatewayConfig, db: AsyncS logger.warning("Could not check dashboard sessions against the current master key; skipping for this boot.") +def request_is_https(request: Request) -> bool: + """Whether the browser leg of this request is HTTPS, for the Secure flag. + + Behind a TLS-terminating proxy, uvicorn only honors ``X-Forwarded-Proto`` + from trusted IPs (loopback by default), so ``request.url.scheme`` reads + "http" on typical PaaS ingress despite an HTTPS browser leg. Honor the + header here regardless of source: it only decides the cookie's ``Secure`` + attribute, and a spoofed "https" over plain HTTP merely denies the spoofer + their own session cookie. + """ + if request.url.scheme == "https": + return True + forwarded = request.headers.get("X-Forwarded-Proto", "") + return forwarded.split(",")[0].strip().lower() == "https" + + def apply_session_cookie(response: Response, token: str, expires_at: datetime, *, secure: bool) -> None: """Set the session cookie with its security attributes in one place. - ``secure`` mirrors the request scheme rather than being hard-coded: a plain - HTTP deployment (LAN, localhost without TLS) would otherwise never receive - the cookie back. That is no worse than such a deployment already sending the - raw master key in cleartext today. ``SameSite=Strict`` keeps cross-site - requests from carrying the cookie, which is the primary CSRF control here - (the dashboard and API are same-origin). + ``secure`` mirrors the effective request scheme (``request_is_https``) + rather than being hard-coded: a plain HTTP deployment (LAN, localhost + without TLS) would otherwise never receive the cookie back. That is no + worse than such a deployment already sending the raw master key in + cleartext today. ``SameSite=Strict`` keeps cross-site requests from + carrying the cookie, which is the primary CSRF control here (the dashboard + and API are same-origin). ``Path=/`` is as narrow as the surface allows: + the management routes live directly under ``/v1`` beside inference, so the + cookie reaches inference paths too; that grants nothing beyond what master + authority already has, and cross-site use is blocked by SameSite. """ max_age = max(0, int((expires_at - datetime.now(UTC)).total_seconds())) response.set_cookie( diff --git a/tests/unit/test_dashboard_session.py b/tests/unit/test_dashboard_session.py index 2565ec44..f430e8ff 100644 --- a/tests/unit/test_dashboard_session.py +++ b/tests/unit/test_dashboard_session.py @@ -59,6 +59,28 @@ def test_sign_in_sets_cookie_and_cookie_authenticates_management_reads(tmp_path: assert settings.status_code == 200, settings.text +def test_https_requests_get_a_secure_cookie(tmp_path: Path) -> None: + with TestClient(create_app(_config(tmp_path)), base_url="https://testserver") as client: + response = client.post("/v1/auth/session", json={"master_key": MASTER_KEY}) + assert response.status_code == 200, response.text + assert "secure" in response.headers["set-cookie"].lower() + + +def test_forwarded_https_gets_a_secure_cookie(tmp_path: Path) -> None: + # Behind a TLS-terminating proxy the ASGI scheme often reads "http" + # (uvicorn only trusts X-Forwarded-Proto from loopback); the Secure + # decision must honor the forwarded proto so the common PaaS deployment + # is not silently downgraded. + with TestClient(create_app(_config(tmp_path))) as client: + response = client.post( + "/v1/auth/session", + json={"master_key": MASTER_KEY}, + headers={"X-Forwarded-Proto": "https"}, + ) + assert response.status_code == 200, response.text + assert "secure" in response.headers["set-cookie"].lower() + + def test_sign_in_rejects_a_wrong_key_without_setting_a_cookie(tmp_path: Path) -> None: with TestClient(create_app(_config(tmp_path))) as client: response = client.post("/v1/auth/session", json={"master_key": "not-the-master-key"}) From 71576061743a82a9f1323826b58da87ef5314667 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Thu, 23 Jul 2026 14:12:36 +0000 Subject: [PATCH 5/6] fix(dashboard): log sign-in session persistence failures The create_session 500 branch discarded the SQLAlchemyError without a trace, unlike the parallel branch in delete_session; a sign-in outage would have been invisible in the logs. Flagged by CodeRabbit on #384. Co-Authored-By: Claude Fable 5 --- src/gateway/api/routes/auth_session.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gateway/api/routes/auth_session.py b/src/gateway/api/routes/auth_session.py index 7a36cad1..6aaadb19 100644 --- a/src/gateway/api/routes/auth_session.py +++ b/src/gateway/api/routes/auth_session.py @@ -60,6 +60,8 @@ async def create_session( await db.commit() except SQLAlchemyError: await db.rollback() + # Generic error to the client; the raw failure is only logged here. + logger.warning("Failed to persist a dashboard session on sign-in", exc_info=True) raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Database error", From 72977560b3d3f8a21ab32337e93d5116a3377b13 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Thu, 23 Jul 2026 14:37:39 +0000 Subject: [PATCH 6/6] chore(dashboard): regenerate bundle and API artifacts after rebase Rebuild the committed dashboard bundle, OpenAPI spec, and Postman collection from the tree rebased onto main, folding in main's dashboard and API changes (#383, #385, #388). Co-Authored-By: Claude Fable 5 --- docs/public/openapi.json | 80 ++++++++++++++++++- docs/public/otari.postman_collection.json | 31 ++++++- .../dashboard/assets/ActivityPage-BS_KZH0z.js | 9 --- .../dashboard/assets/ActivityPage-C0gVlZW-.js | 5 -- .../dashboard/assets/ActivityPage-D3mR-Vcr.js | 13 --- ...e-Dm6r6wPy.js => ActivityPage-Ixi7_M5Z.js} | 2 +- ...ge-AOThQmDL.js => AliasesPage-BZiGtRPE.js} | 2 +- .../dashboard/assets/AliasesPage-DJtTC87k.js | 13 --- .../dashboard/assets/AliasesPage-O7ZGijD-.js | 9 --- .../dashboard/assets/AliasesPage-mAjq9eh5.js | 5 -- .../dashboard/assets/BudgetsPage-9zpV4nTH.js | 9 --- .../dashboard/assets/BudgetsPage-BCAQ5J9W.js | 13 --- ...ge-o3Sj5U5B.js => BudgetsPage-D0M-Cd5s.js} | 2 +- .../dashboard/assets/BudgetsPage-Us4jYLgv.js | 5 -- .../static/dashboard/assets/Field-gj3-ox4q.js | 1 - .../dashboard/assets/KeysPage-BhG598Pa.js | 8 -- ...sPage-CbUCEimJ.js => KeysPage-CQj72SEP.js} | 2 +- .../dashboard/assets/KeysPage-DAGeWeBS.js | 12 --- .../dashboard/assets/KeysPage-DIt3Gp89.js | 16 ---- .../assets/ModelScopeControl-CNKA1fyP.js | 5 -- .../assets/ModelScopeControl-CxWug9wa.js | 9 --- ...o36Ko.js => ModelScopeControl-DX341Q9L.js} | 2 +- .../assets/ModelScopeControl-D_p9BPKF.js | 13 --- ...age-WLlH9ed9.js => ModelsPage-BIdxI_hW.js} | 2 +- .../dashboard/assets/ModelsPage-BR6bzhht.js | 13 --- .../dashboard/assets/ModelsPage-DI7qj4qI.js | 9 --- .../dashboard/assets/ModelsPage-DaewNAhO.js | 5 -- .../dashboard/assets/OverviewPage-BYSSsHzo.js | 5 -- ...e-BHX_G4X9.js => OverviewPage-CtvPFoWc.js} | 2 +- .../dashboard/assets/OverviewPage-DXIwdDWG.js | 1 - .../dashboard/assets/OverviewPage-_Gja1ZBt.js | 1 - .../assets/ProvidersPage-BJkEklg1.js | 9 --- .../assets/ProvidersPage-Bz-mLWy0.js | 1 - ...-B6Y7usRU.js => ProvidersPage-DimvEH7H.js} | 2 +- .../assets/ProvidersPage-swJiAs79.js | 5 -- .../dashboard/assets/SettingsPage-BNeqLlOB.js | 1 - .../dashboard/assets/SettingsPage-CLdo7bKV.js | 1 - .../dashboard/assets/SettingsPage-CVx7wSlF.js | 1 - ...e-BzPdd2gR.js => SettingsPage-iRP-TsYX.js} | 2 +- .../static/dashboard/assets/Table-DEsIhjZo.js | 1 - ...8Wi.js => ToolsGuardrailsPage-B3QvV7KI.js} | 2 +- .../assets/ToolsGuardrailsPage-ChC-YhRl.js | 1 - .../assets/ToolsGuardrailsPage-qp13etCg.js | 1 - .../assets/ToolsGuardrailsPage-v1VWfWQq.js | 1 - .../dashboard/assets/UsagePage-BVzIiui8.js | 5 -- ...Page-DLrkG3qL.js => UsagePage-CsWlUWCg.js} | 2 +- .../dashboard/assets/UsagePage-DU8IagMv.js | 1 - .../dashboard/assets/UsagePage-DtQni_qk.js | 1 - .../dashboard/assets/UsersPage-BDaNeswz.js | 13 --- .../dashboard/assets/UsersPage-BxkuFQkF.js | 5 -- .../dashboard/assets/UsersPage-CNthhRRV.js | 9 --- ...Page-DjQ_32XA.js => UsersPage-ETfq5MXh.js} | 2 +- .../dashboard/assets/heroui-CewI8xK4.js | 20 ----- .../static/dashboard/assets/index-CSyrpBqZ.js | 2 - .../static/dashboard/assets/index-D1FfVwkg.js | 2 - .../static/dashboard/assets/index-D6YDX-oj.js | 2 - .../dashboard/assets/index-DFtD8NLS.css | 1 - .../dashboard/assets/index-Dl_VAUga.css | 1 - .../static/dashboard/assets/index-Dp4DdBFR.js | 2 - .../static/dashboard/assets/index-hDVMDLdX.js | 2 + .../static/dashboard/assets/react-q-ooZ0ti.js | 52 ------------ .../assets/tanstack-query-W9y7rsMr.js | 9 --- src/gateway/static/dashboard/index.html | 10 +-- 63 files changed, 124 insertions(+), 349 deletions(-) delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js rename src/gateway/static/dashboard/assets/{ActivityPage-Dm6r6wPy.js => ActivityPage-Ixi7_M5Z.js} (96%) rename src/gateway/static/dashboard/assets/{AliasesPage-AOThQmDL.js => AliasesPage-BZiGtRPE.js} (92%) delete mode 100644 src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js delete mode 100644 src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js delete mode 100644 src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js delete mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js delete mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js rename src/gateway/static/dashboard/assets/{BudgetsPage-o3Sj5U5B.js => BudgetsPage-D0M-Cd5s.js} (96%) delete mode 100644 src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js delete mode 100644 src/gateway/static/dashboard/assets/Field-gj3-ox4q.js delete mode 100644 src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js rename src/gateway/static/dashboard/assets/{KeysPage-CbUCEimJ.js => KeysPage-CQj72SEP.js} (97%) delete mode 100644 src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js delete mode 100644 src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js delete mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js delete mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js rename src/gateway/static/dashboard/assets/{ModelScopeControl-Bpbo36Ko.js => ModelScopeControl-DX341Q9L.js} (93%) delete mode 100644 src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js rename src/gateway/static/dashboard/assets/{ModelsPage-WLlH9ed9.js => ModelsPage-BIdxI_hW.js} (99%) delete mode 100644 src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js delete mode 100644 src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js delete mode 100644 src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js delete mode 100644 src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js rename src/gateway/static/dashboard/assets/{OverviewPage-BHX_G4X9.js => OverviewPage-CtvPFoWc.js} (99%) delete mode 100644 src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js delete mode 100644 src/gateway/static/dashboard/assets/OverviewPage-_Gja1ZBt.js delete mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js delete mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js rename src/gateway/static/dashboard/assets/{ProvidersPage-B6Y7usRU.js => ProvidersPage-DimvEH7H.js} (99%) delete mode 100644 src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js delete mode 100644 src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js delete mode 100644 src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js delete mode 100644 src/gateway/static/dashboard/assets/SettingsPage-CVx7wSlF.js rename src/gateway/static/dashboard/assets/{SettingsPage-BzPdd2gR.js => SettingsPage-iRP-TsYX.js} (93%) delete mode 100644 src/gateway/static/dashboard/assets/Table-DEsIhjZo.js rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-OKm-s8Wi.js => ToolsGuardrailsPage-B3QvV7KI.js} (99%) delete mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js delete mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js delete mode 100644 src/gateway/static/dashboard/assets/ToolsGuardrailsPage-v1VWfWQq.js delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js rename src/gateway/static/dashboard/assets/{UsagePage-DLrkG3qL.js => UsagePage-CsWlUWCg.js} (99%) delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-DtQni_qk.js delete mode 100644 src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js delete mode 100644 src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js delete mode 100644 src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js rename src/gateway/static/dashboard/assets/{UsersPage-DjQ_32XA.js => UsersPage-ETfq5MXh.js} (94%) delete mode 100644 src/gateway/static/dashboard/assets/heroui-CewI8xK4.js delete mode 100644 src/gateway/static/dashboard/assets/index-CSyrpBqZ.js delete mode 100644 src/gateway/static/dashboard/assets/index-D1FfVwkg.js delete mode 100644 src/gateway/static/dashboard/assets/index-D6YDX-oj.js delete mode 100644 src/gateway/static/dashboard/assets/index-DFtD8NLS.css delete mode 100644 src/gateway/static/dashboard/assets/index-Dl_VAUga.css delete mode 100644 src/gateway/static/dashboard/assets/index-Dp4DdBFR.js create mode 100644 src/gateway/static/dashboard/assets/index-hDVMDLdX.js delete mode 100644 src/gateway/static/dashboard/assets/react-q-ooZ0ti.js delete mode 100644 src/gateway/static/dashboard/assets/tanstack-query-W9y7rsMr.js diff --git a/docs/public/openapi.json b/docs/public/openapi.json index 8832ac84..29479577 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -1827,7 +1827,7 @@ "type": "object" }, "KnownProviderSchema": { - "description": "A provider the add-provider picker can offer, with autofill hints.", + "description": "A selected provider's autofill hints for the add-provider form.", "properties": { "default_api_base": { "anyOf": [ @@ -1883,6 +1883,27 @@ "title": "KnownProviderSchema", "type": "object" }, + "KnownProviderSummarySchema": { + "description": "A provider offered in the add-provider picker: id and display name only.", + "properties": { + "id": { + "description": "any-llm provider id, used as the default instance name.", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Human-friendly display name.", + "title": "Name", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "title": "KnownProviderSummarySchema", + "type": "object" + }, "McpServerConfig": { "description": "Inline MCP server configuration accepted on the chat completions request.\n\nStreamable HTTP transport. The `url` must be reachable from the gateway process.\n\nURL safety (SSRF guard against private/link-local/reserved IP ranges, plus\nrejecting plain ``http://`` when ``authorization_token`` is set) is\nenforced by :func:`gateway.services.url_safety.validate_mcp_url`, called\nfrom the async request pipeline (``prepare_gateway_tools``) rather than\nhere at parse time: the safety check does a DNS lookup, which must be\nawaited so it can't block the event loop, and Pydantic validators run\nsynchronously during request-body parsing.", "properties": { @@ -5680,7 +5701,7 @@ }, "/v1/auth/session": { "delete": { - "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore.", + "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore. Unlike the read\npath in ``deps.py`` it applies no Sec-Fetch-Site check: ``SameSite=Strict``\nalready keeps cross-site requests from carrying the cookie, and the worst a\nforged call could do is sign the operator out.", "operationId": "delete_session_v1_auth_session_delete", "responses": { "204": { @@ -8243,7 +8264,7 @@ }, "/v1/providers/catalog": { "get": { - "description": "List every known provider for the add-provider picker.\n\nNetwork-free and config-independent: the full any-llm provider set with each\none's display name, credential env var, default endpoint, and whether it\nneeds a key. Master-key gated because it is operator-facing dashboard data.", + "description": "List every known provider for the add-provider picker: id and name only.\n\nLightweight by design so the picker never lags: provider ids come from the\nany-llm registry and names from the bundled genai-prices dataset, so no\nprovider SDK is imported. The autofill hints for a chosen provider come from\nGET /v1/providers/catalog/{provider_id}, which imports only that one SDK.\nMaster-key gated because it is operator-facing dashboard data.", "operationId": "provider_catalog_v1_providers_catalog_get", "responses": { "200": { @@ -8251,7 +8272,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/KnownProviderSchema" + "$ref": "#/components/schemas/KnownProviderSummarySchema" }, "title": "Response Provider Catalog V1 Providers Catalog Get", "type": "array" @@ -8275,6 +8296,57 @@ ] } }, + "/v1/providers/catalog/{provider_id}": { + "get": { + "description": "Autofill hints for one provider the add-provider form has selected.\n\nImports only the selected provider's any-llm module (not the whole catalog)\nto report its credential env var, default endpoint, whether a key is required,\nand whether that env var is already set on the server. Returns 404 for an\nunknown provider id. Master-key gated because it is operator-facing.\n\nThe SDK import is offloaded to a worker thread: the first fetch for a given\nprovider imports that provider's module, which would otherwise block the event\nloop (and thus every concurrent request) for the import's duration.", + "operationId": "provider_catalog_detail_v1_providers_catalog__provider_id__get", + "parameters": [ + { + "in": "path", + "name": "provider_id", + "required": true, + "schema": { + "title": "Provider Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KnownProviderSchema" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "XApiKeyAuth": [] + } + ], + "summary": "Provider Catalog Detail", + "tags": [ + "providers" + ] + } + }, "/v1/providers/health": { "get": { "description": "Report every configured provider's reachability, with a last-checked time.\n\nReuses the per-provider model-discovery test path, so a provider is healthy\nwhen its credentials can list models. Results are served from the discovery\ncache (cheap enough to poll), so ``checked_at`` reflects when each provider\nwas actually dialed. Pass ``refresh=true`` to force a live re-dial of every\nprovider. Master-key gated because it describes the gateway's own providers.", diff --git a/docs/public/otari.postman_collection.json b/docs/public/otari.postman_collection.json index 5ae52acb..6635c3f6 100644 --- a/docs/public/otari.postman_collection.json +++ b/docs/public/otari.postman_collection.json @@ -249,7 +249,7 @@ { "name": "Delete Session", "request": { - "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore.", + "description": "Sign out: revoke the cookie's session server-side and expire the cookie.\n\nDeliberately unauthenticated and idempotent: it only ever revokes the\nsession named by the caller's own cookie, and the dashboard calls it on the\n401-bounce path where no valid credential exists anymore. Unlike the read\npath in ``deps.py`` it applies no Sec-Fetch-Site check: ``SameSite=Strict``\nalready keeps cross-site requests from carrying the cookie, and the worst a\nforged call could do is sign the operator out.", "header": [], "method": "DELETE", "url": { @@ -1759,7 +1759,7 @@ { "name": "Provider Catalog", "request": { - "description": "List every known provider for the add-provider picker.\n\nNetwork-free and config-independent: the full any-llm provider set with each\none's display name, credential env var, default endpoint, and whether it\nneeds a key. Master-key gated because it is operator-facing dashboard data.", + "description": "List every known provider for the add-provider picker: id and name only.\n\nLightweight by design so the picker never lags: provider ids come from the\nany-llm registry and names from the bundled genai-prices dataset, so no\nprovider SDK is imported. The autofill hints for a chosen provider come from\nGET /v1/providers/catalog/{provider_id}, which imports only that one SDK.\nMaster-key gated because it is operator-facing dashboard data.", "header": [], "method": "GET", "url": { @@ -1775,6 +1775,33 @@ } } }, + { + "name": "Provider Catalog Detail", + "request": { + "description": "Autofill hints for one provider the add-provider form has selected.\n\nImports only the selected provider's any-llm module (not the whole catalog)\nto report its credential env var, default endpoint, whether a key is required,\nand whether that env var is already set on the server. Returns 404 for an\nunknown provider id. Master-key gated because it is operator-facing.\n\nThe SDK import is offloaded to a worker thread: the first fetch for a given\nprovider imports that provider's module, which would otherwise block the event\nloop (and thus every concurrent request) for the import's duration.", + "header": [], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "providers", + "catalog", + ":provider_id" + ], + "raw": "{{baseUrl}}/v1/providers/catalog/:provider_id", + "variable": [ + { + "description": "path parameter", + "key": "provider_id", + "value": "" + } + ] + } + } + }, { "name": "Provider Health", "request": { diff --git a/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js b/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js deleted file mode 100644 index a2889361..00000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D6YDX-oj.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js b/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js deleted file mode 100644 index aa520429..00000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js b/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js deleted file mode 100644 index c63df734..00000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-D3mR-Vcr.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-Dp4DdBFR.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D6YDX-oj.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-CSyrpBqZ.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-C0gVlZW-.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ActivityPage-BS_KZH0z.js diff --git a/src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js b/src/gateway/static/dashboard/assets/ActivityPage-Ixi7_M5Z.js similarity index 96% rename from src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js rename to src/gateway/static/dashboard/assets/ActivityPage-Ixi7_M5Z.js index 49c7c7a2..53db752a 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-Dm6r6wPy.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-Ixi7_M5Z.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{u as le,r as n}from"./react-q-ooZ0ti.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-D1FfVwkg.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-DEsIhjZo.js";import{B as f,S as ge}from"./heroui-CewI8xK4.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{u as le,r as n}from"./react-dgEcD0HR.js";import{u as re,a as ne,b as ie,c as oe,P as ce,E as de,F as G,d as Y}from"./index-hDVMDLdX.js";import{T as ue,a as me,b as d,L as xe,c as he,d as pe,e as u}from"./Table-CLdjdyTx.js";import{B as f,S as ge}from"./heroui-BX6JwHY-.js";const je=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function _(t){return t===null?"—":je.format(t)}function o(t){return t===null?"—":t.toLocaleString()}function Z(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ve(t){const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString()}function be(t){const a=new Date(t).getTime();if(Number.isNaN(a))return t;const r=Math.max(0,Math.round((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const i=Math.round(r/60);if(i<60)return`${i}m ago`;const m=Math.round(i/60);return m<24?`${m}h ago`:`${Math.round(m/24)}d ago`}const fe=3600,k=86400,Ne=[{label:"Last hour",seconds:fe},{label:"24h",seconds:k},{label:"7d",seconds:7*k},{label:"All",seconds:null}],Se=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],_e=["/v1/chat/completions","/v1/messages","/v1/responses","/v1/embeddings","/v1/moderations","/v1/audio/transcriptions","/v1/audio/speech","/v1/images/generations","/v1/rerank","/v1/batches","/v1/batches/results"],N=50;function D(t){return new Date(Date.now()-t*1e3).toISOString()}function ke({status:t}){const a=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${a}`,children:t})}function l({label:t,children:a}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:a})]})}function we({entry:t}){var a;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"})}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"The provider returned an error. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Provider",children:t.provider??"—"}),e.jsx(l,{label:"Endpoint",children:t.endpoint}),e.jsx(l,{label:"User",children:t.user_id??"—"}),e.jsx(l,{label:"API key",children:t.api_key_id??"—"}),e.jsx(l,{label:"Prompt tokens",children:o(t.prompt_tokens)}),e.jsx(l,{label:"Completion tokens",children:o(t.completion_tokens)}),e.jsx(l,{label:"Total tokens",children:o(t.total_tokens)}),e.jsx(l,{label:"Cost",children:_(t.cost)}),e.jsx(l,{label:"Cache read tokens",children:o(t.cache_read_tokens)}),e.jsx(l,{label:"Cache write tokens",children:o(t.cache_write_tokens)}),e.jsx(l,{label:"1h cache writes",children:o(t.cache_write_1h_tokens??null)}),e.jsx(l,{label:"Total time",children:Z(t.latency_ms)}),e.jsx(l,{label:"Request ID",children:t.id})]}),(a=t.pricing_breakdown)!=null&&a.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(l,{label:r.meter.replaceAll("_"," "),children:[o(r.units)," at ",_(r.rate_per_million)," / 1M, ",_(r.cost)]},r.meter))})]}):null]})}const A=7;function Ce(){var B,z,H;const t=re(),[a]=le(),r=a.get("start_date")??void 0,[i,m]=n.useState(r?null:k),[S,w]=n.useState(()=>r??D(k)),[x,C]=n.useState(()=>a.get("status")??""),[c,M]=n.useState(()=>a.get("model")??""),[h,$]=n.useState(""),[p,U]=n.useState(()=>a.get("user_id")??""),[j,T]=n.useState(0),[J,K]=n.useState(null),P=n.useMemo(()=>({start_date:S,status:x||void 0,model:c.trim()||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,c,h,p]);n.useEffect(()=>{T(0)},[P]);const g=ne(P,j,N),v=ie(P),Q=n.useMemo(()=>({start_date:S,status:x||void 0,endpoint:h||void 0,user_id:p||void 0}),[S,x,h,p]),F=((z=(B=oe(Q,"day").data)==null?void 0:B.by_model)==null?void 0:z.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],b=g.data??[],E=((H=v.data)==null?void 0:H.total)??0,I=!!(x||c.trim()||h||p||i!==null),V=s=>{m(s),w(s===null?void 0:D(s))},W=()=>{m(null),w(void 0),C(""),M(""),$(""),U("")},X=()=>{i!==null&&w(D(i)),g.refetch(),v.refetch()},L=b.length>0,O=L?j*N+1:0,R=j*N+b.length,q=v.isSuccess&&!v.isPlaceholderData,ee=q?E===0?"0 of 0":`${O}–${R} of ${E.toLocaleString()}`:L?`${O}–${R}`:"0",se=q?(j+1)*Ne.jsx(f,{size:"sm",variant:i===s.seconds?"primary":"outline",onPress:()=>V(s.seconds),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(G,{id:"filter-status",label:"Status",value:x,onChange:C,children:Se.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(G,{id:"filter-endpoint",label:"Endpoint",value:h,onChange:$,children:[e.jsx("option",{value:"",children:"All endpoints"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Y,{label:"User",value:p,onChange:U,placeholder:"All users",options:(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id}))}),e.jsx(Y,{label:"Model",value:c,onChange:M,allowsCustom:!0,placeholder:"Any model",options:(c&&!F.includes(c)?[c,...F]:F).map(s=>({value:s,label:s}))}),I?e.jsx(f,{size:"sm",variant:"ghost",onPress:W,children:"Clear filters"}):null]})]}),e.jsxs(ue,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(d,{children:"Time"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Model"}),e.jsx(d,{className:"text-right",children:"Tokens"}),e.jsx(d,{className:"text-right",children:"Cost"}),e.jsx(d,{className:"text-right",children:"Total time"}),e.jsx(d,{children:"Status"})]})}),e.jsx("tbody",{children:g.isLoading?e.jsx(xe,{colSpan:A}):b.length===0?e.jsx(he,{colSpan:A,children:I?"No requests match these filters.":"No requests recorded yet."}):b.map(s=>{const te=s.status==="error",y=J===s.id;return e.jsxs(n.Fragment,{children:[e.jsxs(pe,{selected:y,className:te?"bg-red-50":"",onClick:()=>K(ae=>ae===s.id?null:s.id),children:[e.jsx(u,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:ve(s.timestamp),children:be(s.timestamp)})}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.user_id??"—"}),e.jsx(u,{className:"text-[var(--otari-ink)]",children:s.model}),e.jsx(u,{className:"text-right tabular-nums",children:o(s.total_tokens)}),e.jsx(u,{className:"text-right tabular-nums",children:_(s.cost)}),e.jsx(u,{className:"text-right tabular-nums",children:Z(s.latency_ms)}),e.jsx(u,{children:e.jsx(ke,{status:s.status})})]}),y?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:A,children:e.jsx(we,{entry:s})})}):null]},s.id)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[ee,g.isFetching?e.jsx(ge,{size:"sm"}):null]}),e.jsxs("span",{className:"inline-flex gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:j===0,onPress:()=>T(s=>Math.max(0,s-1)),children:"Previous"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:!se,onPress:()=>T(s=>s+1),children:"Next"})]})]})]})}export{Ce as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js b/src/gateway/static/dashboard/assets/AliasesPage-BZiGtRPE.js similarity index 92% rename from src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js rename to src/gateway/static/dashboard/assets/AliasesPage-BZiGtRPE.js index 6eb1c32d..9ca48644 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-BZiGtRPE.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-hDVMDLdX.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js b/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js deleted file mode 100644 index 430c3568..00000000 --- a/src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-DJtTC87k.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-Dp4DdBFR.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D6YDX-oj.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js diff --git a/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js b/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js deleted file mode 100644 index 93b3cf4e..00000000 --- a/src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-O7ZGijD-.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,u as w}from"./react-dgEcD0HR.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D6YDX-oj.js";import{F}from"./Field-HzRk1KDP.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,d as C}from"./heroui-BX6JwHY-.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-CLdjdyTx.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js diff --git a/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js b/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js deleted file mode 100644 index 0cec29e1..00000000 --- a/src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/AliasesPage-mAjq9eh5.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-CSyrpBqZ.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as x,u as w}from"./react-q-ooZ0ti.js";import{e as L,f as E,g as B,P as D,E as N,C as I,h as M,i as A}from"./index-D1FfVwkg.js";import{F}from"./Field-gj3-ox4q.js";import{C as j,L as R,I as q,a as V,b as H,B as h,f as $,c as C}from"./heroui-CewI8xK4.js";import{T as z,a as G,d as T,b as f,L as K,c as W,e as v}from"./Table-DEsIhjZo.js";const X=50;function k({label:t,value:n,onChange:a,description:r,placeholder:m="provider:model",autoFocus:i,isRequired:c}){const l=L(),{visible:d,total:s,failed:g}=x.useMemo(()=>{var S;const o=n.trim().toLowerCase(),p=((S=l.data)==null?void 0:S.providers)??[],y=p.flatMap(u=>u.models),P=o?y.filter(u=>u.key.toLowerCase().includes(o)):y;return{visible:P.slice(0,X),total:P.length,failed:p.filter(u=>!u.ok)}},[l.data,n]),b=l.isLoading?"Loading models from your providers…":g.length>0?`Could not list models for ${g.map(p=>p.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:s>d.length?`Showing ${d.length} of ${s} matches. Keep typing to narrow them.`:r;return e.jsxs(j.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:n,onInputChange:a,onSelectionChange:o=>{o!=null&&a(String(o))},isRequired:c,className:"flex max-w-md flex-col gap-1",children:[e.jsx(R,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(j.InputGroup,{children:[e.jsx(q,{placeholder:m,autoFocus:i}),e.jsx(j.Trigger,{})]}),e.jsx(j.Popover,{children:e.jsx(V,{items:d,className:"max-h-72 overflow-auto",children:o=>e.jsx(H,{id:o.key,textValue:o.key,children:o.key})})}),b?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:b}):null]})}function _({alias:t,onClose:n}){const a=A(),[r,m]=x.useState(t.target),i=r.trim()!==""&&r.trim()!==t.target,c=()=>{i&&a.mutate({name:t.name,target:r.trim()},{onSuccess:n})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name})]}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The alias name is the key and cannot be changed here. Delete and recreate to rename."})]}),e.jsx(k,{label:"Target",value:r,onChange:m,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!i||a.isPending,onPress:c,children:a.isPending?"Saving…":"Save changes"}),e.jsx(h,{variant:"ghost",onPress:n,children:"Cancel"})]})]})})}function J({onClose:t,initialTarget:n=""}){const a=A(),[r,m]=x.useState(""),[i,c]=x.useState(n),l=/[:/]/.test(r),d=r.trim()!==""&&i.trim()!==""&&!l,s=()=>{d&&a.mutate({name:r.trim(),target:i.trim()},{onSuccess:t})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(N,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(F,{label:"Alias name",value:r,onChange:m,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:l?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(k,{label:"Target",value:i,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"primary",isDisabled:!d||a.isPending,onPress:s,children:a.isPending?"Creating…":"Create alias"}),e.jsx(h,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function se(){const t=E(),n=B(),[a]=w(),r=a.get("target")??"",[m,i]=x.useState(r!==""),[c,l]=x.useState(null),d=[...t.data??[]].sort((s,g)=>s.name.localeCompare(g.name));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(D,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:m||c?null:e.jsx(h,{variant:"primary",onPress:()=>{l(null),i(!0)},children:"New alias"})}),e.jsx(N,{error:t.error}),m?e.jsx(J,{initialTarget:r,onClose:()=>i(!1)}):null,c?e.jsx(_,{alias:c,onClose:()=>l(null)}):null,e.jsxs(z,{children:[e.jsx(G,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Alias"}),e.jsx(f,{children:"Target"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.isLoading?e.jsx(K,{colSpan:4}):d.length===0?e.jsx(W,{colSpan:4,children:"No aliases yet. Create one to give a model a friendly name."}):d.map(s=>e.jsxs(T,{children:[e.jsx(v,{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name}),e.jsx(v,{className:"break-all text-[var(--otari-muted)]",children:s.target}),e.jsx(v,{children:e.jsx($,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})}),e.jsx(v,{className:"text-right whitespace-nowrap",children:s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(h,{size:"sm",variant:"ghost",onPress:()=>{i(!1),l(s)},children:"Edit"}),e.jsx(I,{confirmLabel:"Delete",isPending:n.isPending,onConfirm:()=>n.mutate(s.name),children:"Delete"}),n.error?e.jsx("span",{className:"text-xs text-red-700",children:M(n.error)}):null]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})})]},s.name))})]})]})}export{se as AliasesPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/AliasesPage-AOThQmDL.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js b/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js deleted file mode 100644 index 02afb5b8..00000000 --- a/src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D6YDX-oj.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js b/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js deleted file mode 100644 index 0c78cf1c..00000000 --- a/src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-BCAQ5J9W.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-Dp4DdBFR.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D6YDX-oj.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-9zpV4nTH.js diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js b/src/gateway/static/dashboard/assets/BudgetsPage-D0M-Cd5s.js similarity index 96% rename from src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js rename to src/gateway/static/dashboard/assets/BudgetsPage-D0M-Cd5s.js index c1daab44..f52310a3 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-D0M-Cd5s.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-hDVMDLdX.js";import{F as L}from"./Field-HzRk1KDP.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-CLdjdyTx.js";import{C as B,I as le,a as de,b as oe,B as x,d as A,S as ue}from"./heroui-BX6JwHY-.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js b/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js deleted file mode 100644 index f7c80984..00000000 --- a/src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/BudgetsPage-Us4jYLgv.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-CSyrpBqZ.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{j as Y,u as G,k as K,l as Q,m as X,n as J,P as Z,E as R,I as ee,o as se}from"./index-D1FfVwkg.js";import{F as L}from"./Field-gj3-ox4q.js";import{T as te,a as re,b as S,L as ae,c as ne,d as ie,e as C}from"./Table-DEsIhjZo.js";import{C as B,I as le,a as de,b as oe,B as x,c as A,S as ue}from"./heroui-CewI8xK4.js";const ce=50;function me({value:s,onChange:r,users:a,label:i,description:l}){const[g,d]=u.useState(""),o=u.useMemo(()=>a.filter(t=>!t.user_id.startsWith("apikey-")).map(t=>({id:t.user_id,label:t.alias?`${t.user_id} (${t.alias})`:t.user_id})),[a]),c=u.useMemo(()=>{const t=g.trim().toLowerCase();return o.filter(m=>!s.includes(m.id)).filter(m=>!t||m.id.toLowerCase().includes(t)||m.label.toLowerCase().includes(t)).slice(0,ce)},[o,s,g]),h=t=>{s.includes(t)||r([...s,t]),d("")},b=t=>r(s.filter(m=>m!==t));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:i}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),s.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[t,e.jsx("button",{type:"button","aria-label":`Remove ${t}`,onClick:()=>b(t),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},t))}):null,o.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(B.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:d,selectedKey:null,onSelectionChange:t=>{t!=null&&h(String(t))},className:"flex flex-col gap-1",children:[e.jsxs(B.InputGroup,{children:[e.jsx(le,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(B.Trigger,{})]}),e.jsx(B.Popover,{children:e.jsx(de,{items:c,className:"max-h-72 overflow-auto",children:t=>e.jsx(oe,{id:t.id,textValue:t.label,children:t.label})})})]})]})}const xe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function w(s){return xe.format(s)}const j=86400,F=3600,I=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function ge(s){if(s===null)return"No reset";const r=I.find(a=>a.seconds===s);return r?r.label:s%j===0?`Every ${s/j} days`:s%F===0?`Every ${s/F} hours`:`Every ${s}s`}function $(s){if(!s)return"—";const r=new Date(s);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function he(s){const r=s.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function pe({value:s,onChange:r}){const a=I.some(d=>d.seconds===s),[i,l]=u.useState(!a),g=s!==null&&s%j===0?String(s/j):"";return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(d=>e.jsx(x,{size:"sm",variant:!i&&s===d.seconds?"primary":"outline",onPress:()=>{l(!1),r(d.seconds)},children:d.label},d.label)),e.jsx(x,{size:"sm",variant:i?"primary":"outline",onPress:()=>l(!0),children:"Custom"})]}),i?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(L,{label:"Every N days",value:g,onChange:d=>{const o=Number(d.trim()),c=Math.round(o)*j;r(d.trim()===""||!Number.isFinite(o)||o<=0||!Number.isFinite(c)||c<=0?null:c)},placeholder:"14",description:"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function O({title:s,submitLabel:r,initial:a,error:i,isPending:l,onSubmit:g,onClose:d,assignUsers:o}){const[c,h]=u.useState(a.name??""),[b,t]=u.useState(a.max_budget===null?"":String(a.max_budget)),[m,f]=u.useState(a.budget_duration_sec),[v,N]=u.useState([]),_=he(b),P=()=>{l||!_.valid||g({name:c.trim()||null,max_budget:_.value,budget_duration_sec:m},v)};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:s}),e.jsx(R,{error:i}),e.jsx(L,{label:"Name (optional)",value:c,onChange:h,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(L,{label:"Spending limit (USD)",value:b,onChange:t,placeholder:"100.00",description:_.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(pe,{value:m,onChange:f}),o?e.jsx(me,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:v,onChange:N,users:o}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:l||!_.valid,onPress:P,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:d,children:"Cancel"})]})]})})}function fe({budget:s}){if(s.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=s.total_spend;if(s.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[w(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=s.max_budget*s.user_count,i=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:w(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",w(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(i,l?100:2)}%`}})})]})}function je({budgetId:s}){const r=se(s);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(ue,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(i=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:i.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:w(i.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:$(i.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:$(i.next_reset_at)})]},i.id))})]})})}function be({onCreate:s}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No budgets yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit."})]}),e.jsx("div",{children:e.jsx(x,{variant:"primary",onPress:s,children:"Create your first budget"})})]})})}function ve({label:s,isPending:r,onConfirm:a}){const[i,l]=u.useState(!1);return i?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:s}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}function V(s){return s.split("-")[0]}function H(s){return s.name??V(s.budget_id)}function Pe(){const s=Y(),r=G(),a=K(),i=Q(),l=X(),g=J(),[d,o]=u.useState(!1),[c,h]=u.useState(null),[b,t]=u.useState(null),[m,f]=u.useState(null),[v,N]=u.useState(null),[_,P]=u.useState(!1),U=s.data??[],T=s.isLoading,y=U.find(n=>n.budget_id===c)??null,M=!T&&U.length===0&&!d,z=async(n,p)=>{P(!0),f(null);const D=await Promise.allSettled(p.map(k=>g.mutateAsync({id:k,body:{budget_id:n}})));P(!1);const E=D.flatMap((k,q)=>k.status==="rejected"?[p[q]]:[]);if(E.length>0){N({budgetId:n,userIds:E}),f(new Error(`Budget created, but could not assign it to: ${E.join(", ")}. Retry to try again.`));return}N(null),o(!1)},W=(n,p)=>{if(v){z(v.budgetId,v.userIds);return}f(null),a.mutate(n,{onSuccess:async D=>{if(p.length>0){await z(D.budget_id,p);return}o(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:d||M?null:e.jsx(x,{variant:"primary",onPress:()=>{h(null),f(null),N(null),o(!0)},children:"Create budget"})}),e.jsx(R,{error:s.error??a.error??i.error??l.error??g.error}),e.jsx(ee,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),M?e.jsx(be,{onCreate:()=>{h(null),f(null),N(null),o(!0)}}):null,d?e.jsx(O,{title:"Create budget",submitLabel:v?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??m,isPending:a.isPending||_,assignUsers:r.data??[],onSubmit:W,onClose:()=>{f(null),N(null),o(!1)}}):null,y?e.jsx(O,{title:`Edit budget ${H(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:i.error,isPending:i.isPending,onSubmit:n=>i.mutate({id:y.budget_id,body:n},{onSuccess:()=>h(null)}),onClose:()=>h(null)},y.budget_id):null,e.jsxs(te,{children:[e.jsx(re,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Budget"}),e.jsx(S,{children:"Limit (per user)"}),e.jsx(S,{children:"Reset"}),e.jsx(S,{children:"Users"}),e.jsx(S,{children:"Usage"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:T?e.jsx(ae,{colSpan:6}):U.length===0?e.jsx(ne,{colSpan:6,children:"No budgets yet. Create one to cap spending."}):U.map(n=>e.jsxs(u.Fragment,{children:[e.jsxs(ie,{selected:c===n.budget_id,onClick:()=>{o(!1),h(n.budget_id)},children:[e.jsx(C,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:V(n.budget_id)})]})}),e.jsx(C,{children:n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):w(n.max_budget)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:ge(n.budget_duration_sec)}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:n.user_count}),e.jsx(C,{children:e.jsx(fe,{budget:n})}),e.jsx(C,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>t(p=>p===n.budget_id?null:n.budget_id),children:b===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{o(!1),h(n.budget_id)},children:"Edit"}),e.jsx(ve,{label:H(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})})]}),b===n.budget_id?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)]",children:e.jsx("td",{colSpan:6,children:e.jsx(je,{budgetId:n.budget_id})})}):null]},n.budget_id))})]})]})}export{Pe as BudgetsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/BudgetsPage-o3Sj5U5B.js diff --git a/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js b/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js deleted file mode 100644 index 46815ed0..00000000 --- a/src/gateway/static/dashboard/assets/Field-gj3-ox4q.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{T as n,L as o,I as c,D as d}from"./heroui-CewI8xK4.js";function j({label:s,value:a,onChange:x,placeholder:r,type:l="text",isRequired:m,description:e,autoFocus:i}){return t.jsxs(n,{value:a,onChange:x,isRequired:m,className:"flex max-w-md flex-col gap-1",children:[t.jsx(o,{className:"text-sm font-medium text-[var(--otari-ink)]",children:s}),t.jsx(c,{type:l,placeholder:r,autoFocus:i}),e?t.jsx(d,{className:"text-xs text-[var(--otari-muted)]",children:e}):null]})}export{j as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js b/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js deleted file mode 100644 index cb36b417..00000000 --- a/src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js +++ /dev/null @@ -1,8 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js -`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` -`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` -`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js b/src/gateway/static/dashboard/assets/KeysPage-CQj72SEP.js similarity index 97% rename from src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js rename to src/gateway/static/dashboard/assets/KeysPage-CQj72SEP.js index b4c84f25..f152f6d0 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js +++ b/src/gateway/static/dashboard/assets/KeysPage-CQj72SEP.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-hDVMDLdX.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-DX341Q9L.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` `).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js b/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js deleted file mode 100644 index 7b97df75..00000000 --- a/src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js +++ /dev/null @@ -1,12 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D6YDX-oj.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-CxWug9wa.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js -`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` -`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` -`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js b/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js deleted file mode 100644 index 4b673354..00000000 --- a/src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js +++ /dev/null @@ -1,16 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DIt3Gp89.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-Dp4DdBFR.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-D_p9BPKF.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m}from"./react-dgEcD0HR.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D6YDX-oj.js";import{F as k}from"./Field-HzRk1KDP.js";import{M as O,a as A}from"./ModelScopeControl-CxWug9wa.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,d as C}from"./heroui-BX6JwHY-.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-CLdjdyTx.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-CSyrpBqZ.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-CNKA1fyP.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m}from"./react-q-ooZ0ti.js";import{p as $,q as E,r as z,s as K,P as H,E as T,t as B,u as M,I as V}from"./index-D1FfVwkg.js";import{F as k}from"./Field-gj3-ox4q.js";import{M as O,a as A}from"./ModelScopeControl-Bpbo36Ko.js";import{C as _,L as U,I as q,a as W,b as G,D as Y,B as g,f as P,c as C}from"./heroui-CewI8xK4.js";import{T as J,a as Q,b as v,L as X,c as Z,d as ee,e as y}from"./Table-DEsIhjZo.js";function te({value:t,onChange:s,users:n,description:i}){const c=n.filter(a=>!a.user_id.startsWith("apikey-")).map(a=>({id:a.user_id,name:a.alias?`${a.user_id} (${a.alias})`:a.user_id})),[l,o]=m.useState(t),u=l.trim().toLowerCase(),j=c.filter(a=>!u||a.id.toLowerCase().includes(u)||a.name.toLowerCase().includes(u)).slice(0,50),p=a=>{const x=a.trim(),w=c.find(N=>N.id===x||N.name===x);return w?w.id:x},d=p(l),h=c.some(a=>a.id===d),f=d!==""&&!h?e.jsxs("span",{children:["Creates a new user ",e.jsx("code",{children:d}),"."]}):i??"Spend and budgets track against this user.";return e.jsxs(_.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:l,onInputChange:a=>{o(a),s(p(a))},onSelectionChange:a=>{if(a!=null){const x=String(a);o(x),s(x)}},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Owner"}),e.jsxs(_.InputGroup,{children:[e.jsx(q,{placeholder:"Pick a user, or type a new id…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:a=>a.currentTarget.select()}),e.jsx(_.Trigger,{})]}),e.jsx(_.Popover,{children:e.jsx(W,{items:j,className:"max-h-72 overflow-auto",children:a=>e.jsx(G,{id:a.id,textValue:a.name,children:a.name})})}),e.jsx(Y,{className:"text-xs text-[var(--otari-muted)]",children:f})]})}function L(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString()}function se(t){if(!t)return null;const s=new Date(t).getTime();if(Number.isNaN(s))return null;const n=Math.round((s-Date.now())/1e3),i=Math.abs(n),c=[["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[o,u]of c)if(i>=u)return l.format(Math.round(n/u),o);return l.format(n,"second")}function ne(t){if(!t.expires_at)return!1;const s=new Date(t.expires_at).getTime();return!Number.isNaN(s)&&sString(i).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}const ae=t=>(t??"").startsWith("apikey-");function I({label:t,value:s,multiline:n=!1,fieldRef:i}){const c=m.useRef(null),l=i??c,[o,u]=m.useState(!1),[j,p]=m.useState(!1),d=async()=>{var f,a,x;(f=l.current)==null||f.focus(),(a=l.current)==null||a.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(s),u(!0),p(!1),window.setTimeout(()=>u(!1),2e3);return}}catch{}p(!0)},h="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(g,{size:"sm",variant:"outline",onPress:d,children:o?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:l,readOnly:!0,rows:s.split(` ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-CbUCEimJ.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-BhG598Pa.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/KeysPage-DAGeWeBS.js -`).length,value:s,onFocus:f=>f.currentTarget.select(),className:`${h} resize-none whitespace-pre`}):e.jsx("input",{ref:l,readOnly:!0,value:s,onFocus:f=>f.currentTarget.select(),className:h}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:o?"Copied to clipboard.":""}),j?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function ie({title:t,result:s,onClose:n}){const i=m.useRef(null),c=m.useRef(null),l=typeof window<"u"?window.location.origin:"",o=s.key;m.useEffect(()=>{var d,h;(d=c.current)==null||d.focus(),(h=c.current)==null||h.select()},[]);const u=d=>{var x;if(d.key!=="Tab")return;const h=(x=i.current)==null?void 0:x.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!h||h.length===0)return;const f=h[0],a=h[h.length-1];d.shiftKey&&document.activeElement===f?(d.preventDefault(),a.focus()):!d.shiftKey&&document.activeElement===a&&(d.preventDefault(),f.focus())},j=[`curl ${l}/v1/chat/completions \\`,` -H "Otari-Key: ${o}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` -`),p=["from openai import OpenAI","",`client = OpenAI(base_url="${l}/v1", api_key="${o}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` -`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:u,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(V,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",A(s.allowed_models).text,"."]}),e.jsx(I,{label:"Secret key",value:o,fieldRef:c}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(I,{label:"curl",value:j,multiline:!0}),e.jsx(I,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function R({trigger:t,message:s,confirmLabel:n,isPending:i,onConfirm:c}){const[l,o]=m.useState(!1);return l?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:s}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(g,{size:"sm",variant:"danger",isDisabled:i,onPress:c,children:n}),e.jsx(g,{size:"sm",variant:"ghost",isDisabled:i,onPress:()=>o(!1),children:"Cancel"})]})]}):e.jsx(g,{size:"sm",variant:"danger-soft",onPress:()=>o(!0),children:t})}function F({userId:t,users:s}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const i=s.find(o=>o.user_id===n);if(!i)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:c}=A(i.allowed_models),l=i.allowed_models&&i.allowed_models.length>0?i.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:c.toLowerCase()}),l?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:l}),")"]}):null,". This key inherits that, or narrows within it."]})}function le({onClose:t,onCreated:s}){const n=B(),i=M(),[c,l]=m.useState(""),[o,u]=m.useState(""),[j,p]=m.useState(!1),[d,h]=m.useState(""),[f,a]=m.useState(null),[x,w]=m.useState(!0),N=o!==""&&new Date(o).getTime(){if(n.isPending||!x||r)return;const S={key_name:c.trim()||null,user_id:d.trim(),expires_at:o?new Date(o).toISOString():null,allowed_models:f};n.mutate(S,{onSuccess:D=>{s(D),t()}})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(k,{label:"Expires (optional)",value:o,onChange:u,type:"datetime-local",description:N?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(te,{value:d,onChange:h,users:i.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(S=>!S),children:j?"Hide advanced":"Advanced (restrict models)"}),j?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(F,{userId:d,users:i.data??[]}),e.jsx(O,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(S,D)=>{a(S),w(D)}})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!x||r,onPress:b,children:n.isPending?"Creating…":"Create key"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function oe({apiKey:t,onClose:s}){const n=E(),i=M(),[c,l]=m.useState(t.key_name??""),[o,u]=m.useState(re(t.expires_at)),[j,p]=m.useState(t.allowed_models),[d,h]=m.useState(!0),f=()=>{n.isPending||!d||n.mutate({id:t.id,body:{key_name:c.trim()||null,expires_at:o?new Date(o).toISOString():null,allowed_models:j}},{onSuccess:s})};return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(T,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(k,{label:"Name",value:c,onChange:l,placeholder:"ci-bot"}),e.jsx(k,{label:"Expires",value:o,onChange:u,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(F,{userId:t.user_id,users:i.data??[]}):null,e.jsx(O,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(a,x)=>{p(a),h(x)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:n.isPending||!d,onPress:f,children:n.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function ce({apiKey:t}){return t.is_active?ne(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function de({allowed:t}){const{text:s,tone:n}=A(t),i=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",c=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${i}`,title:c,children:s})}function ue({onCreate:t}){return e.jsx(C,{children:e.jsxs(C.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No API keys yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe."})]}),e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Create your first key"})})]})})}function ve(){const t=$(),s=E(),n=z(),i=K(),[c,l]=m.useState(!1),[o,u]=m.useState(null),[j,p]=m.useState(null),d=t.data??[],h=t.isLoading,f=d.find(r=>r.id===o)??null,a=!h&&d.length===0&&!c,x=r=>r.key_name??r.id,w=(r,b)=>s.mutate({id:r.id,body:{is_active:b}}),N=r=>n.mutate(r.id,{onSuccess:b=>p({title:`New secret for ${x(r)}`,result:b})});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(H,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:c?null:e.jsx(g,{variant:"primary",onPress:()=>{u(null),l(!0)},children:"Create key"})}),e.jsx(T,{error:t.error??s.error??n.error??i.error}),a?e.jsx(ue,{onCreate:()=>{u(null),l(!0)}}):null,c?e.jsx(le,{onClose:()=>l(!1),onCreated:r=>p({title:"API key created",result:r})}):null,f?e.jsx(oe,{apiKey:f,onClose:()=>u(null)},f.id):null,e.jsxs(J,{children:[e.jsx(Q,{children:e.jsxs("tr",{children:[e.jsx(v,{children:"Name"}),e.jsx(v,{children:"Status"}),e.jsx(v,{children:"Owner"}),e.jsx(v,{children:"Key"}),e.jsx(v,{children:"Created"}),e.jsx(v,{children:"Last used"}),e.jsx(v,{children:"Expires"}),e.jsx(v,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:h?e.jsx(X,{colSpan:8}):d.length===0?e.jsx(Z,{colSpan:8,children:"No API keys yet. Create one to authenticate a caller."}):d.map(r=>e.jsxs(ee,{selected:o===r.id,onClick:()=>{l(!1),u(r.id)},children:[e.jsx(y,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{children:r.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx(de,{allowed:r.allowed_models})]})}),e.jsx(y,{children:e.jsx(ce,{apiKey:r})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:ae(r.user_id)?e.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.jsx(P,{size:"sm",color:"default",children:"virtual"})}):e.jsx("code",{className:"text-xs",children:r.user_id??"—"})}),e.jsx(y,{children:e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:r.key_prefix?`${r.key_prefix}…`:"—"})}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:L(r.created_at)}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:se(r.last_used_at)??"never"}),e.jsx(y,{className:"text-[var(--otari-muted)]",children:e.jsx("span",{title:r.expires_at?new Date(r.expires_at).toLocaleString():void 0,children:r.expires_at?L(r.expires_at):"never"})}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:b=>b.stopPropagation(),children:[r.is_active?e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!1),children:"Disable"}):e.jsx(g,{size:"sm",variant:"outline",isDisabled:s.isPending,onPress:()=>w(r,!0),children:"Enable"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{l(!1),u(r.id)},children:"Edit"}),e.jsx(R,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:x(r)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>N(r)}),r.is_active?null:e.jsx(R,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:i.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:x(r)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>i.mutate(r.id)})]})})]},r.id))})]}),j?e.jsx(ie,{title:j.title,result:j.result,onClose:()=>{p(null),n.reset()}}):null]})}export{ve as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js b/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js deleted file mode 100644 index f625426c..00000000 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======== -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js b/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js deleted file mode 100644 index 5a194cb5..00000000 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-D6YDX-oj.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======== -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js b/src/gateway/static/dashboard/assets/ModelScopeControl-DX341Q9L.js similarity index 93% rename from src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-DX341Q9L.js index 3dd1b6f5..75593609 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-DX341Q9L.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-hDVMDLdX.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js b/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js deleted file mode 100644 index da51fab2..00000000 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-D_p9BPKF.js -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-Dp4DdBFR.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{J as A,e as $,f as P}from"./index-D6YDX-oj.js";import{C as d,I as R,a as T,b as V}from"./heroui-BX6JwHY-.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-CSyrpBqZ.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; -======== -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{J as A,e as $,f as P}from"./index-D1FfVwkg.js";import{C as d,I as R,a as T,b as V}from"./heroui-CewI8xK4.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-Bpbo36Ko.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CNKA1fyP.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelScopeControl-CxWug9wa.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js b/src/gateway/static/dashboard/assets/ModelsPage-BIdxI_hW.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js rename to src/gateway/static/dashboard/assets/ModelsPage-BIdxI_hW.js index 4f4efda0..ff1619f4 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-BIdxI_hW.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-hDVMDLdX.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js b/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js deleted file mode 100644 index 954753dc..00000000 --- a/src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-BR6bzhht.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-Dp4DdBFR.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D6YDX-oj.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js b/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js deleted file mode 100644 index 83406d25..00000000 --- a/src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DI7qj4qI.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as rt,u as nt,r as c}from"./react-dgEcD0HR.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D6YDX-oj.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-CLdjdyTx.js";import{B as L,d as ke,f as K}from"./heroui-BX6JwHY-.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js b/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js deleted file mode 100644 index 9a652e2f..00000000 --- a/src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ModelsPage-DaewNAhO.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-CSyrpBqZ.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as rt,u as nt,r as c}from"./react-q-ooZ0ti.js";import{v as at,w as st,e as lt,x as ct,P as ot,E as ut,F as E,I as dt,y as ne,z as pt,A as ht,B as xt,D as A,G as $e,H as Ee,C as Ae,h as me}from"./index-D1FfVwkg.js";import{T as mt,a as ft,d as Ce,b as re,L as vt,e as U,c as bt}from"./Table-DEsIhjZo.js";import{B as L,c as ke,f as K}from"./heroui-CewI8xK4.js";function We(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function gt(t,i=Date.now()){const r=new Map;for(const n of t){const a=r.get(n.model_key)??[];a.push(n),r.set(n.model_key,a)}const s=[];for(const n of r.values()){const a=[...n].sort((h,p)=>Date.parse(h.effective_at)-Date.parse(p.effective_at)),d=[...a].reverse().find(h=>Date.parse(h.effective_at)<=i);s.push(d??a[0])}return s.sort((n,a)=>n.model_key.localeCompare(a.model_key))}const _t="otari",Me=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],jt=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Te={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Pt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],yt=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Nt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],St=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Ct=1440*60*1e3;function Ie(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function kt(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,a)=>a.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ae(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function R(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function V(t){return t.trim()===""?null:Number(t)}function De(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Oe(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(a=>a.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(R))})}function Fe(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function j({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function ze({tiers:t,onChange:i}){const r=(n,a,d)=>{i(t.map(h=>h.id===n?{...h,[a]:d}:h))},s=()=>{const n=t.reduce((a,d)=>Math.max(a,d.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx(L,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:a=>r(n.id,"minInputTokens",a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(j,{value:n.input,onChange:a=>r(n.id,"input",a),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(j,{value:n.output,onChange:a=>r(n.id,"output",a),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(j,{value:n.cacheRead,onChange:a=>r(n.id,"cacheRead",a),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(j,{value:n.cacheWrite,onChange:a=>r(n.id,"cacheWrite",a),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(j,{value:n.cacheWrite1h,onChange:a=>r(n.id,"cacheWrite1h",a),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx(L,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(a=>a.id!==n.id)),children:"Remove"})]},n.id))]})}function Wt({source:t}){return t==="configured"?e.jsx(K,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(K,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function se({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Mt(){const t=xt();return t.data?t.data.default_pricing?e.jsx(se,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(se,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function ie({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Tt({row:t}){const i=$e(),r=Ee(),[s,n]=c.useState(!1),[a,d]=c.useState(""),[h,p]=c.useState(""),[v,P]=c.useState(""),[m,S]=c.useState(""),[k,W]=c.useState(""),[D,y]=c.useState([]),Y=()=>{d(t.inputPrice==null?"":String(t.inputPrice)),p(t.outputPrice==null?"":String(t.outputPrice)),P(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),S(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),W(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),y(De(t.pricingTiers)),n(!0)},M=ae(a)&&ae(h)&&R(v)&&R(m)&&R(k)&&Oe(D),G=()=>{M&&i.mutate({model_key:t.key,input_price_per_million:Number(a),output_price_per_million:Number(h),cache_read_price_per_million:V(v),cache_write_price_per_million:V(m),cache_write_1h_price_per_million:V(k),pricing_tiers:Fe(D)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(j,{value:a,onChange:d,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(j,{value:h,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(j,{value:v,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(j,{value:m,onChange:S,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(j,{value:k,onChange:W,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(ze,{tiers:D,onChange:y}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{size:"sm",variant:"primary",isDisabled:i.isPending||!M,onPress:G,children:"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:me(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${A(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${A(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${A(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${A(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${A(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(L,{size:"sm",variant:"outline",onPress:Y,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error)}):null]})]})}function It({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const a=(i==null?void 0:i.input_modalities)??[],d=(i==null?void 0:i.output_modalities)??[],h=jt.filter(({key:p})=>i==null?void 0:i[p]);return e.jsx(ke,{children:e.jsxs(ke.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(K,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(ie,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Tt,{row:t},t.key),e.jsx(L,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(ie,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:ne(t.contextWindow)}),e.jsx(T,{label:"Max output",value:ne((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:ht(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(ie,{title:"Modalities",children:a.length===0&&d.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),a.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),d.map(p=>e.jsx(K,{size:"sm",color:"default",children:Te[p]??p},p))]})]})}),e.jsx(ie,{title:"Capabilities",children:h.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(({key:p,label:v})=>e.jsx(K,{size:"sm",color:"default",children:v},p))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Lt=15,$t=[{value:"15",label:"15 per page"},{value:"25",label:"25 per page"},{value:"50",label:"50 per page"}];function Et({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}function At({page:t,pageCount:i,total:r,pageSize:s,onPage:n,onPageSize:a}){return e.jsxs("div",{className:"flex items-center justify-between px-1 pt-1 text-sm text-[var(--otari-muted)]",children:[e.jsxs("span",{children:[i>1?`Page ${t+1} of ${i} · `:"",pt(r)," model",r===1?"":"s"]}),e.jsxs("span",{className:"inline-flex gap-2",children:[e.jsx(E,{ariaLabel:"Rows per page",value:String(s),onChange:d=>a(Number(d)),options:$t}),i>1?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"sm",variant:"outline",isDisabled:t===0,onPress:()=>n(t-1),children:"Prev"}),e.jsx(L,{size:"sm",variant:"outline",isDisabled:t>=i-1,onPress:()=>n(t+1),children:"Next"})]}):null]})]})}const Be="otari.dashboard.modelsSort",xe={col:"model",dir:"asc"},Dt=["model","released","input","output"];function Ot(){if(typeof window>"u")return xe;try{const t=window.localStorage.getItem(Be);if(!t)return xe;const i=JSON.parse(t);if(Dt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return xe}function Le({label:t,col:i,sort:r,onSort:s,align:n="left",info:a}){const d=r.col===i;return e.jsx(re,{className:n==="right"?"text-right":void 0,ariaSort:d?r.dir==="asc"?"ascending":"descending":"none",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${n==="right"?"flex-row-reverse":""}`,children:[e.jsxs("button",{type:"button",onClick:()=>s(i),className:`inline-flex items-center gap-1 ${n==="right"?"flex-row-reverse":""} hover:text-[var(--otari-ink)]`,children:[t,e.jsx("span",{className:"text-[10px] text-[var(--otari-muted)]",children:d?r.dir==="asc"?"▲":"▼":"↕"})]}),a]})})}function Ft({row:t,onClose:i}){const r=$e(),s=Ee(),[n,a]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[d,h]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[p,v]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[P,m]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[S,k]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[W,D]=c.useState(De(t.pricingTiers)),y=ae(n)&&ae(d)&&R(p)&&R(P)&&R(S)&&Oe(W),Y=()=>{y&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(d),cache_read_price_per_million:V(p),cache_write_price_per_million:V(P),cache_write_1h_price_per_million:V(S),pricing_tiers:Fe(W)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(j,{value:n,onChange:a,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(j,{value:d,onChange:h,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(j,{value:p,onChange:v,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(j,{value:P,onChange:m,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(j,{value:S,onChange:k,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(L,{size:"sm",variant:"primary",isDisabled:r.isPending||!y,onPress:Y,children:r.isPending?"Saving…":"Save"}),e.jsx(L,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(se,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:me(r.error??s.error)}):null]}),e.jsx(ze,{tiers:W,onChange:D})]})}function zt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:a}){const d=(h,p)=>e.jsx("button",{type:"button","aria-label":`Edit ${p} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:v=>{v.stopPropagation(),a()},children:h==null?"—":A(h)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[d(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),d(i,n)]})}function Bt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${A(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${A(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${A(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function Rt({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,a)=>n.min_input_tokens-a.min_input_tokens).map(n=>ne(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function Kt({rows:t,isLoading:i,empty:r,sort:s,onSort:n,selectedKey:a,onSelect:d,pricingKey:h,onSetPricingKey:p,comparisonContextTokens:v}){const P=v==null?"Base":`at ${ne(v)}`;return e.jsxs(mt,{children:[e.jsx(ft,{children:e.jsxs(Ce,{children:[e.jsx(Le,{label:"Model",col:"model",sort:s,onSort:n}),e.jsx(re,{children:"Provider"}),e.jsx(Le,{label:`${P} in / out $ / 1M`,col:"input",sort:s,onSort:n,align:"right",info:e.jsx(Mt,{})}),e.jsxs(re,{className:"text-right",children:["Caching ",v==null?"policy":P]}),e.jsx(re,{className:"text-right",children:"Pricing policy"})]})}),e.jsx("tbody",{children:i?e.jsx(vt,{colSpan:5}):t.length>0?t.map(m=>{const S=()=>p(h===m.key?null:m.key),k=kt(m,v);return e.jsxs(c.Fragment,{children:[e.jsxs(Ce,{onClick:()=>d(m.key),selected:m.key===a,children:[e.jsxs(U,{className:"font-medium break-all",children:[m.model,e.jsx("span",{className:"sr-only",children:m.key})]}),e.jsx(U,{className:"text-[var(--otari-muted)]",children:m.provider}),e.jsx(U,{className:"text-right",children:e.jsx(zt,{primary:k.inputPrice,secondary:k.outputPrice,rowKey:m.key,primaryLabel:"input",secondaryLabel:"output",onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Bt,{rates:k,rowKey:m.key,onEdit:S})}),e.jsx(U,{className:"text-right",children:e.jsx(Rt,{row:m,onEdit:S})})]}),h===m.key?e.jsx("tr",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-bg)] last:border-b-0",children:e.jsx("td",{colSpan:5,children:e.jsx(Ft,{row:m,onClose:()=>p(null)})})}):null]},m.key)}):e.jsx(bt,{colSpan:5,children:r})})]})}function Vt({providers:t}){return t.length===0?null:e.jsxs(dt,{tone:"warning",children:["Could not list ",t.map(i=>i.provider).join(", "),". Check that provider's credentials in config.yml; its models are missing from the list below."]})}function Jt(){var je,Pe,ye;const t=rt(),[i]=nt(),r=at(),s=st(),n=lt(),a=ct(),[d,h]=c.useState(""),[p,v]=c.useState(0),[P,m]=c.useState(Lt),[S,k]=c.useState(null),[W,D]=c.useState(null),[y,Y]=c.useState(Ot);c.useEffect(()=>{try{window.localStorage.setItem(Be,JSON.stringify(y))}catch{}},[y]);const[M,G]=c.useState(i.get("provider")||"all"),[F,Re]=c.useState("all"),[H,Ke]=c.useState("all"),[q,Ve]=c.useState("all"),[le,Ye]=c.useState("0"),[J,He]=c.useState(""),[Z,qe]=c.useState("all"),[ce,we]=c.useState(""),O=((je=a.data)==null?void 0:je.models)??{},Ue=((Pe=a.data)==null?void 0:Pe.available)??!1,fe=c.useMemo(()=>{var l;return new Set((((l=n.data)==null?void 0:l.providers)??[]).flatMap(f=>f.models.map(o=>o.key)))},[n.data]),Ge=l=>{h(l),v(0)},z=l=>f=>{l(f),v(0)},Je=l=>{Y(f=>f.col===l?{col:l,dir:f.dir==="asc"?"desc":"asc"}:{col:l,dir:l==="released"?"desc":"asc"}),v(0)},X=c.useMemo(()=>{var C,g,_,$,I,B,Ne;const l=new Map(gt(s.data??[]).map(u=>[u.model_key,u])),f=[],o=new Set,b=(u,he,Se,x)=>{if(o.has(u))return;o.add(u);const N=l.get(u);f.push({key:u,model:Ie(he,Se),provider:Se,isDiscovered:fe.has(u),contextWindow:(x==null?void 0:x.contextWindow)??null,inputPrice:N?N.input_price_per_million:(x==null?void 0:x.inputPrice)??null,outputPrice:N?N.output_price_per_million:(x==null?void 0:x.outputPrice)??null,cacheReadPrice:N?N.cache_read_price_per_million:(x==null?void 0:x.cacheReadPrice)??null,cacheWritePrice:N?N.cache_write_price_per_million:(x==null?void 0:x.cacheWritePrice)??null,cacheWrite1hPrice:N?N.cache_write_1h_price_per_million??null:(x==null?void 0:x.cacheWrite1hPrice)??null,pricingTiers:N?N.pricing_tiers??[]:(x==null?void 0:x.pricingTiers)??[],source:N?"configured":(x==null?void 0:x.source)??"none"})};for(const u of((C=r.data)==null?void 0:C.data)??[]){if(u.owned_by===_t)continue;const he=u.pricing_source==="default"?"default":u.pricing?"configured":"none";b(u.id,u.id,u.owned_by||We(u.id),{key:u.id,model:u.id,provider:u.owned_by,contextWindow:u.context_window,inputPrice:((g=u.pricing)==null?void 0:g.input_price_per_million)??null,outputPrice:((_=u.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:(($=u.pricing)==null?void 0:$.cache_read_price_per_million)??null,cacheWritePrice:((I=u.pricing)==null?void 0:I.cache_write_price_per_million)??null,cacheWrite1hPrice:((B=u.pricing)==null?void 0:B.cache_write_1h_price_per_million)??null,pricingTiers:((Ne=u.pricing)==null?void 0:Ne.pricing_tiers)??[],source:he})}for(const u of l.keys())b(u,u,We(u));return f},[r.data,s.data,fe]),Ze=c.useMemo(()=>new Map(X.map(l=>[l.key,l])),[X]),Q=c.useMemo(()=>{var o,b,C;const l=X.map(g=>{var _,$;return{...g,contextWindow:g.contextWindow??((_=O[g.key])==null?void 0:_.context_window)??null,releaseDate:(($=O[g.key])==null?void 0:$.release_date)??null}}),f=new Set(l.map(g=>g.key));for(const g of((o=n.data)==null?void 0:o.providers)??[])for(const _ of g.models)f.has(_.key)||(f.add(_.key),l.push({key:_.key,model:Ie(_.key,g.provider),provider:g.provider,isDiscovered:!0,contextWindow:((b=O[_.key])==null?void 0:b.context_window)??null,releaseDate:((C=O[_.key])==null?void 0:C.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return l},[X,n.data,O]),Xe=(((ye=n.data)==null?void 0:ye.providers)??[]).filter(l=>!l.ok),ee=c.useMemo(()=>{const l=Array.from(new Set(Q.map(f=>f.provider))).sort((f,o)=>f.localeCompare(o));return[{value:"all",label:"All providers"},...l.map(f=>({value:f,label:f}))]},[Q]);c.useEffect(()=>{M==="all"||ee.length<=1||ee.some(l=>l.value===M)||G("all")},[ee,M]);const w=d.trim().toLowerCase(),oe=Number(le)||0,ue=J===""?Number.POSITIVE_INFINITY:Number(J),Qe=ce===""?null:Number(ce),de=Z==="all"?null:Date.now()-Number(Z)*Ct,pe=c.useMemo(()=>{const l=o=>{if(w&&!o.key.toLowerCase().includes(w)&&!o.provider.toLowerCase().includes(w)||M!=="all"&&o.provider!==M||F==="configured"&&o.source!=="configured"||F==="default"&&o.source!=="default"||F==="priced"&&o.inputPrice==null||F==="unpriced"&&o.inputPrice!=null||H==="discovered"&&!o.isDiscovered||H==="custom"&&o.isDiscovered)return!1;if(q!=="all"){const b=Me.find(g=>g.value===q),C=O[o.key];if(!b||!C||!b.test(C))return!1}if(oe>0&&(o.contextWindow==null||o.contextWindowue))return!1;if(de!=null){const b=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(b)||b{const C=y.dir==="asc"?1:-1;if(y.col==="model")return o.model.localeCompare(b.model)*C;if(y.col==="released"){const I=o.releaseDate??null,B=b.releaseDate??null;return!I&&!B?o.model.localeCompare(b.model):I?B?(IB?1:0)*C||o.model.localeCompare(b.model):-1:1}const g=I=>y.col==="input"?I.inputPrice:I.outputPrice,_=g(o),$=g(b);return _==null&&$==null?o.model.localeCompare(b.model):_==null?1:$==null?-1:(_-$)*C||o.model.localeCompare(b.model)};return Q.filter(l).sort(f)},[Q,w,M,F,H,q,oe,ue,de,O,y]),ve=pe.length,be=Math.max(1,Math.ceil(ve/P)),ge=Math.min(p,be-1),_e=ge*P,et=pe.slice(_e,_e+P),tt=r.isLoading||s.isLoading||n.isLoading,it=w!==""||M!=="all"||F!=="all"||H!=="all"||q!=="all"||le!=="0"||J!==""||Z!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",te=W?pe.find(l=>l.key===W)??Ze.get(W)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ot,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(ut,{error:r.error??s.error??n.error??a.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${te?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Et,{value:d,onChange:Ge,placeholder:"Search models…"}),e.jsx(E,{ariaLabel:"Filter by provider",value:M,onChange:z(G),options:ee}),e.jsx(E,{ariaLabel:"Filter by pricing",value:F,onChange:z(Re),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(E,{ariaLabel:"Filter by source",value:H,onChange:z(Ke),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(E,{ariaLabel:"Filter by capability",value:q,onChange:z(Ve),options:[{value:"all",label:"Any capability"},...Me.map(l=>({value:l.value,label:l.label}))]}),e.jsx(E,{ariaLabel:"Minimum context window",value:le,onChange:z(Ye),options:Pt}),e.jsx(E,{ariaLabel:"Maximum input price",value:J,onChange:z(He),options:yt}),e.jsx(E,{ariaLabel:"Compare prices at context",value:ce,onChange:we,options:Nt}),e.jsx(E,{ariaLabel:"Filter by release date",value:Z,onChange:z(qe),options:St})]}),e.jsx(Vt,{providers:Xe}),e.jsx(Kt,{rows:et,isLoading:tt,empty:it,sort:y,onSort:Je,selectedKey:W,onSelect:D,pricingKey:S,onSetPricingKey:k,comparisonContextTokens:Qe}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx(At,{page:ge,pageCount:be,total:ve,pageSize:P,onPage:v,onPageSize:l=>{m(l),v(0)}})})]}),te?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(It,{row:te,metadata:O[te.key],metadataAvailable:Ue,onMakeAlias:l=>t(`/aliases?target=${encodeURIComponent(l)}`),onClose:()=>D(null)})}):null]})]})}export{Jt as ModelsPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ModelsPage-WLlH9ed9.js diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js b/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js deleted file mode 100644 index c874cabc..00000000 --- a/src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/OverviewPage-BYSSsHzo.js -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-CSyrpBqZ.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; -======== -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-D1FfVwkg.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js b/src/gateway/static/dashboard/assets/OverviewPage-CtvPFoWc.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js rename to src/gateway/static/dashboard/assets/OverviewPage-CtvPFoWc.js index 7453bb5e..2d51371e 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-BHX_G4X9.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-CtvPFoWc.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as f,i as Z,N as G}from"./react-dgEcD0HR.js";import{J as tt,c as N,K as et,j as rt,p as at,u as st,a as nt,L as _,P as ot,E as Y,S as p,M as D,N as R,z as E,O as k,Q as it}from"./index-D6YDX-oj.js";import{S as H}from"./charts-Cr3Dij9t.js";import{T as lt,a as dt,b,L as ct,c as ut,d as xt,e as j}from"./Table-CLdjdyTx.js";import{d as B,B as mt}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function U(e){return e==="neutral"?void 0:e}const vt=.02,ht=.1;function F(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=ht?"alert":n>=vt?"warn":"ok";return{rate:n,status:a}}function pt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ft=.8;function gt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(s=>s.max_budget!==null&&s.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,r=0,c,m=-1;for(const s of n){const o=s.max_budget*s.user_count,i=o>0?s.total_spend/o:0;i>=1?a+=1:i>=ft&&(r+=1),i>m&&(m=i,c={name:s.name??s.budget_id,spent:s.total_spend,allocated:o,pct:i})}const u=a>0?"alert":r>0?"warn":"ok",g=a>0?`${a} over limit`:r>0?`${r} near limit`:"All within budget";return{status:u,label:g,overCount:a,nearCount:r,cappedCount:n.length,worst:c}}const K=864e5,W=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function bt(){const[e,n]=f.useState(I);return f.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const r=I();n(c=>c===r?c:r)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),f.useMemo(()=>{const a=Date.now(),r=new Date(a);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(a-W*K).toISOString(),prevStart:new Date(a-2*W*K).toISOString()}},[e])}const jt={ok:"Healthy",warn:"Elevated",alert:"High"},St={ok:"On track",warn:"Near limit",alert:"Over budget"};function Pt(){const e=tt();return e.isLoading?null:t.jsx(yt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function yt({needsSetup:e=!1}){var $,A,P,T,M,q;const n=bt(),a=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),c=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=N(a,"hour"),u=N(r,"day"),g=N(c,"day"),s=et(),o=rt(),i=at(),S=st(),y=nt({},0,5),C=($=m.data)==null?void 0:$.totals,x=(A=u.data)==null?void 0:A.totals,v=(P=g.data)==null?void 0:P.totals,w=((T=u.data)==null?void 0:T.series)??[],O=w.length>1,l=F(x),L=F(v),z=l.rate!==null&&L.rate!==null?_(l.rate,L.rate):null,d=gt(o.data??[]),J=pt(s.data),Q=(i.data??[]).filter(h=>h.is_active).length,V=(S.data??[]).filter(h=>!h.blocked).length,X=m.error??u.error??s.error??o.error??i.error??S.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ot,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(wt,{}):null,t.jsx(Y,{error:X}),t.jsx(_t,{providerHealth:J,healthy:((M=s.data)==null?void 0:M.healthy)??0,total:((q=s.data)==null?void 0:q.total)??0,budget:d,errStatus:l.status,errRate:l.rate,ready:s.isSuccess&&o.isSuccess&&u.isSuccess,failed:s.isError||o.isError||u.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(p,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(p,{label:"Spend, last 30 days",value:x?D(x.cost):"—",hint:x?t.jsx(R,{fraction:_(x.cost,v==null?void 0:v.cost)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Requests, last 30 days",value:x?E(x.request_count):"—",hint:x?t.jsx(R,{fraction:_(x.request_count,v==null?void 0:v.request_count)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Error rate, last 30 days",value:l.rate===null?"—":k(l.rate),status:U(l.status),statusLabel:l.status==="neutral"?void 0:jt[l.status],hint:l.rate!==null?t.jsx(R,{fraction:z}):null}),t.jsx(p,{label:"Budget health",value:o.data&&d.worst?k(d.worst.pct):"—",status:o.data?U(d.status):void 0,statusLabel:o.data&&d.status!=="neutral"?St[d.status]:void 0,hint:o.data?d.worst?`${d.label} · worst: ${d.worst.name}`:d.label:void 0,to:"/budgets"}),t.jsx(p,{label:"Active keys",value:i.data?E(Q):"—",to:"/keys"}),t.jsx(p,{label:"Active users",value:S.data?E(V):"—",to:"/users"})]}),t.jsx(Et,{entries:y.data??[],loading:y.isLoading,error:y.error})]})}function wt(){const e=Z();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(mt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Nt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function _t({providerHealth:e,healthy:n,total:a,budget:r,errStatus:c,errRate:m,ready:u,failed:g}){if(g)return t.jsx(Nt,{text:"Some status data could not be loaded."});if(!u)return null;const s=[];if((e==="warn"||e==="alert")&&a>0){const o=a-n;s.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),c==="alert"&&m!==null&&s.push({text:`error rate ${k(m)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(G,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function Rt(e){return e==="error"?"error":"ok"}function Et({entries:e,loading:n,error:a}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(G,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsxs(lt,{children:[t.jsx(dt,{children:t.jsxs("tr",{children:[t.jsx(b,{children:"Time"}),t.jsx(b,{children:"Model"}),t.jsx(b,{className:"text-right",children:"Cost"}),t.jsx(b,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(ct,{colSpan:4}):e.length===0?t.jsx(ut,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(xt,{children:[t.jsx(j,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:it(r.timestamp)})}),t.jsx(j,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(j,{className:"text-right tabular-nums",children:r.cost===null?"—":D(r.cost)}),t.jsx(j,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Rt(r.status)})})]},r.id))})]})]})}export{Pt as OverviewIndex,yt as OverviewPage,I as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as f,i as Z,N as G}from"./react-dgEcD0HR.js";import{J as tt,c as N,K as et,j as rt,p as at,u as st,a as nt,L as _,P as ot,E as Y,S as p,M as D,N as R,z as E,O as k,Q as it}from"./index-hDVMDLdX.js";import{S as H}from"./charts-Cr3Dij9t.js";import{T as lt,a as dt,b,L as ct,c as ut,d as xt,e as j}from"./Table-CLdjdyTx.js";import{d as B,B as mt}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function U(e){return e==="neutral"?void 0:e}const vt=.02,ht=.1;function F(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=ht?"alert":n>=vt?"warn":"ok";return{rate:n,status:a}}function pt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ft=.8;function gt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(s=>s.max_budget!==null&&s.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,r=0,c,m=-1;for(const s of n){const o=s.max_budget*s.user_count,i=o>0?s.total_spend/o:0;i>=1?a+=1:i>=ft&&(r+=1),i>m&&(m=i,c={name:s.name??s.budget_id,spent:s.total_spend,allocated:o,pct:i})}const u=a>0?"alert":r>0?"warn":"ok",g=a>0?`${a} over limit`:r>0?`${r} near limit`:"All within budget";return{status:u,label:g,overCount:a,nearCount:r,cappedCount:n.length,worst:c}}const K=864e5,W=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function bt(){const[e,n]=f.useState(I);return f.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const r=I();n(c=>c===r?c:r)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),f.useMemo(()=>{const a=Date.now(),r=new Date(a);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(a-W*K).toISOString(),prevStart:new Date(a-2*W*K).toISOString()}},[e])}const jt={ok:"Healthy",warn:"Elevated",alert:"High"},St={ok:"On track",warn:"Near limit",alert:"Over budget"};function Pt(){const e=tt();return e.isLoading?null:t.jsx(yt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function yt({needsSetup:e=!1}){var $,A,P,T,M,q;const n=bt(),a=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),c=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=N(a,"hour"),u=N(r,"day"),g=N(c,"day"),s=et(),o=rt(),i=at(),S=st(),y=nt({},0,5),C=($=m.data)==null?void 0:$.totals,x=(A=u.data)==null?void 0:A.totals,v=(P=g.data)==null?void 0:P.totals,w=((T=u.data)==null?void 0:T.series)??[],O=w.length>1,l=F(x),L=F(v),z=l.rate!==null&&L.rate!==null?_(l.rate,L.rate):null,d=gt(o.data??[]),J=pt(s.data),Q=(i.data??[]).filter(h=>h.is_active).length,V=(S.data??[]).filter(h=>!h.blocked).length,X=m.error??u.error??s.error??o.error??i.error??S.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ot,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(wt,{}):null,t.jsx(Y,{error:X}),t.jsx(_t,{providerHealth:J,healthy:((M=s.data)==null?void 0:M.healthy)??0,total:((q=s.data)==null?void 0:q.total)??0,budget:d,errStatus:l.status,errRate:l.rate,ready:s.isSuccess&&o.isSuccess&&u.isSuccess,failed:s.isError||o.isError||u.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(p,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(p,{label:"Spend, last 30 days",value:x?D(x.cost):"—",hint:x?t.jsx(R,{fraction:_(x.cost,v==null?void 0:v.cost)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Requests, last 30 days",value:x?E(x.request_count):"—",hint:x?t.jsx(R,{fraction:_(x.request_count,v==null?void 0:v.request_count)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Error rate, last 30 days",value:l.rate===null?"—":k(l.rate),status:U(l.status),statusLabel:l.status==="neutral"?void 0:jt[l.status],hint:l.rate!==null?t.jsx(R,{fraction:z}):null}),t.jsx(p,{label:"Budget health",value:o.data&&d.worst?k(d.worst.pct):"—",status:o.data?U(d.status):void 0,statusLabel:o.data&&d.status!=="neutral"?St[d.status]:void 0,hint:o.data?d.worst?`${d.label} · worst: ${d.worst.name}`:d.label:void 0,to:"/budgets"}),t.jsx(p,{label:"Active keys",value:i.data?E(Q):"—",to:"/keys"}),t.jsx(p,{label:"Active users",value:S.data?E(V):"—",to:"/users"})]}),t.jsx(Et,{entries:y.data??[],loading:y.isLoading,error:y.error})]})}function wt(){const e=Z();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(mt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Nt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function _t({providerHealth:e,healthy:n,total:a,budget:r,errStatus:c,errRate:m,ready:u,failed:g}){if(g)return t.jsx(Nt,{text:"Some status data could not be loaded."});if(!u)return null;const s=[];if((e==="warn"||e==="alert")&&a>0){const o=a-n;s.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),c==="alert"&&m!==null&&s.push({text:`error rate ${k(m)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(G,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function Rt(e){return e==="error"?"error":"ok"}function Et({entries:e,loading:n,error:a}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(G,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsxs(lt,{children:[t.jsx(dt,{children:t.jsxs("tr",{children:[t.jsx(b,{children:"Time"}),t.jsx(b,{children:"Model"}),t.jsx(b,{className:"text-right",children:"Cost"}),t.jsx(b,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(ct,{colSpan:4}):e.length===0?t.jsx(ut,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(xt,{children:[t.jsx(j,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:it(r.timestamp)})}),t.jsx(j,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(j,{className:"text-right tabular-nums",children:r.cost===null?"—":D(r.cost)}),t.jsx(j,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Rt(r.status)})})]},r.id))})]})]})}export{Pt as OverviewIndex,yt as OverviewPage,I as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js b/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js deleted file mode 100644 index 4cf0debf..00000000 --- a/src/gateway/static/dashboard/assets/OverviewPage-DXIwdDWG.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-W9y7rsMr.js";import{r as f,g as J,N as F}from"./react-q-ooZ0ti.js";import{J as Q,c as k,K as X,j as Z,p as tt,u as et,a as at,L as b,P as rt,E as I,S as m,M as E,N as j,z as R,O as st,Q as C,R as K}from"./index-D1FfVwkg.js";import{T as nt,a as ot,b as y,L as lt,c as it,d as dt,e as S}from"./Table-DEsIhjZo.js";import{c as T,B as ct}from"./heroui-CewI8xK4.js";function D(e){return e==="neutral"?void 0:e}const ut=.02,xt=.1;function q(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=xt?"alert":n>=ut?"warn":"ok";return{rate:n,status:s}}function mt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ht=.8;function vt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(a=>a.max_budget!==null&&a.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,r=0,x,h=-1;for(const a of n){const o=a.max_budget*a.user_count,i=o>0?a.total_spend/o:0;i>=1?s+=1:i>=ht&&(r+=1),i>h&&(h=i,x={name:a.name??a.budget_id,spent:a.total_spend,allocated:o,pct:i})}const v=s>0?"alert":r>0?"warn":"ok",p=s>0?`${s} over limit`:r>0?`${r} near limit`:"All within budget";return{status:v,label:p,overCount:s,nearCount:r,cappedCount:n.length,worst:x}}const B=864e5,U=30;function W(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ft(){const[e,n]=f.useState(W);return f.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const r=W();n(x=>x===r?x:r)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),f.useMemo(()=>{const s=Date.now(),r=new Date(s);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(s-U*B).toISOString(),prevStart:new Date(s-2*U*B).toISOString()}},[e])}const pt={ok:"Healthy",warn:"Elevated",alert:"High"},gt={ok:"All up",warn:"Degraded",alert:"All down"},bt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Ot(){const e=Q();return e.isLoading?null:t.jsx(jt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function jt({needsSetup:e=!1}){var L,A,P,M,H;const n=ft(),s=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),x=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),h=k(s,"hour"),v=k(r,"day"),p=k(x,"day"),a=X(),o=Z(),i=tt(),w=et(),_=at({},0,5),O=(L=h.data)==null?void 0:L.totals,l=(A=v.data)==null?void 0:A.totals,d=(P=p.data)==null?void 0:P.totals,c=q(l),$=q(d),G=c.rate!==null&&$.rate!==null?b(c.rate,$.rate):null,u=vt(o.data??[]),g=mt(a.data),Y=(i.data??[]).filter(N=>N.is_active).length,V=(w.data??[]).filter(N=>!N.blocked).length,z=h.error??v.error??a.error??o.error??i.error??w.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(rt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(yt,{}):null,t.jsx(I,{error:z}),t.jsx(wt,{providerHealth:g,healthy:((M=a.data)==null?void 0:M.healthy)??0,total:((H=a.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:a.isSuccess&&o.isSuccess&&v.isSuccess,failed:a.isError||o.isError||v.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(m,{label:"Spend today",value:O?E(O.cost):"—"}),t.jsx(m,{label:"Spend, last 30 days",value:l?E(l.cost):"—",hint:l?t.jsx(j,{fraction:b(l.cost,d==null?void 0:d.cost)}):null}),t.jsx(m,{label:"Requests, last 30 days",value:l?R(l.request_count):"—",hint:l?t.jsx(j,{fraction:b(l.request_count,d==null?void 0:d.request_count)}):null}),t.jsx(m,{label:"Cache reads, last 30 days",value:l?st(l.cache_read_tokens):"—",hint:l?t.jsx(j,{fraction:b(l.cache_read_tokens,d==null?void 0:d.cache_read_tokens)}):null,to:"/usage"}),t.jsx(m,{label:"Error rate, last 30 days",value:c.rate===null?"—":C(c.rate),status:D(c.status),statusLabel:c.status==="neutral"?void 0:pt[c.status],hint:c.rate!==null?t.jsx(j,{fraction:G}):null}),t.jsx(m,{label:"Budget health",value:o.data&&u.worst?C(u.worst.pct):"—",status:o.data?D(u.status):void 0,statusLabel:o.data&&u.status!=="neutral"?bt[u.status]:void 0,hint:o.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(m,{label:"Providers healthy",value:a.data?`${a.data.healthy}/${a.data.total}`:"—",status:a.data?D(g):void 0,statusLabel:a.data&&g!=="neutral"?gt[g]:void 0,hint:a.data?a.data.checked_at?`checked ${K(a.data.checked_at)}`:"not checked yet":void 0,to:"/providers"}),t.jsx(m,{label:"Active keys",value:i.data?R(Y):"—",to:"/keys"}),t.jsx(m,{label:"Active users",value:w.data?R(V):"—",to:"/users"})]}),t.jsx(Nt,{entries:_.data??[],loading:_.isLoading,error:_.error})]})}function yt(){const e=J();return t.jsx(T,{children:t.jsxs(T.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ct,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function St({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function wt({providerHealth:e,healthy:n,total:s,budget:r,errStatus:x,errRate:h,ready:v,failed:p}){if(p)return t.jsx(St,{text:"Some status data could not be loaded."});if(!v)return null;const a=[];if((e==="warn"||e==="alert")&&s>0){const o=s-n;a.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),x==="alert"&&h!==null&&a.push({text:`error rate ${C(h)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(F,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function _t(e){return e==="error"?"error":"ok"}function Nt({entries:e,loading:n,error:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(F,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(I,{error:s}),t.jsxs(nt,{children:[t.jsx(ot,{children:t.jsxs("tr",{children:[t.jsx(y,{children:"Time"}),t.jsx(y,{children:"Model"}),t.jsx(y,{className:"text-right",children:"Cost"}),t.jsx(y,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(lt,{colSpan:4}):e.length===0?t.jsx(it,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(dt,{children:[t.jsx(S,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:K(r.timestamp)})}),t.jsx(S,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(S,{className:"text-right tabular-nums",children:r.cost===null?"—":E(r.cost)}),t.jsx(S,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:_t(r.status)})})]},r.id))})]})]})}export{Ot as OverviewIndex,jt as OverviewPage,W as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-_Gja1ZBt.js b/src/gateway/static/dashboard/assets/OverviewPage-_Gja1ZBt.js deleted file mode 100644 index 1001b34a..00000000 --- a/src/gateway/static/dashboard/assets/OverviewPage-_Gja1ZBt.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as f,i as Z,N as G}from"./react-dgEcD0HR.js";import{J as tt,c as N,K as et,j as rt,p as at,u as st,a as nt,L as _,P as ot,E as Y,S as p,M as D,N as R,z as E,O as k,Q as it}from"./index-Dp4DdBFR.js";import{S as H}from"./charts-Cr3Dij9t.js";import{T as lt,a as dt,b,L as ct,c as ut,d as xt,e as j}from"./Table-CLdjdyTx.js";import{d as B,B as mt}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function U(e){return e==="neutral"?void 0:e}const vt=.02,ht=.1;function F(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=ht?"alert":n>=vt?"warn":"ok";return{rate:n,status:a}}function pt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy===0?"alert":"warn"}const ft=.8;function gt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(s=>s.max_budget!==null&&s.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,r=0,c,m=-1;for(const s of n){const o=s.max_budget*s.user_count,i=o>0?s.total_spend/o:0;i>=1?a+=1:i>=ft&&(r+=1),i>m&&(m=i,c={name:s.name??s.budget_id,spent:s.total_spend,allocated:o,pct:i})}const u=a>0?"alert":r>0?"warn":"ok",g=a>0?`${a} over limit`:r>0?`${r} near limit`:"All within budget";return{status:u,label:g,overCount:a,nearCount:r,cappedCount:n.length,worst:c}}const K=864e5,W=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function bt(){const[e,n]=f.useState(I);return f.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const r=I();n(c=>c===r?c:r)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),f.useMemo(()=>{const a=Date.now(),r=new Date(a);return{today:new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString(),periodStart:new Date(a-W*K).toISOString(),prevStart:new Date(a-2*W*K).toISOString()}},[e])}const jt={ok:"Healthy",warn:"Elevated",alert:"High"},St={ok:"On track",warn:"Near limit",alert:"Over budget"};function Pt(){const e=tt();return e.isLoading?null:t.jsx(yt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function yt({needsSetup:e=!1}){var $,A,P,T,M,q;const n=bt(),a=f.useMemo(()=>({start_date:n.today}),[n]),r=f.useMemo(()=>({start_date:n.periodStart}),[n]),c=f.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=N(a,"hour"),u=N(r,"day"),g=N(c,"day"),s=et(),o=rt(),i=at(),S=st(),y=nt({},0,5),C=($=m.data)==null?void 0:$.totals,x=(A=u.data)==null?void 0:A.totals,v=(P=g.data)==null?void 0:P.totals,w=((T=u.data)==null?void 0:T.series)??[],O=w.length>1,l=F(x),L=F(v),z=l.rate!==null&&L.rate!==null?_(l.rate,L.rate):null,d=gt(o.data??[]),J=pt(s.data),Q=(i.data??[]).filter(h=>h.is_active).length,V=(S.data??[]).filter(h=>!h.blocked).length,X=m.error??u.error??s.error??o.error??i.error??S.error;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ot,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway."}),e?t.jsx(wt,{}):null,t.jsx(Y,{error:X}),t.jsx(_t,{providerHealth:J,healthy:((M=s.data)==null?void 0:M.healthy)??0,total:((q=s.data)==null?void 0:q.total)??0,budget:d,errStatus:l.status,errRate:l.rate,ready:s.isSuccess&&o.isSuccess&&u.isSuccess,failed:s.isError||o.isError||u.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(p,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(p,{label:"Spend, last 30 days",value:x?D(x.cost):"—",hint:x?t.jsx(R,{fraction:_(x.cost,v==null?void 0:v.cost)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Requests, last 30 days",value:x?E(x.request_count):"—",hint:x?t.jsx(R,{fraction:_(x.request_count,v==null?void 0:v.request_count)}):null,chart:O?t.jsx(H,{values:w.map(h=>h.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(p,{label:"Error rate, last 30 days",value:l.rate===null?"—":k(l.rate),status:U(l.status),statusLabel:l.status==="neutral"?void 0:jt[l.status],hint:l.rate!==null?t.jsx(R,{fraction:z}):null}),t.jsx(p,{label:"Budget health",value:o.data&&d.worst?k(d.worst.pct):"—",status:o.data?U(d.status):void 0,statusLabel:o.data&&d.status!=="neutral"?St[d.status]:void 0,hint:o.data?d.worst?`${d.label} · worst: ${d.worst.name}`:d.label:void 0,to:"/budgets"}),t.jsx(p,{label:"Active keys",value:i.data?E(Q):"—",to:"/keys"}),t.jsx(p,{label:"Active users",value:S.data?E(V):"—",to:"/users"})]}),t.jsx(Et,{entries:y.data??[],loading:y.isLoading,error:y.error})]})}function wt(){const e=Z();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(mt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Nt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function _t({providerHealth:e,healthy:n,total:a,budget:r,errStatus:c,errRate:m,ready:u,failed:g}){if(g)return t.jsx(Nt,{text:"Some status data could not be loaded."});if(!u)return null;const s=[];if((e==="warn"||e==="alert")&&a>0){const o=a-n;s.push({text:`${o} provider${o===1?"":"s"} unreachable`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),c==="alert"&&m!==null&&s.push({text:`error rate ${k(m)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-2",children:[i>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(G,{to:o.to,className:"underline underline-offset-2 hover:text-amber-950",children:o.text})]},o.to+o.text))]})}function Rt(e){return e==="error"?"error":"ok"}function Et({entries:e,loading:n,error:a}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(G,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsxs(lt,{children:[t.jsx(dt,{children:t.jsxs("tr",{children:[t.jsx(b,{children:"Time"}),t.jsx(b,{children:"Model"}),t.jsx(b,{className:"text-right",children:"Cost"}),t.jsx(b,{children:"Status"})]})}),t.jsx("tbody",{children:n?t.jsx(ct,{colSpan:4}):e.length===0?t.jsx(ut,{colSpan:4,children:"No requests yet. Once the gateway serves traffic, it appears here."}):e.map(r=>t.jsxs(xt,{children:[t.jsx(j,{className:"text-[var(--otari-muted)]",children:t.jsx("span",{title:new Date(r.timestamp).toLocaleString(),children:it(r.timestamp)})}),t.jsx(j,{className:"text-[var(--otari-ink)]",children:r.model}),t.jsx(j,{className:"text-right tabular-nums",children:r.cost===null?"—":D(r.cost)}),t.jsx(j,{children:t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Rt(r.status)})})]},r.id))})]})]})}export{Pt as OverviewIndex,yt as OverviewPage,I as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js b/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js deleted file mode 100644 index b4564f0e..00000000 --- a/src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-BJkEklg1.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Q}from"./react-dgEcD0HR.js";import{J as X,R as Z,B as ee,K as te,T as se,U as ae,V as ne,P as re,E as B,C as ie,W as oe,X as le,Q as z,h as U,Y as M,Z as Y,_ as de}from"./index-D6YDX-oj.js";import{F as _}from"./Field-HzRk1KDP.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-CLdjdyTx.js";import{B as j,f as H,d as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-BX6JwHY-.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=X(),s=Z(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(Q,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-CSyrpBqZ.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js b/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js deleted file mode 100644 index b3e3d28e..00000000 --- a/src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-B6Y7usRU.js b/src/gateway/static/dashboard/assets/ProvidersPage-DimvEH7H.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-B6Y7usRU.js rename to src/gateway/static/dashboard/assets/ProvidersPage-DimvEH7H.js index 74ae54d7..21c0bbe3 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-B6Y7usRU.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-DimvEH7H.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as J}from"./react-dgEcD0HR.js";import{J as Q,R as X,B as Z,K as ee,T as se,U as te,V as ae,P as ne,E as R,C as re,W as ie,X as oe,Q as z,h as U,Y as M,Z as le,_ as de,$ as ce}from"./index-Dp4DdBFR.js";import{F as _}from"./Field-HzRk1KDP.js";import{T as me,a as ue,b as S,L as xe,c as pe,d as he,e as C}from"./Table-CLdjdyTx.js";import{B as g,f as H,d as A,S as ve,T as ge,L as Y,I as V,D as je,C as I,a as fe,b as be}from"./heroui-BX6JwHY-.js";function K({value:t,onChange:a,label:s,placeholder:n,description:o}){return e.jsxs(ge,{value:t,onChange:a,className:"flex max-w-md flex-col gap-1",children:[e.jsx(Y,{className:"text-sm font-medium text-[var(--otari-ink)]",children:s}),e.jsx(V,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),o?e.jsx(je,{className:"text-xs text-[var(--otari-muted)]",children:o}):null]})}function W({label:t,value:a,onChange:s,description:n,placeholder:o,extra:d=[],includeCatalog:m=!0}){var y;const v=de(),u=x.useMemo(()=>m?[...d,...(v.data??[]).map(i=>({id:i.id,name:i.name}))]:d,[v.data,d,m]),[p,c]=x.useState(()=>{var i;return((i=u.find(f=>f.id===a))==null?void 0:i.name)??""}),j=((y=u.find(i=>i.id===a))==null?void 0:y.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),l=u.filter(i=>!h||i.name.toLowerCase().includes(h)||i.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(I.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:c,onSelectionChange:i=>{var f;i!=null?(s(String(i)),c(((f=u.find(k=>k.id===String(i)))==null?void 0:f.name)??"")):(s(""),c(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(Y,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(I.InputGroup,{children:[e.jsx(V,{placeholder:o??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(I.Trigger,{})]}),e.jsx(I.Popover,{children:e.jsx(fe,{items:l,className:"max-h-72 overflow-auto",children:i=>e.jsx(be,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function G({getPayload:t}){const a=ce(),s=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(g,{variant:"outline",isDisabled:s===null||a.isPending,onPress:()=>{s&&a.mutate(s)},children:a.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:a.isPending?null:a.error?e.jsx("span",{className:"text-xs text-red-700",children:U(a.error)}):a.data?a.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",a.data.model_count," model",a.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:a.data.error??"Connection failed."}):null})]})}function ye({onClose:t}){var w;const a=M(),[s,n]=x.useState(""),[o,d]=x.useState(""),[m,v]=x.useState(!1),[u,p]=x.useState(""),[c,j]=x.useState(""),h=le(s),l=((w=h.data)==null?void 0:w.id)===s?h.data:void 0;x.useEffect(()=>{l&&p(l.default_api_base??"")},[l]);const y=(l==null?void 0:l.env_key_present)??!1,i=((l==null?void 0:l.requires_api_key)??!0)&&!y,f=c.trim()!==""&&c.trim()!==s,k=/[:/]/.test(c),T=s!==""&&!k&&(!i||o.trim()!=="")&&!a.isPending,E=()=>{T&&a.mutate({instance:f?c.trim():s,provider_type:f?s:null,api_base:u.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(R,{error:a.error}),e.jsx(W,{label:"Provider",value:s,onChange:P=>{n(P),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(K,{value:o,onChange:d,label:l&&!i?"API key (optional)":"API key",description:l?i?`${l.name}'s endpoint is built in — just add your key.`:y?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>v(P=>!P),children:m?"Hide advanced":"Advanced (API base, rename)"}),m?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:c,onChange:j,placeholder:s||"instance name",description:k?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:!T,onPress:E,children:a.isPending?"Adding…":"Add provider"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(G,{getPayload:()=>s===""?null:{instance:f?c.trim():s,provider_type:f?s:null,api_base:u.trim()||null,api_key:o.trim()||null}})]})]})}function ke({onClose:t}){const a=M(),[s,n]=x.useState(""),[o,d]=x.useState("openai-compatible"),[m,v]=x.useState(""),[u,p]=x.useState(""),c=/[:/]/.test(s),j=s.trim()!==""&&!c&&m.trim()!==""&&!a.isPending,h=()=>{j&&a.mutate({instance:s.trim(),provider_type:o||"openai-compatible",api_base:m.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(R,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:s,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:c?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(W,{label:"Compatible with",value:o,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:m,onChange:v,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(K,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:!j,onPress:h,children:a.isPending?"Adding…":"Add provider"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(G,{getPayload:()=>s.trim()===""||m.trim()===""?null:{instance:s.trim(),provider_type:o||"openai-compatible",api_base:m.trim(),api_key:u.trim()||null}})]})]})}function Pe({onClose:t}){const[a,s]=x.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,o])=>e.jsx("button",{type:"button","aria-pressed":a===n,onClick:()=>s(n),className:a===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:o},n))})}),a==="known"?e.jsx(ye,{onClose:t}):e.jsx(ke,{onClose:t})]})})}function Ne({provider:t,onClose:a}){const s=ie(),[n,o]=x.useState(t.provider_type??""),[d,m]=x.useState(t.api_base??""),[v,u]=x.useState(!1),[p,c]=x.useState(""),j=()=>{if(s.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};v&&p.trim()&&(h.api_key=p.trim()),s.mutate({instance:t.instance,body:h},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(R,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:o,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:m,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:v?e.jsxs(e.Fragment,{children:[e.jsx(K,{value:p,onChange:c,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),c("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(g,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:s.isPending,onPress:j,children:s.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function Se(t,a){const s=new Map((a??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...s.keys(),...n.keys()])].sort().map(d=>{const m=s.get(d);return{instance:d,source:m?"stored":"config",stored:m,meta:n.get(d)}})}function Ce({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const a=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",s=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?s:`${t.error??"Unreachable"} · ${s}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function Ae({healthy:t,total:a,checkedAt:s}){const n=t===a,o=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(s)]}):null,e.jsx(g,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:o.isPending,onPress:()=>o.mutate(),children:o.isPending?"Re-checking…":"Re-check all"})]})}function B({n:t,title:a,children:s}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:a}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:s})]})]})}function Te({onAddProvider:t,needsPricing:a,onEnablePricing:s,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(B,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(B,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(B,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),a?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:s,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Le(){var w,P,L,D;const t=Q(),a=X(),s=Z(),n=ee(),o=se(),d=te(),m=ae(),[v,u]=x.useState(!1),[p,c]=x.useState(null),[j,h]=x.useState({}),l=Se((w=t.data)==null?void 0:w.providers,a.data),y=new Map((((P=n.data)==null?void 0:P.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||a.isLoading,f=((L=a.data)==null?void 0:L.find(r=>r.instance===p))??null,k=((D=s.data)==null?void 0:D.require_pricing)===!0&&s.data.default_pricing===!1,T=!i&&l.length===0&&!v,E=r=>{h(b=>({...b,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:b=>h(N=>({...N,[r]:{status:"done",...b}})),onError:b=>h(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(b)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ne,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:v||T?null:e.jsx(g,{variant:"primary",onPress:()=>{c(null),u(!0)},children:"Add provider"})}),e.jsx(R,{error:t.error??a.error??s.error??n.error??m.error??o.error}),T?e.jsx(Te,{onAddProvider:()=>{c(null),u(!0)},needsPricing:k,onEnablePricing:()=>m.mutate({default_pricing:!0}),enabling:m.isPending}):null,v?e.jsx(Pe,{onClose:()=>u(!1)}):null,f?e.jsx(Ne,{provider:f,onClose:()=>c(null)}):null,!i&&l.length>0&&n.data&&n.data.total>0?e.jsx(Ae,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(me,{children:[e.jsx(ue,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(xe,{colSpan:6}):l.length===0?e.jsx(pe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):l.map(r=>{var b,N,$,q,F,O;return e.jsxs(he,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(J,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((b=r.meta)==null?void 0:b.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(_e,{health:y.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(g,{size:"sm",variant:"outline",isDisabled:((F=j[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>E(r.instance),children:"Test"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{u(!1),c(r.instance)},children:"Edit"}),e.jsx(re,{confirmLabel:"Delete",isPending:o.isPending,onConfirm:()=>o.mutate(r.instance),children:"Delete"})]}),e.jsx(Ce,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Le as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as J}from"./react-dgEcD0HR.js";import{J as Q,R as X,B as Z,K as ee,T as se,U as te,V as ae,P as ne,E as R,C as re,W as ie,X as oe,Q as z,h as U,Y as M,Z as le,_ as de,$ as ce}from"./index-hDVMDLdX.js";import{F as _}from"./Field-HzRk1KDP.js";import{T as me,a as ue,b as S,L as xe,c as pe,d as he,e as C}from"./Table-CLdjdyTx.js";import{B as g,f as H,d as A,S as ve,T as ge,L as Y,I as V,D as je,C as I,a as fe,b as be}from"./heroui-BX6JwHY-.js";function K({value:t,onChange:a,label:s,placeholder:n,description:o}){return e.jsxs(ge,{value:t,onChange:a,className:"flex max-w-md flex-col gap-1",children:[e.jsx(Y,{className:"text-sm font-medium text-[var(--otari-ink)]",children:s}),e.jsx(V,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),o?e.jsx(je,{className:"text-xs text-[var(--otari-muted)]",children:o}):null]})}function W({label:t,value:a,onChange:s,description:n,placeholder:o,extra:d=[],includeCatalog:m=!0}){var y;const v=de(),u=x.useMemo(()=>m?[...d,...(v.data??[]).map(i=>({id:i.id,name:i.name}))]:d,[v.data,d,m]),[p,c]=x.useState(()=>{var i;return((i=u.find(f=>f.id===a))==null?void 0:i.name)??""}),j=((y=u.find(i=>i.id===a))==null?void 0:y.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),l=u.filter(i=>!h||i.name.toLowerCase().includes(h)||i.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(I.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:c,onSelectionChange:i=>{var f;i!=null?(s(String(i)),c(((f=u.find(k=>k.id===String(i)))==null?void 0:f.name)??"")):(s(""),c(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(Y,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(I.InputGroup,{children:[e.jsx(V,{placeholder:o??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(I.Trigger,{})]}),e.jsx(I.Popover,{children:e.jsx(fe,{items:l,className:"max-h-72 overflow-auto",children:i=>e.jsx(be,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function G({getPayload:t}){const a=ce(),s=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(g,{variant:"outline",isDisabled:s===null||a.isPending,onPress:()=>{s&&a.mutate(s)},children:a.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:a.isPending?null:a.error?e.jsx("span",{className:"text-xs text-red-700",children:U(a.error)}):a.data?a.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",a.data.model_count," model",a.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:a.data.error??"Connection failed."}):null})]})}function ye({onClose:t}){var w;const a=M(),[s,n]=x.useState(""),[o,d]=x.useState(""),[m,v]=x.useState(!1),[u,p]=x.useState(""),[c,j]=x.useState(""),h=le(s),l=((w=h.data)==null?void 0:w.id)===s?h.data:void 0;x.useEffect(()=>{l&&p(l.default_api_base??"")},[l]);const y=(l==null?void 0:l.env_key_present)??!1,i=((l==null?void 0:l.requires_api_key)??!0)&&!y,f=c.trim()!==""&&c.trim()!==s,k=/[:/]/.test(c),T=s!==""&&!k&&(!i||o.trim()!=="")&&!a.isPending,E=()=>{T&&a.mutate({instance:f?c.trim():s,provider_type:f?s:null,api_base:u.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(R,{error:a.error}),e.jsx(W,{label:"Provider",value:s,onChange:P=>{n(P),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(K,{value:o,onChange:d,label:l&&!i?"API key (optional)":"API key",description:l?i?`${l.name}'s endpoint is built in — just add your key.`:y?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>v(P=>!P),children:m?"Hide advanced":"Advanced (API base, rename)"}),m?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:c,onChange:j,placeholder:s||"instance name",description:k?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:!T,onPress:E,children:a.isPending?"Adding…":"Add provider"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(G,{getPayload:()=>s===""?null:{instance:f?c.trim():s,provider_type:f?s:null,api_base:u.trim()||null,api_key:o.trim()||null}})]})]})}function ke({onClose:t}){const a=M(),[s,n]=x.useState(""),[o,d]=x.useState("openai-compatible"),[m,v]=x.useState(""),[u,p]=x.useState(""),c=/[:/]/.test(s),j=s.trim()!==""&&!c&&m.trim()!==""&&!a.isPending,h=()=>{j&&a.mutate({instance:s.trim(),provider_type:o||"openai-compatible",api_base:m.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(R,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:s,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:c?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(W,{label:"Compatible with",value:o,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:m,onChange:v,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(K,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:!j,onPress:h,children:a.isPending?"Adding…":"Add provider"}),e.jsx(g,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(G,{getPayload:()=>s.trim()===""||m.trim()===""?null:{instance:s.trim(),provider_type:o||"openai-compatible",api_base:m.trim(),api_key:u.trim()||null}})]})]})}function Pe({onClose:t}){const[a,s]=x.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,o])=>e.jsx("button",{type:"button","aria-pressed":a===n,onClick:()=>s(n),className:a===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:o},n))})}),a==="known"?e.jsx(ye,{onClose:t}):e.jsx(ke,{onClose:t})]})})}function Ne({provider:t,onClose:a}){const s=ie(),[n,o]=x.useState(t.provider_type??""),[d,m]=x.useState(t.api_base??""),[v,u]=x.useState(!1),[p,c]=x.useState(""),j=()=>{if(s.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};v&&p.trim()&&(h.api_key=p.trim()),s.mutate({instance:t.instance,body:h},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(R,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:o,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:m,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:v?e.jsxs(e.Fragment,{children:[e.jsx(K,{value:p,onChange:c,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),c("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(g,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"primary",isDisabled:s.isPending,onPress:j,children:s.isPending?"Saving…":"Save changes"}),e.jsx(g,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function Se(t,a){const s=new Map((a??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...s.keys(),...n.keys()])].sort().map(d=>{const m=s.get(d);return{instance:d,source:m?"stored":"config",stored:m,meta:n.get(d)}})}function Ce({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const a=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",s=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?s:`${t.error??"Unreachable"} · ${s}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function Ae({healthy:t,total:a,checkedAt:s}){const n=t===a,o=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(s)]}):null,e.jsx(g,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:o.isPending,onPress:()=>o.mutate(),children:o.isPending?"Re-checking…":"Re-check all"})]})}function B({n:t,title:a,children:s}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:a}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:s})]})]})}function Te({onAddProvider:t,needsPricing:a,onEnablePricing:s,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(B,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(B,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(B,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),a?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:s,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(g,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Le(){var w,P,L,D;const t=Q(),a=X(),s=Z(),n=ee(),o=se(),d=te(),m=ae(),[v,u]=x.useState(!1),[p,c]=x.useState(null),[j,h]=x.useState({}),l=Se((w=t.data)==null?void 0:w.providers,a.data),y=new Map((((P=n.data)==null?void 0:P.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||a.isLoading,f=((L=a.data)==null?void 0:L.find(r=>r.instance===p))??null,k=((D=s.data)==null?void 0:D.require_pricing)===!0&&s.data.default_pricing===!1,T=!i&&l.length===0&&!v,E=r=>{h(b=>({...b,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:b=>h(N=>({...N,[r]:{status:"done",...b}})),onError:b=>h(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(b)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ne,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:v||T?null:e.jsx(g,{variant:"primary",onPress:()=>{c(null),u(!0)},children:"Add provider"})}),e.jsx(R,{error:t.error??a.error??s.error??n.error??m.error??o.error}),T?e.jsx(Te,{onAddProvider:()=>{c(null),u(!0)},needsPricing:k,onEnablePricing:()=>m.mutate({default_pricing:!0}),enabling:m.isPending}):null,v?e.jsx(Pe,{onClose:()=>u(!1)}):null,f?e.jsx(Ne,{provider:f,onClose:()=>c(null)}):null,!i&&l.length>0&&n.data&&n.data.total>0?e.jsx(Ae,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(me,{children:[e.jsx(ue,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(xe,{colSpan:6}):l.length===0?e.jsx(pe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):l.map(r=>{var b,N,$,q,F,O;return e.jsxs(he,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(J,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((b=r.meta)==null?void 0:b.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(_e,{health:y.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(g,{size:"sm",variant:"outline",isDisabled:((F=j[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>E(r.instance),children:"Test"}),e.jsx(g,{size:"sm",variant:"ghost",onPress:()=>{u(!1),c(r.instance)},children:"Edit"}),e.jsx(re,{confirmLabel:"Delete",isPending:o.isPending,onConfirm:()=>o.mutate(r.instance),children:"Delete"})]}),e.jsx(Ce,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Le as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js b/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js deleted file mode 100644 index 118dac28..00000000 --- a/src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/ProvidersPage-swJiAs79.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-CSyrpBqZ.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as m,L as X}from"./react-q-ooZ0ti.js";import{J as Z,T as Q,B as ee,K as te,U as se,V as ae,W as ne,P as re,E as B,C as ie,X as oe,Y as le,R as z,h as U,Z as M,_ as Y,$ as de}from"./index-D1FfVwkg.js";import{F as _}from"./Field-gj3-ox4q.js";import{T as ce,a as me,b as S,L as ue,c as xe,d as pe,e as C}from"./Table-DEsIhjZo.js";import{B as j,f as H,c as A,S as he,T as ve,L as V,I as W,D as ge,C as E,a as je,b as fe}from"./heroui-CewI8xK4.js";function D({value:t,onChange:s,label:a,placeholder:n,description:l}){return e.jsxs(ve,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(W,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),l?e.jsx(ge,{className:"text-xs text-[var(--otari-muted)]",children:l}):null]})}function G({label:t,value:s,onChange:a,description:n,placeholder:l,extra:o=[],includeCatalog:c=!0}){var k;const g=M(),u=m.useMemo(()=>c?[...o,...(g.data??[]).map(i=>({id:i.id,name:i.name}))]:o,[g.data,o,c]),[h,x]=m.useState(()=>{var i;return((i=u.find(f=>f.id===s))==null?void 0:i.name)??""}),p=((k=u.find(i=>i.id===s))==null?void 0:k.name)??"",v=h.trim()===p.trim()?"":h.trim().toLowerCase(),d=u.filter(i=>!v||i.name.toLowerCase().includes(v)||i.id.toLowerCase().includes(v)).slice(0,50);return e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:h,onInputChange:x,onSelectionChange:i=>{var f;i!=null?(a(String(i)),x(((f=u.find(P=>P.id===String(i)))==null?void 0:f.name)??"")):(a(""),x(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(V,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(E.InputGroup,{children:[e.jsx(W,{placeholder:l??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:i=>i.currentTarget.select()}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(je,{items:d,className:"max-h-72 overflow-auto",children:i=>e.jsx(fe,{id:i.id,textValue:i.name,children:i.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function J({getPayload:t}){const s=de(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:U(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function be({onClose:t}){var w;const s=M(),a=Y(),[n,l]=m.useState(""),[o,c]=m.useState(""),[g,u]=m.useState(!1),[h,x]=m.useState(""),[p,v]=m.useState(""),d=(w=s.data)==null?void 0:w.find(b=>b.id===n),k=(d==null?void 0:d.env_key_present)??!1,i=((d==null?void 0:d.requires_api_key)??!0)&&!k,f=p.trim()!==""&&p.trim()!==n,P=/[:/]/.test(p),T=n!==""&&!P&&(!i||o.trim()!=="")&&!a.isPending,K=()=>{T&&a.mutate({instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:a.error}),e.jsx(G,{label:"Provider",value:n,onChange:b=>{var I,R;l(b),v(""),x(((R=(I=s.data)==null?void 0:I.find(r=>r.id===b))==null?void 0:R.default_api_base)??"")},description:"Its endpoint is built in."}),e.jsx(D,{value:o,onChange:c,label:d&&!i?"API key (optional)":"API key",description:d?i?`${d.name}'s endpoint is built in — just add your key.`:k?`${d.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${d.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>u(b=>!b),children:g?"Hide advanced":"Advanced (API base, rename)"}),g?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:h,onChange:x,placeholder:(d==null?void 0:d.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:p,onChange:v,placeholder:n||"instance name",description:P?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!T,onPress:K,children:a.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>n===""?null:{instance:f?p.trim():n,provider_type:f?n:null,api_base:h.trim()||null,api_key:o.trim()||null}})]})]})}function ye({onClose:t}){const s=Y(),[a,n]=m.useState(""),[l,o]=m.useState("openai-compatible"),[c,g]=m.useState(""),[u,h]=m.useState(""),x=/[:/]/.test(a),p=a.trim()!==""&&!x&&c.trim()!==""&&!s.isPending,v=()=>{p&&s.mutate({instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(B,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:x?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(G,{label:"Compatible with",value:l,onChange:o,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:c,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(D,{value:u,onChange:h,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!p,onPress:v,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(J,{getPayload:()=>a.trim()===""||c.trim()===""?null:{instance:a.trim(),provider_type:l||"openai-compatible",api_base:c.trim(),api_key:u.trim()||null}})]})]})}function ke({onClose:t}){const[s,a]=m.useState("known");return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,l])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:l},n))})}),s==="known"?e.jsx(be,{onClose:t}):e.jsx(ye,{onClose:t})]})})}function Pe({provider:t,onClose:s}){const a=oe(),[n,l]=m.useState(t.provider_type??""),[o,c]=m.useState(t.api_base??""),[g,u]=m.useState(!1),[h,x]=m.useState(""),p=()=>{if(a.isPending)return;const v={provider_type:n.trim()||null,api_base:o.trim()||null,expected_updated_at:t.updated_at};g&&h.trim()&&(v.api_key=h.trim()),a.mutate({instance:t.instance,body:v},{onSuccess:s})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(B,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:l,placeholder:"openai"}),e.jsx(_,{label:"API base",value:o,onChange:c,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(D,{value:h,onChange:x,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),x("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:a.isPending,onPress:p,children:a.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Ne(t,s){const a=new Map((s??[]).map(o=>[o.instance,o])),n=new Map((t??[]).map(o=>[o.instance,o]));return[...new Set([...a.keys(),...n.keys()])].sort().map(o=>{const c=a.get(o);return{instance:o,source:c?"stored":"config",stored:c,meta:n.get(o)}})}function Se({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(he,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function Ce({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=t.ok?"border-green-200 bg-green-50 text-green-700":"border-red-200 bg-red-50 text-red-700",a=t.checked_at?`Last checked ${z(t.checked_at)}`:"Not checked yet",n=t.ok?a:`${t.error??"Unreachable"} · ${a}`;return e.jsxs("span",{title:n,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t.ok?"bg-green-500":"bg-red-500"}`}),t.ok?"Reachable":"Unreachable"]})}function _e({healthy:t,total:s,checkedAt:a}){const n=t===s,l=le();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${n?"bg-green-500":"bg-red-500"}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",s," provider",s===1?"":"s"," reachable"]}),a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",z(a)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function L({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ae({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n}){return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(L,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(L,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(L,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",onPress:t,children:"Add your first provider"})})]})})}function Ke(){var w,b,I,R;const t=Z(),s=Q(),a=ee(),n=te(),l=se(),o=ae(),c=ne(),[g,u]=m.useState(!1),[h,x]=m.useState(null),[p,v]=m.useState({}),d=Ne((w=t.data)==null?void 0:w.providers,s.data),k=new Map((((b=n.data)==null?void 0:b.providers)??[]).map(r=>[r.instance,r])),i=t.isLoading||s.isLoading,f=((I=s.data)==null?void 0:I.find(r=>r.instance===h))??null,P=((R=a.data)==null?void 0:R.require_pricing)===!0&&a.data.default_pricing===!1,T=!i&&d.length===0&&!g,K=r=>{v(y=>({...y,[r]:{status:"pending"}})),o.mutate(r,{onSuccess:y=>v(N=>({...N,[r]:{status:"done",...y}})),onError:y=>v(N=>({...N,[r]:{status:"done",ok:!1,model_count:0,error:U(y)}}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||T?null:e.jsx(j,{variant:"primary",onPress:()=>{x(null),u(!0)},children:"Add provider"})}),e.jsx(B,{error:t.error??s.error??a.error??n.error??c.error??l.error}),T?e.jsx(Ae,{onAddProvider:()=>{x(null),u(!0)},needsPricing:P,onEnablePricing:()=>c.mutate({default_pricing:!0}),enabling:c.isPending}):null,g?e.jsx(ke,{onClose:()=>u(!1)}):null,f?e.jsx(Pe,{provider:f,onClose:()=>x(null)}):null,!i&&d.length>0&&n.data&&n.data.total>0?e.jsx(_e,{healthy:n.data.healthy,total:n.data.total,checkedAt:n.data.checked_at}):null,e.jsxs(ce,{children:[e.jsx(me,{children:e.jsxs("tr",{children:[e.jsx(S,{children:"Provider"}),e.jsx(S,{children:"Type"}),e.jsx(S,{children:"Source"}),e.jsx(S,{children:"API key"}),e.jsx(S,{children:"Status"}),e.jsx(S,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:i?e.jsx(ue,{colSpan:6}):d.length===0?e.jsx(xe,{colSpan:6,children:"No providers yet. Add your first provider to start serving models."}):d.map(r=>{var y,N,$,q,F,O;return e.jsxs(pe,{children:[e.jsx(C,{className:"font-medium",children:e.jsx(X,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:((y=r.meta)==null?void 0:y.provider_type)??((N=r.stored)==null?void 0:N.provider_type)??r.instance}),e.jsx(C,{children:r.source==="stored"?e.jsx(H,{size:"sm",color:"accent",children:"stored"}):e.jsx(H,{size:"sm",color:"default",children:"config"})}),e.jsx(C,{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:($=r.stored)!=null&&$.last4?`••••${r.stored.last4}`:"none set"}):(q=r.meta)!=null&&q.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"}),e.jsx(C,{children:e.jsx(Ce,{health:k.get(r.instance)})}),e.jsx(C,{children:r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((F=p[r.instance])==null?void 0:F.status)==="pending"||((O=r.stored)==null?void 0:O.decryptable)===!1,onPress:()=>K(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{u(!1),x(r.instance)},children:"Edit"}),e.jsx(ie,{confirmLabel:"Delete",isPending:l.isPending,onConfirm:()=>l.mutate(r.instance),children:"Delete"})]}),e.jsx(Se,{state:p[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})})]},r.instance)})})]})]})}export{Ke as ProvidersPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/ProvidersPage-Bz-mLWy0.js diff --git a/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js b/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js deleted file mode 100644 index 326bf2a5..00000000 --- a/src/gateway/static/dashboard/assets/SettingsPage-BNeqLlOB.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{B as R,W as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,a4 as O,T as F,a5 as K,I as w}from"./index-CSyrpBqZ.js";import{c as v,B as h,A as d,g as I,I as M}from"./heroui-CewI8xK4.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function B(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function L({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),c=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const o=Number(n),g=n.trim()!==""&&Number.isFinite(o)&&(c||Number.isInteger(o)),m=t.minimum??void 0,p=t.exclusive_minimum??void 0,x=p!==void 0?o>p:m!==void 0?o>=m:o>=0,l=g&&x&&o!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{type:"number",min:"0",step:c?"any":"1",inputMode:c?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(o),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const c=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:o=>i(o.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!c,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(L,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[c,o]=u.useState(!1),g=async()=>{var m,p,x;(m=a.current)==null||m.focus(),(p=a.current)==null||p.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(t),i(!0),o(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}o(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:g,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),c?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var c,o;t!==void 0&&((c=i.current)==null||c.focus(),(o=i.current)==null||o.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=A(),{replaceMasterKey:s}=O(),[a,n]=u.useState(!1),[i,c]=u.useState(),o=t==="generated",g=()=>r.mutate(void 0,{onSuccess:x=>{c(x.master_key),s(x.master_key)}}),m=()=>{n(!1),c(void 0),r.reset()},p=x=>{x?(r.reset(),n(!0)):i===void 0&&m()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:a,onOpenChange:p,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),a?e.jsx(G,{masterKey:i,error:r.error,isPending:r.isPending,onRegenerate:g,onClose:m}):null]})]})})}function X(){var c;const t=F(),r=K(),s=r.data,a=((c=t.data)==null?void 0:c.length)??0,n=(t.data??[]).filter(o=>!o.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:c=>c?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[c,o]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=g.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),p=(s==null?void 0:s.config)??[],x=p.filter(l=>(c?l.settable:!0)&&B(l,n)),k=ee(x);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:g,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:l=>o(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",x.length," of ",p.length," settings"]}):null,s&&x.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,B as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js b/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js deleted file mode 100644 index 6bfa24f3..00000000 --- a/src/gateway/static/dashboard/assets/SettingsPage-CLdo7bKV.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{B as R,V as C,P,E as y,$ as E,a0 as T,a1 as _,F as D,a2 as A,a3 as O,R as F,a4 as K,I as w}from"./index-D6YDX-oj.js";import{d as v,B as h,A as d,g as I,I as M}from"./heroui-BX6JwHY-.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function B(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function $({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function L({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),c=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const o=Number(n),g=n.trim()!==""&&Number.isFinite(o)&&(c||Number.isInteger(o)),m=t.minimum??void 0,p=t.exclusive_minimum??void 0,x=p!==void 0?o>p:m!==void 0?o>=m:o>=0,l=g&&x&&o!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{type:"number",min:"0",step:c?"any":"1",inputMode:c?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(o),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const c=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:o=>i(o.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!c,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx($,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx(L,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[c,o]=u.useState(!1),g=async()=>{var m,p,x;(m=a.current)==null||m.focus(),(p=a.current)==null||p.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(t),i(!0),o(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}o(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:g,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),c?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var c,o;t!==void 0&&((c=i.current)==null||c.focus(),(o=i.current)==null||o.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=A(),{replaceMasterKey:s}=O(),[a,n]=u.useState(!1),[i,c]=u.useState(),o=t==="generated",g=()=>r.mutate(void 0,{onSuccess:x=>{c(x.master_key),s(x.master_key)}}),m=()=>{n(!1),c(void 0),r.reset()},p=x=>{x?(r.reset(),n(!0)):i===void 0&&m()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:a,onOpenChange:p,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),a?e.jsx(G,{masterKey:i,error:r.error,isPending:r.isPending,onRegenerate:g,onClose:m}):null]})]})})}function J(){var c;const t=F(),r=K(),s=r.data,a=((c=t.data)==null?void 0:c.length)??0,n=(t.data??[]).filter(o=>!o.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function Q({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(J,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:c=>c?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[c,o]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=g.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),p=(s==null?void 0:s.config)??[],x=p.filter(l=>(c?l.settable:!0)&&B(l,n)),k=ee(x);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:g,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:l=>o(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",x.length," of ",p.length," settings"]}):null,s&&x.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(Q,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,B as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-CVx7wSlF.js b/src/gateway/static/dashboard/assets/SettingsPage-CVx7wSlF.js deleted file mode 100644 index e7fa7228..00000000 --- a/src/gateway/static/dashboard/assets/SettingsPage-CVx7wSlF.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{B as R,V as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,a4 as O,R as F,a5 as K,I as w}from"./index-Dp4DdBFR.js";import{d as v,B as h,A as d,g as I,I as M}from"./heroui-BX6JwHY-.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function B(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function L({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),c=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const o=Number(n),g=n.trim()!==""&&Number.isFinite(o)&&(c||Number.isInteger(o)),m=t.minimum??void 0,p=t.exclusive_minimum??void 0,x=p!==void 0?o>p:m!==void 0?o>=m:o>=0,l=g&&x&&o!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{type:"number",min:"0",step:c?"any":"1",inputMode:c?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(o),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const c=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:o=>i(o.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!c,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(L,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[c,o]=u.useState(!1),g=async()=>{var m,p,x;(m=a.current)==null||m.focus(),(p=a.current)==null||p.select();try{if((x=navigator.clipboard)!=null&&x.writeText){await navigator.clipboard.writeText(t),i(!0),o(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}o(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:g,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),c?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var c,o;t!==void 0&&((c=i.current)==null||c.focus(),(o=i.current)==null||o.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=A(),{replaceMasterKey:s}=O(),[a,n]=u.useState(!1),[i,c]=u.useState(),o=t==="generated",g=()=>r.mutate(void 0,{onSuccess:x=>{c(x.master_key),s(x.master_key)}}),m=()=>{n(!1),c(void 0),r.reset()},p=x=>{x?(r.reset(),n(!0)):i===void 0&&m()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:a,onOpenChange:p,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),a?e.jsx(G,{masterKey:i,error:r.error,isPending:r.isPending,onRegenerate:g,onClose:m}):null]})]})})}function J(){var c;const t=F(),r=K(),s=r.data,a=((c=t.data)==null?void 0:c.length)??0,n=(t.data??[]).filter(o=>!o.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function Q({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(J,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:c=>c?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[c,o]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=g.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),p=(s==null?void 0:s.config)??[],x=p.filter(l=>(c?l.settable:!0)&&B(l,n)),k=ee(x);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:g,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:l=>o(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",x.length," of ",p.length," settings"]}):null,s&&x.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(Q,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,B as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js b/src/gateway/static/dashboard/assets/SettingsPage-iRP-TsYX.js similarity index 93% rename from src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js rename to src/gateway/static/dashboard/assets/SettingsPage-iRP-TsYX.js index 0b221458..51709cea 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-BzPdd2gR.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-iRP-TsYX.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as u}from"./react-q-ooZ0ti.js";import{B as R,W as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,T as O,a4 as F,I as w}from"./index-D1FfVwkg.js";import{c as v,B as h,A as d,g as I,I as K}from"./heroui-CewI8xK4.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function M(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function L({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function H(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function Y({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx(L,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:H(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function q({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(Y,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function V({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function G({source:t}){const r=A(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(V,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function W(){var o;const t=O(),r=F(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function X({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(G,{source:t}),e.jsx(W,{})]})})]})}function J({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Q(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(J,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function Z(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ae(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&M(l,n)),k=Z(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(q,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Q,{}):null,s?e.jsx(X,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ae as SettingsPage,M as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{B as R,V as C,P,E as y,a0 as E,a1 as T,a2 as _,F as D,a3 as A,R as O,a4 as F,I as w}from"./index-hDVMDLdX.js";import{d as v,B as h,A as d,g as I,I as K}from"./heroui-BX6JwHY-.js";function b(t,r){return{[t]:r}}function z(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function M(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||z(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function L({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function H(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function Y({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(D,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx(L,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:H(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function q({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(Y,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function U({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function G({source:t}){const r=A(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:I({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(U,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=O(),r=F(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(G,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function W(){const t=E(),r=T(),s=_(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function Z(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ae(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&M(l,n)),k=Z(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(q,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(W,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ae as SettingsPage,M as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js b/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js deleted file mode 100644 index cec5d22d..00000000 --- a/src/gateway/static/dashboard/assets/Table-DEsIhjZo.js +++ /dev/null @@ -1 +0,0 @@ -import{j as r}from"./tanstack-query-W9y7rsMr.js";import{r as c}from"./react-q-ooZ0ti.js";import{S as f}from"./heroui-CewI8xK4.js";const p=60,h=c.createContext(null);function w({children:n}){const[t,s]=c.useState(null),i=c.useCallback(e=>{s(o=>o||Array.from(e.cells,l=>Math.max(p,Math.round(l.getBoundingClientRect().width))))},[]),u=c.useCallback((e,o)=>{s(l=>{if(!l)return l;const d=l.slice();return d[e]=Math.max(p,Math.round(o)),d})},[]),x={widths:t,pinWidths:i,setColumnWidth:u},a=t?t.reduce((e,o)=>e+o,0):null;return r.jsx(h.Provider,{value:x,children:r.jsx("div",{className:"overflow-x-auto rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)]",children:r.jsxs("table",{className:`border-collapse text-sm ${t?"table-fixed":"w-full"}`,style:a?{width:`${a}px`}:void 0,children:[t?r.jsx("colgroup",{children:t.map((e,o)=>r.jsx("col",{style:{width:`${e}px`}},o))}):null,n]})})})}function C({children:n}){return r.jsx("thead",{className:"border-b border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-left",children:n})}function b({resize:n}){const t=c.useRef(null),s=c.useRef(null),i=a=>{var l,d;const e=(l=t.current)==null?void 0:l.closest("th"),o=e==null?void 0:e.parentElement;!e||!(o instanceof HTMLTableRowElement)||(a.preventDefault(),a.stopPropagation(),n.pinWidths(o),(d=t.current)==null||d.setPointerCapture(a.pointerId),s.current={index:e.cellIndex,startX:a.clientX,startWidth:e.getBoundingClientRect().width})},u=a=>{var o;const e=s.current;!e||!((o=t.current)!=null&&o.hasPointerCapture(a.pointerId))||n.setColumnWidth(e.index,e.startWidth+(a.clientX-e.startX))},x=a=>{var e;(e=t.current)!=null&&e.hasPointerCapture(a.pointerId)&&t.current.releasePointerCapture(a.pointerId),s.current=null};return r.jsx("span",{ref:t,"aria-hidden":!0,title:"Drag to resize",onPointerDown:i,onPointerMove:u,onPointerUp:x,onPointerCancel:x,className:"group absolute top-0 right-0 z-10 flex h-full w-2 cursor-col-resize touch-none select-none justify-end",children:r.jsx("span",{className:"h-full w-px bg-[var(--otari-line)] transition-all group-hover:w-0.5 group-hover:bg-[var(--otari-brand)]"})})}function N({children:n,className:t="",ariaSort:s}){const i=c.useContext(h);return r.jsxs("th",{"aria-sort":s,className:`relative px-4 py-2.5 font-semibold text-[var(--otari-ink)] whitespace-nowrap ${t}`,children:[n,i?r.jsx(b,{resize:i}):null]})}function R({children:n,className:t=""}){return r.jsx("td",{className:`px-4 py-2.5 align-middle ${t}`,children:n})}function y({children:n,className:t="",onClick:s,selected:i}){return r.jsx("tr",{onClick:s,onKeyDown:s?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s())}:void 0,tabIndex:s?0:void 0,"aria-selected":i,className:`border-b border-[var(--otari-line)] last:border-b-0 ${s?"cursor-pointer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--otari-brand)]":""} ${i?"bg-[var(--otari-brand-tint)]":"hover:bg-[var(--otari-bg)]"} ${t}`,children:n})}function m({colSpan:n,children:t}){return r.jsx("tr",{children:r.jsx("td",{colSpan:n,className:"px-4 py-10 text-center text-[var(--otari-muted)]",children:t})})}function z({colSpan:n}){return r.jsx(m,{colSpan:n,children:r.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.jsx(f,{size:"sm"})," Loading…"]})})}export{z as L,w as T,C as a,N as b,m as c,y as d,R as e}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B3QvV7KI.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B3QvV7KI.js index 96dfae83..2e95bdf7 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-OKm-s8Wi.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B3QvV7KI.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d}from"./react-dgEcD0HR.js";import{a5 as C,a6 as L,P as E,E as P,h as w,a7 as R,F as D}from"./index-D6YDX-oj.js";import{d as N,B as b}from"./heroui-BX6JwHY-.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d}from"./react-dgEcD0HR.js";import{a5 as C,a6 as L,P as E,E as P,h as w,a7 as R,F as D}from"./index-hDVMDLdX.js";import{d as N,B as b}from"./heroui-BX6JwHY-.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js deleted file mode 100644 index 35454e78..00000000 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-ChC-YhRl.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as d}from"./react-q-ooZ0ti.js";import{a6 as C,a7 as L,P as E,E as P,h as w,a8 as R,F as D}from"./index-CSyrpBqZ.js";import{c as N,B as b}from"./heroui-CewI8xK4.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js deleted file mode 100644 index 590dfa16..00000000 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-qp13etCg.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as d}from"./react-q-ooZ0ti.js";import{a5 as k,a6 as N,P as S,E as _,h as y,a7 as T,F as C}from"./index-D1FfVwkg.js";import{c as j,B as b}from"./heroui-CewI8xK4.js";function P(s,t){return{[s]:t}}const R=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function D(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function L({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const v="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50";function g({field:s,help:t}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function $({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),l=T();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:o=>{c(o.target.value),l.reset()},className:`w-64 ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||l.isPending,onPress:()=>l.mutate({service:s.service,url:x}),children:l.isPending?"Testing…":"Test"})]}),e.jsx("span",{role:"status","aria-live":"polite",className:"block max-w-md break-words text-xs",children:l.isPending?null:l.error?e.jsx("span",{className:"text-red-700",children:y(l.error)}):l.data?e.jsx("span",{className:l.data.ok?"font-medium text-green-700":"text-red-700",children:l.data.reason}):null}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function B({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const l=i!==r;return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:`w-64 ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})]}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function E({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const l=i.trim(),m=Number(l),o=(l===""||Number.isInteger(m)&&m>=1)&&l!==r;return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s,help:"Leave blank to use the backend default."}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-28 text-right tabular-nums ${v}`}),e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(l===""?null:m),children:"Save"})]}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function M({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:"flex flex-col gap-1.5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[e.jsx(g,{field:s}),e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1.5 sm:items-end",children:[e.jsx(C,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n}),a?e.jsx("span",{className:"max-w-md break-words text-xs text-red-700",children:a}):null]})]})}function z({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx($,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(E,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(M,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(B,{field:s,onSave:t,saveError:a,disabled:n})}function q(){const s=k(),t=N(),[a,n]=D(),[r,i]=d.useState({}),c=s.data,l=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(o=>[o.key,o])),x=(o,p)=>{i(h=>{const{[o.key]:f,...u}=h;return u}),t.mutate(P(o.key,p),{onSuccess:()=>n(`${o.key} saved`),onError:h=>i(f=>({...f,[o.key]:y(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(S,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(_,{error:s.error}),R.map(o=>{const p=o.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),f=[...p,...h];return f.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(j,{children:e.jsx(j.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:f.map(u=>e.jsx(z,{field:u,onSave:w=>x(u,w),saveError:r[u.key],disabled:l},u.key))})})]},o.key)}),e.jsx(L,{message:a})]})}export{q as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-v1VWfWQq.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-v1VWfWQq.js deleted file mode 100644 index 3c73f40a..00000000 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-v1VWfWQq.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d}from"./react-dgEcD0HR.js";import{a6 as C,a7 as L,P as E,E as P,h as w,a8 as R,F as D}from"./index-Dp4DdBFR.js";import{d as N,B as b}from"./heroui-BX6JwHY-.js";function B(s,t){return{[s]:t}}const M=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=d.useState(null),a=d.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function U({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",g="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function z({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r),o=R();d.useEffect(()=>{c(r)},[r]);const m=i.trim()!==r,x=i.trim();return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:i,disabled:n,placeholder:"unset",onChange:l=>{c(l.target.value),o.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(x===""?null:x),children:"Save"}),e.jsx(b,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:x===""||o.isPending,onPress:()=>o.mutate({service:s.service,url:x}),children:o.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:o.isPending?null:o.error?e.jsx("span",{className:"text-red-700",children:w(o.error)}):o.data?e.jsx("span",{className:o.data.ok?"font-medium text-green-700":"text-red-700",children:o.data.reason}):null}),e.jsx(j,{message:a})]})]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:m=>c(m.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(i.trim()===""?null:i.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[i,c]=d.useState(r);d.useEffect(()=>{c(r)},[r]);const o=i.trim(),m=Number(o),l=(o===""||Number.isInteger(m)&&m>=1)&&o!==r;return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:i,disabled:n,placeholder:"default",onChange:p=>c(p.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(b,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(o===""?null:m),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:g,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(D,{ariaLabel:s.key,value:r,onChange:i=>t(i==="default"?null:i==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(z,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n})}function K(){const s=C(),t=L(),[a,n]=$(),[r,i]=d.useState({}),c=s.data,o=!c||t.isPending,m=new Map(((c==null?void 0:c.fields)??[]).map(l=>[l.key,l])),x=(l,p)=>{i(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(B(l.key,p),{onSuccess:()=>n(`${l.key} saved`),onError:h=>i(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(E,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(P,{error:s.error}),M.map(l=>{const p=l.order.map(u=>m.get(u)).filter(u=>u!==void 0),h=((c==null?void 0:c.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...p,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(F,{field:u,onSave:T=>x(u,T),saveError:r[u.key],disabled:o},u.key))})})]},l.key)}),e.jsx(U,{message:a})]})}export{K as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js b/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js deleted file mode 100644 index 86ad0546..00000000 --- a/src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsagePage-BVzIiui8.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-CSyrpBqZ.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-D1FfVwkg.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js diff --git a/src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js b/src/gateway/static/dashboard/assets/UsagePage-CsWlUWCg.js similarity index 99% rename from src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js rename to src/gateway/static/dashboard/assets/UsagePage-CsWlUWCg.js index b890d515..88f1eb81 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-DLrkG3qL.js +++ b/src/gateway/static/dashboard/assets/UsagePage-CsWlUWCg.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as ie,r as x}from"./react-dgEcD0HR.js";import{u as ce,c as D,P as de,E as ue,d as J,S as j,N as v,L as p,M as $,O as he,a8 as S}from"./index-D6YDX-oj.js";import{S as E,B as me}from"./charts-Cr3Dij9t.js";import{T as xe,a as ge,b as M,L as fe,c as je,d as be,e as O}from"./Table-CLdjdyTx.js";import{B as k,S as K}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function z(a){return a.toLocaleString()}function ve(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const pe=3600,R=86400,L=[{label:"Last hour",seconds:pe,bucket:"hour"},{label:"24h",seconds:R,bucket:"hour"},{label:"7d",seconds:7*R,bucket:"day"},{label:"30d",seconds:30*R,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],U=L[3],A=15;function B(a){return new Date(Date.now()-a*1e3).toISOString()}function Q({title:a,rows:r,totalCost:n,emptyLabel:g,onDrill:c,loading:d}){const[u,_]=x.useState(!1),f=u?r:r.slice(0,A),N=r.length-f.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(xe,{children:[e.jsx(ge,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:d?e.jsx(fe,{colSpan:3}):r.length===0?e.jsx(je,{colSpan:3,children:g}):f.map((o,T)=>{const m=o.is_other,y=!m&&o.key!==null,h=n>0?o.cost/n:0;return e.jsxs(be,{onClick:y?()=>c(o.key):void 0,children:[e.jsx(O,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:m?`Other (${o.requests.toLocaleString()} req)`:o.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:z(o.requests)}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:$(o.cost)})]},o.key??`__null_${T}`)})})]}),!d&&N>0?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!0),children:["Show all ",r.length]}):null,!d&&u&&r.length>A?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!1),children:["Show top ",A]}):null]})}const ke=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function _e(a,r){return r==="cost"?a.cost:r==="tokens"?a.tokens:a.requests}function W(a,r){return r==="cost"?$(a):r==="tokens"?S(a):z(a)}function ye(a,r){const n=new Date(a);return Number.isNaN(n.getTime())?a:r==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Se(a,r,n){const g=a.map(d=>({label:ye(d.bucket_start,n),value:_e(d,r)})),c=g.length?Math.max(...g.map(d=>d.value)):0;return{points:g,peak:c,count:a.length}}function De(){var V,Z,Y;const a=ie(),r=ce(),[n,g]=x.useState(U),[c,d]=x.useState(()=>U.seconds===null?void 0:B(U.seconds)),[u,_]=x.useState(""),[f,N]=x.useState(""),[o,T]=x.useState("cost"),m=x.useMemo(()=>({start_date:c,model:u.trim()||void 0,user_id:f||void 0}),[c,u,f]),y=x.useMemo(()=>n.seconds===null||!c?null:{...m,start_date:new Date(new Date(c).getTime()-n.seconds*1e3).toISOString(),end_date:c},[m,n.seconds,c]),h=D(m,n.bucket),X=D(y??m,n.bucket,y!==null),i=h.data,t=i==null?void 0:i.totals,l=y!==null?(V=X.data)==null?void 0:V.totals:void 0,ee=x.useMemo(()=>({...m,model:void 0}),[m]),q=((Y=(Z=D(ee,n.bucket).data)==null?void 0:Z.by_model)==null?void 0:Y.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],se=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),te=(u&&!q.includes(u)?[u,...q]:q).map(s=>({value:s,label:s})),w=!!(u.trim()||f||n.seconds!==null),ae=!!(i&&t&&t.request_count===0&&!w),H=s=>{g(s),d(s.seconds===null?void 0:B(s.seconds))},ne=()=>{H(L[L.length-1]),_(""),N("")},re=()=>{n.seconds!==null&&d(B(n.seconds)),h.refetch()},I=s=>{const P=new URLSearchParams;c&&P.set("start_date",c);for(const[oe,G]of Object.entries(s))G&&P.set(oe,G);a(`/activity?${P.toString()}`)},le=t&&t.request_count>0?t.error_count/t.request_count:0,b=(i==null?void 0:i.series)??[],C=b.length>1,F=Se(b,o,n.bucket);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(de,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(k,{variant:"outline",onPress:re,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ue,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(s=>e.jsx(k,{size:"sm",variant:n.label===s.label?"primary":"outline",onPress:()=>H(s),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(J,{label:"User",value:f,onChange:N,options:se,placeholder:"All users"}),e.jsx(J,{label:"Model",value:u,onChange:_,options:te,placeholder:"All models"}),w?e.jsx(k,{size:"sm",variant:"ghost",onPress:ne,children:"Clear filters"}):null]})]}),ae?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(j,{label:"Spend",value:t?$(t.cost):"—",hint:t?e.jsx(v,{fraction:p(t.cost,l==null?void 0:l.cost)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(j,{label:"Requests",value:t?z(t.request_count):"—",hint:t?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[he(le)," errors",l?e.jsxs(e.Fragment,{children:[" · ",e.jsx(v,{fraction:p(t.request_count,l.request_count)})]}):null]}):null,chart:C?e.jsx(E,{values:b.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(j,{label:"Tokens",value:t?S(t.total_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.total_tokens,l==null?void 0:l.total_tokens)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(j,{label:"Cache read",value:t?S(t.cache_read_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_read_tokens,l==null?void 0:l.cache_read_tokens)}):null}),e.jsx(j,{label:"Cache write",value:t?S(t.cache_write_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_tokens,l==null?void 0:l.cache_write_tokens)}):null}),e.jsx(j,{label:"1h cache write",value:t?S(t.cache_write_1h_tokens??0):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_1h_tokens??0,(l==null?void 0:l.cache_write_1h_tokens)??0)}):null}),e.jsx(j,{label:"Avg latency",value:t?ve(t.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Q,{title:"Spend by model",rows:(i==null?void 0:i.by_model)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({model:s}),loading:h.isLoading}),e.jsx(Q,{title:"Spend by user",rows:(i==null?void 0:i.by_user)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({user_id:s}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[ke.map(s=>e.jsx(k,{size:"sm",variant:o===s.key?"primary":"outline",onPress:()=>T(s.key),children:s.label},s.key)),h.isFetching?e.jsx(K,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(K,{size:"sm"})}):b.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(me,{data:F.points,formatValue:s=>W(s,o),ariaLabel:`${o} per ${n.bucket}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[W(F.peak,o)," peak · ",F.count," ",n.bucket==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{De as UsagePage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as ie,r as x}from"./react-dgEcD0HR.js";import{u as ce,c as D,P as de,E as ue,d as J,S as j,N as v,L as p,M as $,O as he,a8 as S}from"./index-hDVMDLdX.js";import{S as E,B as me}from"./charts-Cr3Dij9t.js";import{T as xe,a as ge,b as M,L as fe,c as je,d as be,e as O}from"./Table-CLdjdyTx.js";import{B as k,S as K}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function z(a){return a.toLocaleString()}function ve(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const pe=3600,R=86400,L=[{label:"Last hour",seconds:pe,bucket:"hour"},{label:"24h",seconds:R,bucket:"hour"},{label:"7d",seconds:7*R,bucket:"day"},{label:"30d",seconds:30*R,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],U=L[3],A=15;function B(a){return new Date(Date.now()-a*1e3).toISOString()}function Q({title:a,rows:r,totalCost:n,emptyLabel:g,onDrill:c,loading:d}){const[u,_]=x.useState(!1),f=u?r:r.slice(0,A),N=r.length-f.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(xe,{children:[e.jsx(ge,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:d?e.jsx(fe,{colSpan:3}):r.length===0?e.jsx(je,{colSpan:3,children:g}):f.map((o,T)=>{const m=o.is_other,y=!m&&o.key!==null,h=n>0?o.cost/n:0;return e.jsxs(be,{onClick:y?()=>c(o.key):void 0,children:[e.jsx(O,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:m?`Other (${o.requests.toLocaleString()} req)`:o.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:z(o.requests)}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:$(o.cost)})]},o.key??`__null_${T}`)})})]}),!d&&N>0?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!0),children:["Show all ",r.length]}):null,!d&&u&&r.length>A?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!1),children:["Show top ",A]}):null]})}const ke=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function _e(a,r){return r==="cost"?a.cost:r==="tokens"?a.tokens:a.requests}function W(a,r){return r==="cost"?$(a):r==="tokens"?S(a):z(a)}function ye(a,r){const n=new Date(a);return Number.isNaN(n.getTime())?a:r==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Se(a,r,n){const g=a.map(d=>({label:ye(d.bucket_start,n),value:_e(d,r)})),c=g.length?Math.max(...g.map(d=>d.value)):0;return{points:g,peak:c,count:a.length}}function De(){var V,Z,Y;const a=ie(),r=ce(),[n,g]=x.useState(U),[c,d]=x.useState(()=>U.seconds===null?void 0:B(U.seconds)),[u,_]=x.useState(""),[f,N]=x.useState(""),[o,T]=x.useState("cost"),m=x.useMemo(()=>({start_date:c,model:u.trim()||void 0,user_id:f||void 0}),[c,u,f]),y=x.useMemo(()=>n.seconds===null||!c?null:{...m,start_date:new Date(new Date(c).getTime()-n.seconds*1e3).toISOString(),end_date:c},[m,n.seconds,c]),h=D(m,n.bucket),X=D(y??m,n.bucket,y!==null),i=h.data,t=i==null?void 0:i.totals,l=y!==null?(V=X.data)==null?void 0:V.totals:void 0,ee=x.useMemo(()=>({...m,model:void 0}),[m]),q=((Y=(Z=D(ee,n.bucket).data)==null?void 0:Z.by_model)==null?void 0:Y.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],se=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),te=(u&&!q.includes(u)?[u,...q]:q).map(s=>({value:s,label:s})),w=!!(u.trim()||f||n.seconds!==null),ae=!!(i&&t&&t.request_count===0&&!w),H=s=>{g(s),d(s.seconds===null?void 0:B(s.seconds))},ne=()=>{H(L[L.length-1]),_(""),N("")},re=()=>{n.seconds!==null&&d(B(n.seconds)),h.refetch()},I=s=>{const P=new URLSearchParams;c&&P.set("start_date",c);for(const[oe,G]of Object.entries(s))G&&P.set(oe,G);a(`/activity?${P.toString()}`)},le=t&&t.request_count>0?t.error_count/t.request_count:0,b=(i==null?void 0:i.series)??[],C=b.length>1,F=Se(b,o,n.bucket);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(de,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(k,{variant:"outline",onPress:re,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ue,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(s=>e.jsx(k,{size:"sm",variant:n.label===s.label?"primary":"outline",onPress:()=>H(s),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(J,{label:"User",value:f,onChange:N,options:se,placeholder:"All users"}),e.jsx(J,{label:"Model",value:u,onChange:_,options:te,placeholder:"All models"}),w?e.jsx(k,{size:"sm",variant:"ghost",onPress:ne,children:"Clear filters"}):null]})]}),ae?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(j,{label:"Spend",value:t?$(t.cost):"—",hint:t?e.jsx(v,{fraction:p(t.cost,l==null?void 0:l.cost)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(j,{label:"Requests",value:t?z(t.request_count):"—",hint:t?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[he(le)," errors",l?e.jsxs(e.Fragment,{children:[" · ",e.jsx(v,{fraction:p(t.request_count,l.request_count)})]}):null]}):null,chart:C?e.jsx(E,{values:b.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(j,{label:"Tokens",value:t?S(t.total_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.total_tokens,l==null?void 0:l.total_tokens)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(j,{label:"Cache read",value:t?S(t.cache_read_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_read_tokens,l==null?void 0:l.cache_read_tokens)}):null}),e.jsx(j,{label:"Cache write",value:t?S(t.cache_write_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_tokens,l==null?void 0:l.cache_write_tokens)}):null}),e.jsx(j,{label:"1h cache write",value:t?S(t.cache_write_1h_tokens??0):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_1h_tokens??0,(l==null?void 0:l.cache_write_1h_tokens)??0)}):null}),e.jsx(j,{label:"Avg latency",value:t?ve(t.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Q,{title:"Spend by model",rows:(i==null?void 0:i.by_model)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({model:s}),loading:h.isLoading}),e.jsx(Q,{title:"Spend by user",rows:(i==null?void 0:i.by_user)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({user_id:s}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[ke.map(s=>e.jsx(k,{size:"sm",variant:o===s.key?"primary":"outline",onPress:()=>T(s.key),children:s.label},s.key)),h.isFetching?e.jsx(K,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(K,{size:"sm"})}):b.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(me,{data:F.points,formatValue:s=>W(s,o),ariaLabel:`${o} per ${n.bucket}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[W(F.peak,o)," peak · ",F.count," ",n.bucket==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{De as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js b/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js deleted file mode 100644 index 754fe4e7..00000000 --- a/src/gateway/static/dashboard/assets/UsagePage-DU8IagMv.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{g as re,r as f}from"./react-q-ooZ0ti.js";import{u as oe,c as F,P as ie,E as ce,d as Q,S as p,N as _,L as k,M as U,Q as de,O as N}from"./index-D1FfVwkg.js";import{T as ue,a as he,b as M,L as me,c as xe,d as ge,e as P}from"./Table-DEsIhjZo.js";import{B as y,S as V}from"./heroui-CewI8xK4.js";function O(a){return a.toLocaleString()}function fe(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const je=3600,$=86400,L=[{label:"Last hour",seconds:je,bucket:"hour"},{label:"24h",seconds:$,bucket:"hour"},{label:"7d",seconds:7*$,bucket:"day"},{label:"30d",seconds:30*$,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],A=L[3],D=15;function E(a){return new Date(Date.now()-a*1e3).toISOString()}function W({title:a,rows:l,totalCost:n,emptyLabel:S,onDrill:x,loading:b}){const[d,m]=f.useState(!1),u=d?l:l.slice(0,D),v=l.length-u.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:b?e.jsx(me,{colSpan:3}):l.length===0?e.jsx(xe,{colSpan:3,children:S}):u.map((i,c)=>{const g=i.is_other,j=!g&&i.key!==null,h=n>0?i.cost/n:0;return e.jsxs(ge,{onClick:j?()=>x(i.key):void 0,children:[e.jsx(P,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:g?`Other (${i.requests.toLocaleString()} req)`:i.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:O(i.requests)}),e.jsx(P,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:U(i.cost)})]},i.key??`__null_${c}`)})})]}),!b&&v>0?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!0),children:["Show all ",l.length]}):null,!b&&d&&l.length>D?e.jsxs(y,{size:"sm",variant:"ghost",onPress:()=>m(!1),children:["Show top ",D]}):null]})}const be=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function Y(a,l){return l==="cost"?a.cost:l==="tokens"?a.tokens:a.requests}function G(a,l){return l==="cost"?U(a):l==="tokens"?N(a):O(a)}function J(a,l){const n=new Date(a);return Number.isNaN(n.getTime())?a:l==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ve({series:a,metric:l,bucket:n}){const d=Math.max(1,...a.map(c=>Y(c,l))),m=a.length,u=m>0?704/m:0,v=Math.max(1,u*.7),i=m<=1?[0]:[...new Set([0,Math.floor(m/2),m-1])];return e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsxs("svg",{viewBox:"0 0 720 224",preserveAspectRatio:"none",role:"img",className:"w-full","aria-label":`${l} over time`,children:[e.jsx("title",{children:`${l} per ${n}`}),a.map((c,g)=>{const j=Y(c,l),h=j/d*192,q=8+g*u+(u-v)/2,r=200-h;return e.jsx("rect",{x:q,y:r,width:v,height:h,rx:1.5,className:"fill-[var(--otari-brand)]",children:e.jsx("title",{children:`${J(c.bucket_start,n)}: ${G(j,l)}`})},c.bucket_start)}),i.map(c=>a[c]?e.jsx("text",{x:8+c*u+u/2,y:216,textAnchor:"middle",className:"fill-[var(--otari-muted)] text-[10px]",children:J(a[c].bucket_start,n)},`lbl_${c}`):null)]}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[G(d,l)," peak · ",m," ",n==="hour"?"hours":"days"," (times in UTC)"]})]})}function we(){var z,I,H;const a=re(),l=oe(),[n,S]=f.useState(A),[x,b]=f.useState(()=>A.seconds===null?void 0:E(A.seconds)),[d,m]=f.useState(""),[u,v]=f.useState(""),[i,c]=f.useState("cost"),g=f.useMemo(()=>({start_date:x,model:d.trim()||void 0,user_id:u||void 0}),[x,d,u]),j=f.useMemo(()=>n.seconds===null||!x?null:{...g,start_date:new Date(new Date(x).getTime()-n.seconds*1e3).toISOString(),end_date:x},[g,n.seconds,x]),h=F(g,n.bucket),q=F(j??g,n.bucket,j!==null),r=h.data,s=r==null?void 0:r.totals,o=j!==null?(z=q.data)==null?void 0:z.totals:void 0,K=f.useMemo(()=>({...g,model:void 0}),[g]),C=((H=(I=F(K,n.bucket).data)==null?void 0:I.by_model)==null?void 0:H.filter(t=>!t.is_other&&t.key!==null).map(t=>t.key))??[],X=(l.data??[]).map(t=>({value:t.user_id,label:t.alias?`${t.alias} (${t.user_id})`:t.user_id})),ee=(d&&!C.includes(d)?[d,...C]:C).map(t=>({value:t,label:t})),w=!!(d.trim()||u||n.seconds!==null),se=!!(r&&s&&s.request_count===0&&!w),R=t=>{S(t),b(t.seconds===null?void 0:E(t.seconds))},te=()=>{R(L[L.length-1]),m(""),v("")},ae=()=>{n.seconds!==null&&b(E(n.seconds)),h.refetch()},B=t=>{const T=new URLSearchParams;x&&T.set("start_date",x);for(const[ne,Z]of Object.entries(t))Z&&T.set(ne,Z);a(`/activity?${T.toString()}`)},le=s&&s.request_count>0?s.error_count/s.request_count:0;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ie,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(y,{variant:"outline",onPress:ae,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ce,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(t=>e.jsx(y,{size:"sm",variant:n.label===t.label?"primary":"outline",onPress:()=>R(t),children:t.label},t.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(Q,{label:"User",value:u,onChange:v,options:X,placeholder:"All users"}),e.jsx(Q,{label:"Model",value:d,onChange:m,options:ee,placeholder:"All models"}),w?e.jsx(y,{size:"sm",variant:"ghost",onPress:te,children:"Clear filters"}):null]})]}),se?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(p,{label:"Spend",value:s?U(s.cost):"—",hint:s?e.jsx(_,{fraction:k(s.cost,o==null?void 0:o.cost)}):null}),e.jsx(p,{label:"Requests",value:s?O(s.request_count):"—",hint:s?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[de(le)," errors",o?e.jsxs(e.Fragment,{children:[" · ",e.jsx(_,{fraction:k(s.request_count,o.request_count)})]}):null]}):null}),e.jsx(p,{label:"Tokens",value:s?N(s.total_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.total_tokens,o==null?void 0:o.total_tokens)}):null}),e.jsx(p,{label:"Cache read",value:s?N(s.cache_read_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_read_tokens,o==null?void 0:o.cache_read_tokens)}):null}),e.jsx(p,{label:"Cache write",value:s?N(s.cache_write_tokens):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_tokens,o==null?void 0:o.cache_write_tokens)}):null}),e.jsx(p,{label:"1h cache write",value:s?N(s.cache_write_1h_tokens??0):"—",hint:s?e.jsx(_,{fraction:k(s.cache_write_1h_tokens??0,(o==null?void 0:o.cache_write_1h_tokens)??0)}):null}),e.jsx(p,{label:"Avg latency",value:s?fe(s.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(W,{title:"Spend by model",rows:(r==null?void 0:r.by_model)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({model:t}),loading:h.isLoading}),e.jsx(W,{title:"Spend by user",rows:(r==null?void 0:r.by_user)??[],totalCost:(s==null?void 0:s.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:t=>B({user_id:t}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[be.map(t=>e.jsx(y,{size:"sm",variant:i===t.key?"primary":"outline",onPress:()=>c(t.key),children:t.label},t.key)),h.isFetching?e.jsx(V,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(V,{size:"sm"})}):((r==null?void 0:r.series.length)??0)===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsx(ve,{series:(r==null?void 0:r.series)??[],metric:i,bucket:n.bucket})]})]})]})}export{we as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-DtQni_qk.js b/src/gateway/static/dashboard/assets/UsagePage-DtQni_qk.js deleted file mode 100644 index 91abbab9..00000000 --- a/src/gateway/static/dashboard/assets/UsagePage-DtQni_qk.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as ie,r as x}from"./react-dgEcD0HR.js";import{u as ce,c as D,P as de,E as ue,d as J,S as j,N as v,L as p,M as $,O as he,a9 as S}from"./index-Dp4DdBFR.js";import{S as E,B as me}from"./charts-Cr3Dij9t.js";import{T as xe,a as ge,b as M,L as fe,c as je,d as be,e as O}from"./Table-CLdjdyTx.js";import{B as k,S as K}from"./heroui-BX6JwHY-.js";import"./recharts-CR3TAEof.js";function z(a){return a.toLocaleString()}function ve(a){return a===null?"—":a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`}const pe=3600,R=86400,L=[{label:"Last hour",seconds:pe,bucket:"hour"},{label:"24h",seconds:R,bucket:"hour"},{label:"7d",seconds:7*R,bucket:"day"},{label:"30d",seconds:30*R,bucket:"day"},{label:"All",seconds:null,bucket:"day"}],U=L[3],A=15;function B(a){return new Date(Date.now()-a*1e3).toISOString()}function Q({title:a,rows:r,totalCost:n,emptyLabel:g,onDrill:c,loading:d}){const[u,_]=x.useState(!1),f=u?r:r.slice(0,A),N=r.length-f.length;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:a}),e.jsxs(xe,{children:[e.jsx(ge,{children:e.jsxs("tr",{children:[e.jsx(M,{children:a.replace("Spend by ","")}),e.jsx(M,{className:"text-right",children:"Requests"}),e.jsx(M,{className:"text-right",children:"Spend"})]})}),e.jsx("tbody",{children:d?e.jsx(fe,{colSpan:3}):r.length===0?e.jsx(je,{colSpan:3,children:g}):f.map((o,T)=>{const m=o.is_other,y=!m&&o.key!==null,h=n>0?o.cost/n:0;return e.jsxs(be,{onClick:y?()=>c(o.key):void 0,children:[e.jsx(O,{className:"text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate",children:m?`Other (${o.requests.toLocaleString()} req)`:o.key??"(unknown)"}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,h*100)}%`}})})]})}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-muted)]",children:z(o.requests)}),e.jsx(O,{className:"text-right tabular-nums text-[var(--otari-ink)]",children:$(o.cost)})]},o.key??`__null_${T}`)})})]}),!d&&N>0?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!0),children:["Show all ",r.length]}):null,!d&&u&&r.length>A?e.jsxs(k,{size:"sm",variant:"ghost",onPress:()=>_(!1),children:["Show top ",A]}):null]})}const ke=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function _e(a,r){return r==="cost"?a.cost:r==="tokens"?a.tokens:a.requests}function W(a,r){return r==="cost"?$(a):r==="tokens"?S(a):z(a)}function ye(a,r){const n=new Date(a);return Number.isNaN(n.getTime())?a:r==="hour"?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Se(a,r,n){const g=a.map(d=>({label:ye(d.bucket_start,n),value:_e(d,r)})),c=g.length?Math.max(...g.map(d=>d.value)):0;return{points:g,peak:c,count:a.length}}function De(){var V,Z,Y;const a=ie(),r=ce(),[n,g]=x.useState(U),[c,d]=x.useState(()=>U.seconds===null?void 0:B(U.seconds)),[u,_]=x.useState(""),[f,N]=x.useState(""),[o,T]=x.useState("cost"),m=x.useMemo(()=>({start_date:c,model:u.trim()||void 0,user_id:f||void 0}),[c,u,f]),y=x.useMemo(()=>n.seconds===null||!c?null:{...m,start_date:new Date(new Date(c).getTime()-n.seconds*1e3).toISOString(),end_date:c},[m,n.seconds,c]),h=D(m,n.bucket),X=D(y??m,n.bucket,y!==null),i=h.data,t=i==null?void 0:i.totals,l=y!==null?(V=X.data)==null?void 0:V.totals:void 0,ee=x.useMemo(()=>({...m,model:void 0}),[m]),q=((Y=(Z=D(ee,n.bucket).data)==null?void 0:Z.by_model)==null?void 0:Y.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],se=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),te=(u&&!q.includes(u)?[u,...q]:q).map(s=>({value:s,label:s})),w=!!(u.trim()||f||n.seconds!==null),ae=!!(i&&t&&t.request_count===0&&!w),H=s=>{g(s),d(s.seconds===null?void 0:B(s.seconds))},ne=()=>{H(L[L.length-1]),_(""),N("")},re=()=>{n.seconds!==null&&d(B(n.seconds)),h.refetch()},I=s=>{const P=new URLSearchParams;c&&P.set("start_date",c);for(const[oe,G]of Object.entries(s))G&&P.set(oe,G);a(`/activity?${P.toString()}`)},le=t&&t.request_count>0?t.error_count/t.request_count:0,b=(i==null?void 0:i.series)??[],C=b.length>1,F=Se(b,o,n.bucket);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(de,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log.",action:e.jsx(k,{variant:"outline",onPress:re,isDisabled:h.isFetching,children:"Refresh"})}),e.jsx(ue,{error:h.error}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:L.map(s=>e.jsx(k,{size:"sm",variant:n.label===s.label?"primary":"outline",onPress:()=>H(s),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsx(J,{label:"User",value:f,onChange:N,options:se,placeholder:"All users"}),e.jsx(J,{label:"Model",value:u,onChange:_,options:te,placeholder:"All models"}),w?e.jsx(k,{size:"sm",variant:"ghost",onPress:ne,children:"Clear filters"}):null]})]}),ae?e.jsx("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-10 text-center text-sm text-[var(--otari-muted)]",children:"No usage yet. Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(j,{label:"Spend",value:t?$(t.cost):"—",hint:t?e.jsx(v,{fraction:p(t.cost,l==null?void 0:l.cost)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(j,{label:"Requests",value:t?z(t.request_count):"—",hint:t?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[he(le)," errors",l?e.jsxs(e.Fragment,{children:[" · ",e.jsx(v,{fraction:p(t.request_count,l.request_count)})]}):null]}):null,chart:C?e.jsx(E,{values:b.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(j,{label:"Tokens",value:t?S(t.total_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.total_tokens,l==null?void 0:l.total_tokens)}):null,chart:C?e.jsx(E,{values:b.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(j,{label:"Cache read",value:t?S(t.cache_read_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_read_tokens,l==null?void 0:l.cache_read_tokens)}):null}),e.jsx(j,{label:"Cache write",value:t?S(t.cache_write_tokens):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_tokens,l==null?void 0:l.cache_write_tokens)}):null}),e.jsx(j,{label:"1h cache write",value:t?S(t.cache_write_1h_tokens??0):"—",hint:t?e.jsx(v,{fraction:p(t.cache_write_1h_tokens??0,(l==null?void 0:l.cache_write_1h_tokens)??0)}):null}),e.jsx(j,{label:"Avg latency",value:t?ve(t.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Q,{title:"Spend by model",rows:(i==null?void 0:i.by_model)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({model:s}),loading:h.isLoading}),e.jsx(Q,{title:"Spend by user",rows:(i==null?void 0:i.by_user)??[],totalCost:(t==null?void 0:t.cost)??0,emptyLabel:w?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>I({user_id:s}),loading:h.isLoading})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[ke.map(s=>e.jsx(k,{size:"sm",variant:o===s.key?"primary":"outline",onPress:()=>T(s.key),children:s.label},s.key)),h.isFetching?e.jsx(K,{size:"sm"}):null]})]}),h.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(K,{size:"sm"})}):b.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(me,{data:F.points,formatValue:s=>W(s,o),ariaLabel:`${o} per ${n.bucket}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[W(F.peak,o)," peak · ",F.count," ",n.bucket==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{De as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js b/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js deleted file mode 100644 index b8df9698..00000000 --- a/src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js +++ /dev/null @@ -1,13 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BDaNeswz.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,aa as V,P as L,E as A,ab as O}from"./index-Dp4DdBFR.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-D_p9BPKF.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======= -<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-D6YDX-oj.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-CxWug9wa.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js ->>>>>>> 9a3b5eff (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js b/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js deleted file mode 100644 index 324e97d3..00000000 --- a/src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js b/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js deleted file mode 100644 index a6d17b11..00000000 --- a/src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js +++ /dev/null @@ -1,9 +0,0 @@ -<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-CNthhRRV.js -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-D6YDX-oj.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-CxWug9wa.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======= -<<<<<<<< HEAD:src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-CSyrpBqZ.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-CNKA1fyP.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; -======== -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; ->>>>>>>> 6f082413 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js ->>>>>>> cec52508 (fix(dashboard): persist sign-in with an HttpOnly session cookie):src/gateway/static/dashboard/assets/UsersPage-BxkuFQkF.js diff --git a/src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js b/src/gateway/static/dashboard/assets/UsersPage-ETfq5MXh.js similarity index 94% rename from src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js rename to src/gateway/static/dashboard/assets/UsersPage-ETfq5MXh.js index 4899ed28..47046858 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-DjQ_32XA.js +++ b/src/gateway/static/dashboard/assets/UsersPage-ETfq5MXh.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-W9y7rsMr.js";import{r as n}from"./react-q-ooZ0ti.js";import{u as E,j as w,n as I,a8 as V,P as L,E as A,a9 as O}from"./index-D1FfVwkg.js";import{F as N}from"./Field-gj3-ox4q.js";import{M as B,a as R}from"./ModelScopeControl-Bpbo36Ko.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-DEsIhjZo.js";import{B as o,f as P,c as v}from"./heroui-CewI8xK4.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{u as E,j as w,n as I,a9 as V,P as L,E as A,aa as O}from"./index-hDVMDLdX.js";import{F as N}from"./Field-HzRk1KDP.js";import{M as B,a as R}from"./ModelScopeControl-DX341Q9L.js";import{T as H,a as $,b as f,L as q,c as W,d as G,e as b}from"./Table-CLdjdyTx.js";import{B as o,f as P,d as v}from"./heroui-BX6JwHY-.js";const J=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function S(t){return J.format(t)}const _=t=>t.startsWith("apikey-");function D(t){return t.split("-")[0]}function M(t){return t.name??D(t.budget_id)}function T({value:t,onChange:i,budgets:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>i(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),r.map(a=>e.jsxs("option",{value:a.budget_id,children:[M(a),a.max_budget===null?" · no limit":` · ${S(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function K({onClose:t}){const i=O(),r=w(),[a,l]=n.useState(""),[d,c]=n.useState(""),[u,j]=n.useState(null),[y,x]=n.useState(null),[g,p]=n.useState(!0),m=()=>{if(i.isPending||!g||a.trim()==="")return;const h={user_id:a.trim(),alias:d.trim()||null,budget_id:u,allowed_models:y};i.mutate(h,{onSuccess:t})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:i.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(N,{label:"User ID",value:a,onChange:l,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(N,{label:"Alias (optional)",value:d,onChange:c,placeholder:"Alice"})]}),e.jsx(T,{value:u,onChange:j,budgets:r.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{x(h),p(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:i.isPending||!g||a.trim()==="",onPress:m,children:i.isPending?"Creating…":"Create user"}),e.jsx(o,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function Q({user:t,onClose:i}){const r=I(),a=w(),[l,d]=n.useState(t.alias??""),[c,u]=n.useState(t.budget_id),[j,y]=n.useState(t.allowed_models),[x,g]=n.useState(!0),p=()=>{if(r.isPending||!x)return;const m={alias:l.trim()||null,budget_id:c,allowed_models:j};r.mutate({id:t.user_id,body:m},{onSuccess:i})};return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:r.error}),e.jsx(N,{label:"Alias",value:l,onChange:d,placeholder:"Alice"}),e.jsx(T,{value:c,onChange:u,budgets:a.data??[]}),e.jsx(B,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(m,h)=>{y(m),g(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"primary",isDisabled:r.isPending||!x,onPress:p,children:r.isPending?"Saving…":"Save changes"}),e.jsx(o,{variant:"ghost",onPress:i,children:"Cancel"})]})]})})}function X({trigger:t,message:i,confirmLabel:r,isPending:a,onConfirm:l}){const[d,c]=n.useState(!1);return d?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:i}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(o,{size:"sm",variant:"danger",isDisabled:a,onPress:l,children:r}),e.jsx(o,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>c(!1),children:"Cancel"})]})]}):e.jsx(o,{size:"sm",variant:"danger-soft",onPress:()=>c(!0),children:t})}function Y({user:t}){return t.blocked?e.jsx(P,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"})}function Z({allowed:t}){const{text:i,tone:r}=R(t),a=r==="danger"?"text-red-700 font-medium":r==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",l=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:l,children:i})}function ee({onCreate:t}){return e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"No users yet"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page."})]}),e.jsx("div",{children:e.jsx(o,{variant:"primary",onPress:t,children:"Create your first user"})})]})})}function de(){const t=E(),i=w(),r=I(),a=V(),[l,d]=n.useState(!1),[c,u]=n.useState(null),[j,y]=n.useState(!1),x=t.data??[],g=t.isLoading,p=x.filter(s=>_(s.user_id)).length,m=j?x:x.filter(s=>!_(s.user_id)),h=x.find(s=>s.user_id===c)??null,C=!g&&m.length===0&&!l,z=new Map((i.data??[]).map(s=>[s.budget_id,s])),U=(s,k)=>r.mutate({id:s.user_id,body:{blocked:k}});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:l?null:e.jsx(o,{variant:"primary",onPress:()=>{u(null),d(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??r.error??a.error}),C?e.jsx(ee,{onCreate:()=>{u(null),d(!0)}}):null,p>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:s=>y(s.target.checked)}),"Show auto-created (virtual) users (",p,")"]}):null,l?e.jsx(K,{onClose:()=>d(!1)}):null,h?e.jsx(Q,{user:h,onClose:()=>u(null)},h.user_id):null,e.jsxs(H,{children:[e.jsx($,{children:e.jsxs("tr",{children:[e.jsx(f,{children:"User"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Budget"}),e.jsx(f,{children:"Spend"}),e.jsx(f,{children:"Model access"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx(q,{colSpan:6}):m.length===0?e.jsx(W,{colSpan:6,children:"No users yet. Create one, or create an API key to auto-create one."}):m.map(s=>{const k=s.budget_id?z.get(s.budget_id):void 0;return e.jsxs(G,{selected:c===s.user_id,onClick:()=>{d(!1),u(s.user_id)},children:[e.jsx(b,{className:"font-medium text-[var(--otari-ink)]",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs",children:s.user_id}),_(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})}),e.jsx(b,{children:e.jsx(Y,{user:s})}),e.jsx(b,{className:"text-[var(--otari-muted)]",children:s.budget_id?e.jsx("span",{title:s.budget_id,children:k?M(k):D(s.budget_id)}):"—"}),e.jsxs(b,{className:"text-[var(--otari-muted)]",children:[S(s.spend),s.reserved>0?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[" (+",S(s.reserved)," held)"]}):null]}),e.jsx(b,{children:e.jsx(Z,{allowed:s.allowed_models})}),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",onClick:F=>F.stopPropagation(),children:[s.blocked?e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!1),children:"Unblock"}):e.jsx(o,{size:"sm",variant:"outline",isDisabled:r.isPending,onPress:()=>U(s,!0),children:"Block"}),e.jsx(o,{size:"sm",variant:"ghost",onPress:()=>{d(!1),u(s.user_id)},children:"Edit"}),e.jsx(X,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})})]},s.user_id)})})]})]})}export{de as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js b/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js deleted file mode 100644 index a4fb0b56..00000000 --- a/src/gateway/static/dashboard/assets/heroui-CewI8xK4.js +++ /dev/null @@ -1,20 +0,0 @@ -var ho=t=>{throw TypeError(t)};var mo=(t,e,n)=>e.has(t)||ho("Cannot "+n);var go=(t,e,n)=>(mo(t,e,"read from private field"),n?n.call(t):e.get(t)),$o=(t,e,n)=>e.has(t)?ho("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Nn=(t,e,n,r)=>(mo(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{r as a,$ as y,a as Lr,b as Tu,c as ku}from"./react-q-ooZ0ti.js";import{j as A}from"./tanstack-query-W9y7rsMr.js";const Du="react-aria-clear-focus",Mu="react-aria-focus";function xn(t){var n;if(typeof window>"u"||window.navigator==null)return!1;let e=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(e)&&e.some(r=>t.test(r.brand))||t.test(window.navigator.userAgent)}function Kr(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)==null?void 0:e.platform)||window.navigator.platform):!1}function je(t){let e=null;return()=>(e==null&&(e=t()),e)}const Xe=je(function(){return Kr(/^Mac/i)}),Au=je(function(){return Kr(/^iPhone/i)}),Vl=je(function(){return Kr(/^iPad/i)||Xe()&&navigator.maxTouchPoints>1}),Ze=je(function(){return Au()||Vl()}),ln=je(function(){return Xe()||Ze()}),_l=je(function(){return xn(/AppleWebKit/i)&&!jl()}),jl=je(function(){return xn(/Chrome/i)}),Rr=je(function(){return xn(/Android/i)}),Lu=je(function(){return xn(/Firefox/i)});function Ke(t){if(Ku())t.focus({preventScroll:!0});else{let e=Ru(t);t.focus(),Fu(e)}}let Xt=null;function Ku(){if(Xt==null){Xt=!1;try{document.createElement("div").focus({get preventScroll(){return Xt=!0,!0}})}catch{}}return Xt}function Ru(t){let e=t.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeightt});function zt(){return a.useContext(Iu)}function Bu(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function _e(t,e,n=!0){var u,c;let{metaKey:r,ctrlKey:o,altKey:l,shiftKey:i}=e;Lu()&&((c=(u=window.event)==null?void 0:u.type)!=null&&c.startsWith("key"))&&t.target==="_blank"&&(Xe()?r=!0:o=!0);let s=_l()&&Xe()&&!Vl()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:l,shiftKey:i}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:l,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});_e.isOpening=n,Ke(t),t.dispatchEvent(s),_e.isOpening=!1}_e.isOpening=!1;function Nu(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function Ou(t,e){Nu(t,n=>_e(n,e))}function zl(t){const n=zt().useHref((t==null?void 0:t.href)??"");let r={};if(t)for(let o of["href","target","rel","download","ping","referrerPolicy"])o in t&&(r[o]=o==="href"?n:t[o]);return r}function Vu(t,e,n,r){!e.isNative&&t.currentTarget instanceof HTMLAnchorElement&&t.currentTarget.href&&!t.isDefaultPrevented()&&Bu(t.currentTarget,t)&&n&&(t.preventDefault(),e.open(t.currentTarget,t,n,r))}const ne=typeof document<"u"?y.useLayoutEffect:()=>{},Hl={prefix:String(Math.round(Math.random()*1e10)),current:0},Wl=y.createContext(Hl),_u=y.createContext(!1);let On=new WeakMap;function ju(t=!1){var r,o;let e=a.useContext(Wl),n=a.useRef(null);if(n.current===null&&!t){let l=(o=(r=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:r.ReactCurrentOwner)==null?void 0:o.current;if(l){let i=On.get(l);i==null?On.set(l,{id:e.current,state:l.memoizedState}):l.memoizedState!==i.state&&(e.current=i.id,On.delete(l))}n.current=++e.current}return n.current}function zu(t){let e=a.useContext(Wl),n=ju(!!t),r=`react-aria${e.prefix}`;return t||`${r}-${n}`}function Hu(t){let e=y.useId(),[n]=a.useState(et()),r=n?"react-aria":`react-aria${Hl.prefix}`;return t||`${r}-${e}`}const Wu=typeof y.useId=="function"?Hu:zu;function Gu(){return!1}function Uu(){return!0}function qu(t){return()=>{}}function et(){return typeof y.useSyncExternalStore=="function"?y.useSyncExternalStore(qu,Gu,Uu):a.useContext(_u)}function Yu(t){let[e,n]=a.useState(t),r=a.useRef(e),o=a.useRef(null),l=a.useRef(()=>{if(!o.current)return;let s=o.current.next();if(s.done){o.current=null;return}r.current===s.value?l.current():n(s.value)});ne(()=>{r.current=e,o.current&&l.current()});let i=a.useCallback(s=>{o.current=s(r.current),l.current()},[l]);return[e,i]}let Xu=!!(typeof window<"u"&&window.document&&window.document.createElement),dt=new Map,Pt;typeof FinalizationRegistry<"u"&&(Pt=new FinalizationRegistry(t=>{dt.delete(t)}));function ve(t){let[e,n]=a.useState(t),r=a.useRef(null),o=Wu(e),l=a.useRef(null);if(Pt&&Pt.register(l,o),Xu){const i=dt.get(o);i&&!i.includes(r)?i.push(r):dt.set(o,[r])}return ne(()=>{let i=o;return()=>{Pt&&Pt.unregister(l),dt.delete(i)}},[o]),a.useEffect(()=>{let i=r.current;return i&&n(i),()=>{i&&(r.current=null)}}),o}function Zu(t,e){if(t===e)return t;let n=dt.get(t);if(n)return n.forEach(o=>o.current=e),e;let r=dt.get(e);return r?(r.forEach(o=>o.current=t),t):e}function Ft(t=[]){let e=ve(),[n,r]=Yu(e),o=a.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return ne(o,[e,o,...t]),n}function tt(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const ee=t=>(t==null?void 0:t.ownerDocument)??document,xe=t=>t&&"window"in t&&t.window===t?t:ee(t).defaultView||window;function Ju(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function Qu(t){return Ju(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let ec=!1;function Ne(){return ec}function te(t,e){if(!Ne())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Qu(n)?n=n.host:n=n.parentNode}return!1}const re=(t=document)=>{var n;if(!Ne())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&((n=e.shadowRoot)!=null&&n.activeElement);)e=e.shadowRoot.activeElement;return e};function j(t){if(Ne()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function It(t){if(!t)return!1;let e=t.getRootNode(),n=xe(t);if(!(e instanceof n.Document||e instanceof n.ShadowRoot))return!1;let r=e.activeElement;return r!=null&&t.contains(r)}class tc{constructor(e,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var s;if(i.nodeType===Node.ELEMENT_NODE){const u=i.shadowRoot;if(u){const c=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((s=this.filter)!=null&&s.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,r,this._acceptNode));const l=n.shadowRoot;if(l){const i=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(e){if(!te(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=e,o=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=r,s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=o,this._currentSetFor.add(s),r=o=i.host}else r=r.parentNode;const l=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=o,this._currentSetFor.add(l),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return te(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){var n;const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(e):(n=this.filter)!=null&&n.acceptNode&&(o=this.filter.acceptNode(e)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let l=this.nextNode();return l&&(this.currentNode=l),l}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){let l;if(typeof this.filter=="function"?l=this.filter(n):(r=this.filter)!=null&&r.acceptNode&&(l=this.filter.acceptNode(n)),l===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let i=this.lastChild();return i&&(this.currentNode=i),i}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function Gl(t,e,n,r){return Ne()?new tc(t,e,n,r):t.createTreeWalker(e,n,r)}function ht(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const r=t.map(o=>{const l=yo(o,e);return n||(n=typeof l=="function"),l});if(n)return()=>{r.forEach((o,l)=>{typeof o=="function"?o():yo(t[l],null)})}}}function yo(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ul(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e=65&&o.charCodeAt(2)<=90?e[o]=tt(l,i):(o==="className"||o==="UNSAFE_className")&&typeof l=="string"&&typeof i=="string"?e[o]=nc(l,i):o==="id"&&l&&i?e.id=Zu(l,i):o==="ref"&&l&&i?e.ref=ht(l,i):e[o]=i!==void 0?i:l}}return e}const rc=new Set(["id"]),oc=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),lc=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),ic=new Set(["dir","lang","hidden","inert","translate"]),vo=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),sc=/^(data-.*)$/;function pe(t,e={}){let{labelable:n,isLink:r,global:o,events:l=o,propNames:i}=e,s={};for(const u in t)Object.prototype.hasOwnProperty.call(t,u)&&(rc.has(u)||n&&oc.has(u)||r&&lc.has(u)||o&&ic.has(u)||l&&(vo.has(u)||u.endsWith("Capture")&&vo.has(u.slice(0,-7)))||i!=null&&i.has(u)||sc.test(u))&&(s[u]=t[u]);return s}let He=new Map,rr=new Set;function xo(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{let o=j(r);if(!t(r)||!o)return;let l=He.get(o);l||(l=new Set,He.set(o,l),o.addEventListener("transitioncancel",n,{once:!0})),l.add(r.propertyName)},n=r=>{let o=j(r);if(!t(r)||!o)return;let l=He.get(o);if(l&&(l.delete(r.propertyName),l.size===0&&(o.removeEventListener("transitioncancel",n),He.delete(o)),He.size===0)){for(let i of rr)i();rr.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?xo():document.addEventListener("DOMContentLoaded",xo));function ac(){for(const[t]of He)"isConnected"in t&&!t.isConnected&&He.delete(t)}function ql(t){requestAnimationFrame(()=>{ac(),He.size===0?t():rr.add(t)})}function Cn(){let t=a.useRef(new Map),e=a.useCallback((o,l,i,s)=>{let u=s!=null&&s.once?(...c)=>{t.current.delete(i),i(...c)}:i;t.current.set(i,{type:l,eventTarget:o,fn:u,options:s}),o.addEventListener(l,u,s)},[]),n=a.useCallback((o,l,i,s)=>{var c;let u=((c=t.current.get(i))==null?void 0:c.fn)||i;o.removeEventListener(l,u,s),t.current.delete(i)},[]),r=a.useCallback(()=>{t.current.forEach((o,l)=>{n(o.eventTarget,o.type,l,o.options)})},[n]);return a.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function dn(t,e){let{id:n,"aria-label":r,"aria-labelledby":o}=t;return n=ve(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&e&&(r=e),{id:n,"aria-label":r,"aria-labelledby":o}}function nt(t){const e=a.useRef(null),n=a.useRef(void 0),r=a.useCallback(o=>{if(typeof t=="function"){const l=t,i=l(o);return()=>{typeof i=="function"?i():l(null)}}else if(t)return t.current=o,()=>{t.current=null}},[t]);return a.useMemo(()=>({get current(){return e.current},set current(o){e.current=o,n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=r(o))}}),[r])}const uc=y.useInsertionEffect??ne;function Pe(t){const e=a.useRef(null);return uc(()=>{e.current=t},[t]),a.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}function cc(t,e){const n=a.useRef(!0),r=a.useRef(null);let o=Pe(t);a.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),a.useEffect(()=>{let l=r.current;n.current?n.current=!1:(!l||e.some((i,s)=>!Object.is(i,l[s])))&&o(),r.current=e},e)}function Co(t,e){const n=a.useRef(!0),r=a.useRef(null);ne(()=>(n.current=!0,()=>{n.current=!1}),[]),ne(()=>{n.current?n.current=!1:(!r.current||e.some((o,l)=>!Object.is(o,r[l])))&&t(),r.current=e},e)}function dc(){return typeof window.ResizeObserver<"u"}function fn(t){const{ref:e,box:n,onResize:r}=t;let o=Pe(r);a.useEffect(()=>{let l=e==null?void 0:e.current;if(l)if(dc()){const i=new window.ResizeObserver(s=>{s.length&&o()});return i.observe(l,{box:n}),()=>{l&&i.unobserve(l)}}else return window.addEventListener("resize",o,!1),()=>{window.removeEventListener("resize",o,!1)}},[e,n])}function Fr(t,e){ne(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Je(t,e){if(!t)return!1;let n=window.getComputedStyle(t),r=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return t===r&&n.overflow!=="hidden"&&(o=!0),o&&e&&(o=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),o}function Ir(t,e){let n=t;for(Je(n,e)&&(n=n.parentElement);n&&!Je(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Vn(t,e){let n=[],r=document.scrollingElement||document.documentElement;for(;t&&(Je(t,e)&&n.push(t),t!==r);)t=t.parentElement;return n}function ut(t){return Xe()?t.metaKey:t.ctrlKey}const fc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function At(t){return t instanceof HTMLInputElement&&!fc.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}let ye=typeof document<"u"&&window.visualViewport;function pc(){let t=et(),[e,n]=a.useState(()=>t?{width:0,height:0}:_n());return a.useEffect(()=>{let r=s=>{n(u=>s.width===u.width&&s.height===u.height?u:s)},o=()=>{ye&&ye.scale>1||r(_n())},l,i=s=>{ye&&ye.scale>1||At(j(s))&&(l=requestAnimationFrame(()=>{let u=re();(!u||!At(u))&&r({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return r(_n()),Ze()&&window.addEventListener("blur",i,!0),ye?ye.addEventListener("resize",o):window.addEventListener("resize",o),()=>{cancelAnimationFrame(l),Ze()&&window.removeEventListener("blur",i,!0),ye?ye.removeEventListener("resize",o):window.removeEventListener("resize",o)}},[]),e}function _n(){return{width:ye?Math.min(ye.width*ye.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:ye?ye.height*ye.scale:document.documentElement.clientHeight}}let bc=0;const jn=new Map;function hc(t){let[e,n]=a.useState();return ne(()=>{if(!t)return;let r=jn.get(t);if(r)n(r.element.id);else{let o=`react-aria-description-${bc++}`;n(o);let l=document.createElement("div");l.id=o,l.style.display="none",l.textContent=t,document.body.appendChild(l),r={refCount:0,element:l},jn.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),jn.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function Tt(t,e,n,r){let o=Pe(n),l=n==null;a.useEffect(()=>{if(l||!t.current)return;let i=t.current;return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[t,e,r,l])}function sn(t,e,n={}){let{block:r="nearest",inline:o="nearest"}=n;if(t===e)return;let l=t.scrollTop,i=t.scrollLeft,s=e.getBoundingClientRect(),u=t.getBoundingClientRect(),c=window.getComputedStyle(e),d=window.getComputedStyle(t),f=document.scrollingElement||document.documentElement,b=t===f,p=t===f?0:u.top,m=t===f?t.clientHeight:u.bottom,v=t===f?0:u.left,g=t===f?t.clientWidth:u.right,x=parseFloat(c.scrollMarginTop)||0,$=parseFloat(c.scrollMarginBottom)||0,D=parseFloat(c.scrollMarginLeft)||0,P=parseFloat(c.scrollMarginRight)||0,F=parseFloat(d.scrollPaddingTop)||0,R=parseFloat(d.scrollPaddingBottom)||0,I=parseFloat(d.scrollPaddingLeft)||0,k=parseFloat(d.scrollPaddingRight)||0,B=parseFloat(d.borderTopWidth)||0,K=parseFloat(d.borderBottomWidth)||0,_=parseFloat(d.borderLeftWidth)||0,U=parseFloat(d.borderRightWidth)||0,z=s.top-x,h=s.bottom+$,C=s.left-D,M=s.right+P,E=t===f?0:_+U,w=t===f?0:B+K,T=t===f?0:t.offsetWidth-t.clientWidth-E,S=t===f?0:t.offsetHeight-t.clientHeight-w,N=p+(b?0:B)+F,q=m-(b?0:K)-R-S,W=v+(b?0:_)+I,X=g-(b?0:U)-k;d.direction==="rtl"&&!Ze()?W+=T:X-=T;let Q=zq,le=CX;if(Q&&r==="start")l+=z-N;else if(Q&&r==="center")l+=(z+h)/2-(N+q)/2;else if(Q&&r==="end")l+=h-q;else if(Q&&r==="nearest"){let Z=z-N,be=h-q;l+=Math.abs(Z)<=Math.abs(be)?Z:be}if(le&&o==="start")i+=C-W;else if(le&&o==="center")i+=(C+M)/2-(W+X)/2;else if(le&&o==="end")i+=M-X;else if(le&&o==="nearest"){let Z=C-W,be=M-X;i+=Math.abs(Z)<=Math.abs(be)?Z:be}t.scrollTo({left:i,top:l})}function Eo(t,e={}){var r,o,l;let{containingElement:n}=e;if(t&&t.isConnected){let i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let{left:u,top:c}=t.getBoundingClientRect(),d=Vn(t,!0);for(let p of d)sn(p,t);let{left:f,top:b}=t.getBoundingClientRect();if(Math.abs(u-f)>1||Math.abs(c-b)>1){d=n?Vn(n,!0):[];for(let p of d)sn(p,n,{block:"center",inline:"center"});for(let p of Vn(t,!0))sn(p,t)}}else{let{left:u,top:c}=t.getBoundingClientRect();(r=t==null?void 0:t.scrollIntoView)==null||r.call(t,{block:"nearest"});let{left:d,top:f}=t.getBoundingClientRect();(Math.abs(u-d)>1||Math.abs(c-f)>1)&&((o=n==null?void 0:n.scrollIntoView)==null||o.call(n,{block:"center",inline:"center"}),(l=t.scrollIntoView)==null||l.call(t,{block:"nearest"}))}}}function Yl(t){return t.pointerType===""&&t.isTrusted?!0:Rr()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function mc(t){return!Rr()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function Xl(t,e,n){let r=Pe(o=>{n&&!o.defaultPrevented&&n(e)});a.useEffect(()=>{var l;let o=(l=t==null?void 0:t.current)==null?void 0:l.form;return o==null||o.addEventListener("reset",r),()=>{o==null||o.removeEventListener("reset",r)}},[t])}function gc(t,e){let{collection:n,onLoadMore:r,scrollOffset:o=1}=t,l=a.useRef(null),i=Pe(s=>{for(let u of s)u.isIntersecting&&r&&r()});ne(()=>(e.current&&(l.current=new IntersectionObserver(i,{root:Ir(e==null?void 0:e.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),l.current.observe(e.current)),()=>{l.current&&l.current.disconnect()}),[n,e,o])}function $c(t){const e=a.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}function Br(t,e=!0){let[n,r]=a.useState(!0),o=n&&e;return ne(()=>{if(o&&t.current&&"getAnimations"in t.current)for(let l of t.current.getAnimations())l instanceof CSSTransition&&l.cancel()},[t,o]),Zl(t,o,a.useCallback(()=>r(!1),[])),o}function or(t,e){let[n,r]=a.useState(e?"open":"closed");switch(n){case"open":e||r("exiting");break;case"closed":case"exiting":e&&r("open");break}let o=n==="exiting";return Zl(t,o,a.useCallback(()=>{r(l=>l==="exiting"?"closed":l)},[])),o}function Zl(t,e,n){ne(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let r=t.current.getAnimations();if(r.length===0){n();return}let o=!1;return Promise.allSettled(r.map(l=>l.finished)).then(()=>{o||Lr.flushSync(()=>{n()})}),()=>{o=!0}}},[t,e,n])}const yc=typeof Element<"u"&&"checkVisibility"in Element.prototype;function vc(t){const e=xe(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:r}=t.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:l}=t.ownerDocument.defaultView;let{display:i,visibility:s}=l(t);o=i!=="none"&&s!=="hidden"&&s!=="collapse"}return o}function xc(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Nr(t,e){return yc?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&vc(t)&&xc(t,e)&&(!t.parentElement||Nr(t.parentElement,t))}const Or=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Cc=Or.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Or.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ec=Or.join(':not([hidden]):not([tabindex="-1"]),');function Jl(t,e){return t.matches(Cc)&&!ei(t)&&((e==null?void 0:e.skipVisibilityCheck)||Nr(t))}function Ql(t){return t.matches(Ec)&&Nr(t)&&!ei(t)}function ei(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function wo(t){let e=t==null?void 0:t.defaultView;return(e==null?void 0:e.__webpack_nonce__)||globalThis.__webpack_nonce__||void 0}let zn=new WeakMap;function ti(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return wo(e);if(zn.has(e))return zn.get(e);let n=e.querySelector('meta[property="csp-nonce"]'),r=n&&n instanceof xe(n).HTMLMetaElement&&(n.nonce||n.content)||wo(e)||void 0;return r!==void 0&&zn.set(e,r),r}function wc(t,e,n){const{render:r,...o}=e,l=a.useRef(null),i=a.useMemo(()=>ht(n,l),[n,l]);ne(()=>{},[t,r]);const s={...o,ref:i};return r?r(s,void 0):A.jsx(t,{...s})}const So={},Ae=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=So[e];return n||(n=a.forwardRef(wc.bind(null,e)),So[e]=n),n}});var Sc=/\s+/g,Pc=t=>typeof t!="string"||!t?t:t.replace(Sc," ").trim(),Bt=(...t)=>{const e=[],n=r=>{if(!r&&r!==0&&r!==0n)return;if(Array.isArray(r)){for(let l=0,i=r.length;l0?Pc(e.join(" ")):void 0},Po=t=>t===!1?"false":t===!0?"true":t===0?"0":t,ge=t=>{if(!t||typeof t!="object")return!0;for(const e in t)return!1;return!0},Tc=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let o=0;o{for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const r=e[n];n in t?t[n]=Bt(t[n],r):t[n]=r}return t},ni=(t,e)=>{for(let n=0;n{const e=[];ni(t,e);const n=[];for(let r=0;r{const n={};for(const r in t){const o=t[r];if(r in e){const l=e[r];Array.isArray(o)||Array.isArray(l)?n[r]=ri(l,o):typeof o=="object"&&typeof l=="object"&&o&&l?n[r]=lr(o,l):n[r]=l+" "+o}else n[r]=o}for(const r in e)r in t||(n[r]=e[r]);return n},Dc={twMerge:!0,twMergeConfig:{}};function Mc(){let t=null,e={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(r){t=r},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(r){e=r},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(r){n=r},reset(){t=null,e={},n=!1}}}var Be=Mc(),Ac=t=>{const e=(r,o)=>{const{extend:l=null,slots:i={},variants:s={},compoundVariants:u=[],compoundSlots:c=[],defaultVariants:d={}}=r,f={...Dc,...o},b=l!=null&&l.base?Bt(l.base,r==null?void 0:r.base):r==null?void 0:r.base,p=l!=null&&l.variants&&!ge(l.variants)?lr(s,l.variants):s,m=l!=null&&l.defaultVariants&&!ge(l.defaultVariants)?{...l.defaultVariants,...d}:d;!ge(f.twMergeConfig)&&!Tc(f.twMergeConfig,Be.cachedTwMergeConfig)&&(Be.didTwMergeConfigChange=!0,Be.cachedTwMergeConfig=f.twMergeConfig);const v=ge(l==null?void 0:l.slots),g=ge(i)?{}:{base:Bt(r==null?void 0:r.base,v&&(l==null?void 0:l.base)),...i},x=v?g:kc({...l==null?void 0:l.slots},ge(g)?{base:r==null?void 0:r.base}:g),$=ge(l==null?void 0:l.compoundVariants)?u:ri(l==null?void 0:l.compoundVariants,u),D=F=>{if(ge(p)&&ge(i)&&v)return t(b,F==null?void 0:F.class,F==null?void 0:F.className)(f);if($&&!Array.isArray($))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof $}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const R=(h,C=p,M=null,E=null)=>{const w=C[h];if(!w||ge(w))return null;const T=(E==null?void 0:E[h])??(F==null?void 0:F[h]);if(T===null)return null;const S=Po(T);if(typeof S=="object")return null;const N=m==null?void 0:m[h],q=S??Po(N);return w[q||"false"]},I=()=>{if(!p)return null;const h=Object.keys(p),C=[];for(let M=0;M{if(!p||typeof p!="object")return null;const M=[];for(const E in p){const w=R(E,p,h,C),T=h==="base"&&typeof w=="string"?w:w&&w[h];T&&M.push(T)}return M},B={};for(const h in F){const C=F[h];C!==void 0&&(B[h]=C)}const K=(h,C)=>{var E;const M=typeof(F==null?void 0:F[h])=="object"?{[h]:(E=F[h])==null?void 0:E.initial}:{};return{...m,...B,...M,...C}},_=(h=[],C)=>{const M=[],E=h.length;for(let w=0;w{const C=_($,h);if(!Array.isArray(C))return C;const M={},E=t;for(let w=0;w{if(c.length<1)return null;const C={},M=K(null,h);for(let E=0;E{const w=U(E),T=z(E);return C(x[M],k(M,E),w?w[M]:void 0,T?T[M]:void 0,E==null?void 0:E.class,E==null?void 0:E.className)(f)}}return h}return t(b,I(),_($),F==null?void 0:F.class,F==null?void 0:F.className)(f)},P=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return D.variantKeys=P(),D.extend=l,D.base=b,D.slots=x,D.variants=p,D.defaultVariants=m,D.compoundSlots=c,D.compoundVariants=$,D};return{tv:e,createTV:r=>(o,l)=>e(o,l?lr(r,l):r)}};const Lc=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),oi=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),pn="-",To=[],Rc="arbitrary..",Fc=t=>{const e=Bc(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ic(i);const s=i.split(pn),u=s[0]===""&&s.length>1?1:0;return li(s,u,e)},getConflictingClassGroupIds:(i,s)=>{if(s){const u=r[i],c=n[i];return u?c?Lc(c,u):u:c||To}return n[i]||To}}},li=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const c=li(t,e+1,l);if(c)return c}const i=n.validators;if(i===null)return;const s=e===0?t.join(pn):t.slice(e).join(pn),u=i.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Rc+r:void 0})(),Bc=t=>{const{theme:e,classGroups:n}=t;return Nc(n,e)},Nc=(t,e)=>{const n=oi();for(const r in t){const o=t[r];Vr(o,n,r,e)}return n},Vr=(t,e,n,r)=>{const o=t.length;for(let l=0;l{if(typeof t=="string"){Vc(t,e,n);return}if(typeof t=="function"){_c(t,e,n,r);return}jc(t,e,n,r)},Vc=(t,e,n)=>{const r=t===""?e:ii(e,t);r.classGroupId=n},_c=(t,e,n,r)=>{if(zc(t)){Vr(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Kc(n,t))},jc=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let i=0;i{let n=t;const r=e.split(pn),o=r.length;for(let l=0;l"isThemeGetter"in t&&t.isThemeGetter===!0,Hc=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,i)=>{n[l]=i,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let i=n[l];if(i!==void 0)return i;if((i=r[l])!==void 0)return o(l,i),i},set(l,i){l in n?n[l]=i:o(l,i)}}},ir="!",ko=":",Wc=[],Do=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Gc=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let i=0,s=0,u=0,c;const d=o.length;for(let v=0;vu?c-u:void 0;return Do(l,p,b,m)};if(e){const o=e+ko,l=r;r=i=>i.startsWith(o)?l(i.slice(o.length)):Do(Wc,!1,i,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},Uc=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},qc=t=>({cache:Hc(t.cacheSize),parseClassName:Gc(t),sortModifiers:Uc(t),...Fc(t)}),Yc=/\s+/,Xc=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,i=[],s=t.trim().split(Yc);let u="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:f,modifiers:b,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}=n(d);if(f){u=d+(u.length>0?" "+u:u);continue}let g=!!v,x=r(g?m.substring(0,v):m);if(!x){if(!g){u=d+(u.length>0?" "+u:u);continue}if(x=r(m),!x){u=d+(u.length>0?" "+u:u);continue}g=!1}const $=b.length===0?"":b.length===1?b[0]:l(b).join(":"),D=p?$+ir:$,P=D+x;if(i.indexOf(P)>-1)continue;i.push(P);const F=o(x,g);for(let R=0;R0?" "+u:u)}return u},Zc=(...t)=>{let e=0,n,r,o="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,o,l;const i=u=>{const c=e.reduce((d,f)=>f(d),t());return n=qc(c),r=n.cache.get,o=n.cache.set,l=s,s(u)},s=u=>{const c=r(u);if(c)return c;const d=Xc(u,n);return o(u,d),d};return l=i,(...u)=>l(Zc(...u))},Jc=[],de=t=>{const e=n=>n[t]||Jc;return e.isThemeGetter=!0,e},ai=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ui=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qc=/^\d+\/\d+$/,ed=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,td=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,od=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,st=t=>Qc.test(t),Y=t=>!!t&&!Number.isNaN(Number(t)),ze=t=>!!t&&Number.isInteger(Number(t)),Hn=t=>t.endsWith("%")&&Y(t.slice(0,-1)),Ie=t=>ed.test(t),ld=()=>!0,id=t=>td.test(t)&&!nd.test(t),ci=()=>!1,sd=t=>rd.test(t),ad=t=>od.test(t),ud=t=>!O(t)&&!V(t),cd=t=>mt(t,pi,ci),O=t=>ai.test(t),Ue=t=>mt(t,bi,id),Wn=t=>mt(t,hd,Y),Mo=t=>mt(t,di,ci),dd=t=>mt(t,fi,ad),Zt=t=>mt(t,hi,sd),V=t=>ui.test(t),Ct=t=>gt(t,bi),fd=t=>gt(t,md),Ao=t=>gt(t,di),pd=t=>gt(t,pi),bd=t=>gt(t,fi),Jt=t=>gt(t,hi,!0),mt=(t,e,n)=>{const r=ai.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},gt=(t,e,n=!1)=>{const r=ui.exec(t);return r?r[1]?e(r[1]):n:!1},di=t=>t==="position"||t==="percentage",fi=t=>t==="image"||t==="url",pi=t=>t==="length"||t==="size"||t==="bg-size",bi=t=>t==="length",hd=t=>t==="number",md=t=>t==="family-name",hi=t=>t==="shadow",ar=()=>{const t=de("color"),e=de("font"),n=de("text"),r=de("font-weight"),o=de("tracking"),l=de("leading"),i=de("breakpoint"),s=de("container"),u=de("spacing"),c=de("radius"),d=de("shadow"),f=de("inset-shadow"),b=de("text-shadow"),p=de("drop-shadow"),m=de("blur"),v=de("perspective"),g=de("aspect"),x=de("ease"),$=de("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...P(),V,O],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[V,O,u],B=()=>[st,"full","auto",...k()],K=()=>[ze,"none","subgrid",V,O],_=()=>["auto",{span:["full",ze,V,O]},ze,V,O],U=()=>[ze,"auto",V,O],z=()=>["auto","min","max","fr",V,O],h=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],C=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...k()],E=()=>[st,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],w=()=>[t,V,O],T=()=>[...P(),Ao,Mo,{position:[V,O]}],S=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",pd,cd,{size:[V,O]}],q=()=>[Hn,Ct,Ue],W=()=>["","none","full",c,V,O],X=()=>["",Y,Ct,Ue],Q=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[Y,Hn,Ao,Mo],be=()=>["","none",m,V,O],we=()=>["none",Y,V,O],L=()=>["none",Y,V,O],H=()=>[Y,V,O],oe=()=>[st,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ie],breakpoint:[Ie],color:[ld],container:[Ie],"drop-shadow":[Ie],ease:["in","out","in-out"],font:[ud],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ie],shadow:[Ie],spacing:["px",Y],text:[Ie],"text-shadow":[Ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",st,O,V,g]}],container:["container"],columns:[{columns:[Y,O,V,s]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[ze,"auto",V,O]}],basis:[{basis:[st,"full","auto",s,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Y,st,"auto","initial","none",O]}],grow:[{grow:["",Y,V,O]}],shrink:[{shrink:["",Y,V,O]}],order:[{order:[ze,"first","last","none",V,O]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...h(),"normal"]}],"justify-items":[{"justify-items":[...C(),"normal"]}],"justify-self":[{"justify-self":["auto",...C()]}],"align-content":[{content:["normal",...h()]}],"align-items":[{items:[...C(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...C(),{baseline:["","last"]}]}],"place-content":[{"place-content":h()}],"place-items":[{"place-items":[...C(),"baseline"]}],"place-self":[{"place-self":["auto",...C()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,Ct,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,V,Wn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hn,O]}],"font-family":[{font:[fd,O,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,V,O]}],"line-clamp":[{"line-clamp":[Y,"none",V,Wn]}],leading:[{leading:[l,...k()]}],"list-image":[{"list-image":["none",V,O]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",V,O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Y,"from-font","auto",V,Ue]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[Y,"auto",V,O]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",V,O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",V,O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:S()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ze,V,O],radial:["",V,O],conic:[ze,V,O]},bd,dd]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Y,V,O]}],"outline-w":[{outline:["",Y,Ct,Ue]}],"outline-color":[{outline:w()}],shadow:[{shadow:["","none",d,Jt,Zt]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":["none",f,Jt,Zt]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[Y,Ue]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":["none",b,Jt,Zt]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[Y,V,O]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Y]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[V,O]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Y]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:S()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",V,O]}],filter:[{filter:["","none",V,O]}],blur:[{blur:be()}],brightness:[{brightness:[Y,V,O]}],contrast:[{contrast:[Y,V,O]}],"drop-shadow":[{"drop-shadow":["","none",p,Jt,Zt]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:["",Y,V,O]}],"hue-rotate":[{"hue-rotate":[Y,V,O]}],invert:[{invert:["",Y,V,O]}],saturate:[{saturate:[Y,V,O]}],sepia:[{sepia:["",Y,V,O]}],"backdrop-filter":[{"backdrop-filter":["","none",V,O]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[Y,V,O]}],"backdrop-contrast":[{"backdrop-contrast":[Y,V,O]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Y,V,O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Y,V,O]}],"backdrop-invert":[{"backdrop-invert":["",Y,V,O]}],"backdrop-opacity":[{"backdrop-opacity":[Y,V,O]}],"backdrop-saturate":[{"backdrop-saturate":[Y,V,O]}],"backdrop-sepia":[{"backdrop-sepia":["",Y,V,O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",V,O]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Y,"initial",V,O]}],ease:[{ease:["linear","initial",x,V,O]}],delay:[{delay:[Y,V,O]}],animate:[{animate:["none",$,V,O]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,V,O]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[V,O,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:w()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",V,O]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",V,O]}],fill:[{fill:["none",...w()]}],"stroke-w":[{stroke:[Y,Ct,Ue,Wn]}],stroke:[{stroke:["none",...w()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gd=(t,{cacheSize:e,prefix:n,experimentalParseClassName:r,extend:o={},override:l={}})=>(kt(t,"cacheSize",e),kt(t,"prefix",n),kt(t,"experimentalParseClassName",r),Qt(t.theme,l.theme),Qt(t.classGroups,l.classGroups),Qt(t.conflictingClassGroups,l.conflictingClassGroups),Qt(t.conflictingClassGroupModifiers,l.conflictingClassGroupModifiers),kt(t,"orderSensitiveModifiers",l.orderSensitiveModifiers),en(t.theme,o.theme),en(t.classGroups,o.classGroups),en(t.conflictingClassGroups,o.conflictingClassGroups),en(t.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),mi(t,o,"orderSensitiveModifiers"),t),kt=(t,e,n)=>{n!==void 0&&(t[e]=n)},Qt=(t,e)=>{if(e)for(const n in e)kt(t,n,e[n])},en=(t,e)=>{if(e)for(const n in e)mi(t,e,n)},mi=(t,e,n)=>{const r=e[n];r!==void 0&&(t[n]=t[n]?t[n].concat(r):r)},$d=(t,...e)=>typeof t=="function"?sr(ar,t,...e):sr(()=>gd(ar(),t),...e),yd=sr(ar);var vd=t=>ge(t)?yd:$d({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),xd=(t,e)=>{const n=Bt(t);return!n||!((e==null?void 0:e.twMerge)??!0)?n:((!Be.cachedTwMerge||Be.didTwMergeConfigChange)&&(Be.didTwMergeConfigChange=!1,Be.cachedTwMerge=vd(Be.cachedTwMergeConfig)),Be.cachedTwMerge(n)||void 0)},Cd=(...t)=>e=>xd(t,e),{tv:me}=Ac(Cd);const En=me({defaultVariants:{size:"md",status:"danger",variant:"opaque"},slots:{backdrop:"alert-dialog__backdrop",body:"alert-dialog__body",closeTrigger:"alert-dialog__close-trigger",container:"alert-dialog__container",dialog:"alert-dialog__dialog",footer:"alert-dialog__footer",header:"alert-dialog__header",heading:"alert-dialog__heading",icon:"alert-dialog__icon",trigger:"alert-dialog__trigger"},variants:{size:{cover:{dialog:"alert-dialog__dialog--cover"},lg:{dialog:"alert-dialog__dialog--lg"},md:{dialog:"alert-dialog__dialog--md"},sm:{dialog:"alert-dialog__dialog--sm"},xs:{dialog:"alert-dialog__dialog--xs"}},status:{accent:{icon:"alert-dialog__icon--accent"},danger:{icon:"alert-dialog__icon--danger"},default:{icon:"alert-dialog__icon--default"},success:{icon:"alert-dialog__icon--success"},warning:{icon:"alert-dialog__icon--warning"}},variant:{blur:{backdrop:"alert-dialog__backdrop--blur"},opaque:{backdrop:"alert-dialog__backdrop--opaque"},transparent:{backdrop:"alert-dialog__backdrop--transparent"}}}}),Ed=me({base:"button",defaultVariants:{fullWidth:!1,isIconOnly:!1,size:"md",variant:"primary"},variants:{fullWidth:{false:"",true:"button--full-width"},isIconOnly:{true:"button--icon-only"},size:{lg:"button--lg",md:"button--md",sm:"button--sm"},variant:{danger:"button--danger","danger-soft":"button--danger-soft",ghost:"button--ghost",outline:"button--outline",primary:"button--primary",secondary:"button--secondary",tertiary:"button--tertiary"}}}),wd=me({defaultVariants:{variant:"default"},slots:{base:"card",content:"card__content",description:"card__description",footer:"card__footer",header:"card__header",title:"card__title"},variants:{variant:{default:{base:"card--default"},secondary:{base:"card--secondary"},tertiary:{base:"card--tertiary"},transparent:{base:"card--transparent"}}}}),Sd=me({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),Pd=me({base:"close-button",defaultVariants:{variant:"default"},variants:{variant:{default:"close-button--default"}}}),Td=me({defaultVariants:{fullWidth:!1},slots:{base:"combo-box",inputGroup:"combo-box__input-group",popover:"combo-box__popover",trigger:"combo-box__trigger"},variants:{fullWidth:{false:{},true:{base:"combo-box--full-width",inputGroup:"combo-box__input-group--full-width"}}}}),kd=me({base:"description"}),Dd=me({base:"input",defaultVariants:{fullWidth:!1,variant:"primary"},variants:{fullWidth:{false:"",true:"input--full-width"},variant:{primary:"input--primary",secondary:"input--secondary"}}}),Md=me({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),Ad=me({slots:{base:"link",icon:"link__icon"}}),Ld=me({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),Kd=me({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),Rd=me({base:"list-box-section"}),Fd=me({base:"spinner",defaultVariants:{color:"accent",size:"md"},variants:{color:{accent:"spinner--accent",current:"spinner--current",danger:"spinner--danger",success:"spinner--success",warning:"spinner--warning"},size:{lg:"spinner--lg",md:"spinner--md",sm:"spinner--sm",xl:"spinner--xl"}}}),Id=me({base:"textfield",defaultVariants:{fullWidth:!1},variants:{fullWidth:{false:"",true:"textfield--full-width"}}}),bn=Symbol("default");function rt({values:t,children:e}){for(let[n,r]of t)e=y.createElement(n.Provider,{value:r},e);return e}function Ee(t){let{className:e,style:n,children:r,defaultClassName:o,defaultChildren:l,defaultStyle:i,values:s,render:u}=t;return a.useMemo(()=>{let c,d,f;return typeof e=="function"?c=e({...s,defaultClassName:o}):c=e,typeof n=="function"?d=n({...s,defaultStyle:i||{}}):d=n,typeof r=="function"?f=r({...s,defaultChildren:l}):r==null?f=l:f=r,{className:c??o,style:d||i?{...i,...d}:void 0,children:f??l,"data-rac":"",render:u?b=>u(b,s):void 0}},[e,n,r,o,l,i,s,u])}function Bd(t,e){return n=>e(typeof t=="function"?t(n):t,n)}function _r(t,e){let n=a.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=e||bn;if(!n.slots[r]){let o=new Intl.ListFormat().format(Object.keys(n.slots).map(i=>`"${i}"`)),l=e?`Invalid slot "${e}".`:"A slot prop is required.";throw new Error(`${l} Valid slot names are ${o}.`)}return n.slots[r]}return n}function Ce(t,e,n){let r=_r(n,t.slot)||{},{ref:o,...l}=r,i=nt(a.useMemo(()=>ht(e,o),[e,o])),s=J(l,t);return"style"in l&&l.style&&"style"in t&&t.style&&(typeof l.style=="function"||typeof t.style=="function"?s.style=u=>{let c=typeof l.style=="function"?l.style(u):l.style,d={...u.defaultStyle,...c},f=typeof t.style=="function"?t.style({...u,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...l.style,...t.style}),[s,i]}function jr(t=!0){let[e,n]=a.useState(t),r=a.useRef(!1),o=a.useCallback(l=>{r.current=!0,n(!!l)},[]);return ne(()=>{r.current||n(!1)},[]),[o,e]}function gi(t){const e=/^(data-.*)$/;let n={};for(const r in t)e.test(r)||(n[r]=t[r]);return n}function Nd(t,e,n){let{render:r,...o}=e,l=a.useRef(null),i=a.useMemo(()=>ht(n,l),[n,l]);ne(()=>{},[t,r]);let s={...o,ref:i};return r?r(s,void 0):y.createElement(t,s)}const Lo={},fe=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=Lo[e];return n||(n=a.forwardRef(Nd.bind(null,e)),Lo[e]=n),n}});typeof HTMLTemplateElement<"u"&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.appendChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.removeChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(t,e){return this.content.insertBefore(t,e)}}));const hn=a.createContext(!1);function Od(t){if(a.useContext(hn))return y.createElement(y.Fragment,null,t.children);let n=y.createElement(hn.Provider,{value:!0},t.children);return y.createElement("template",null,n)}function Ht(t){let e=(n,r)=>a.useContext(hn)?null:t(n,r);return e.displayName=t.displayName||t.name,a.forwardRef(e)}function Vd(){return a.useContext(hn)}const wn=a.createContext({}),_d=Ht(function(e,n){[e,n]=Ce(e,n,wn);let{elementType:r="label",...o}=e,l=fe[r];return y.createElement(l,{className:"react-aria-Label",...o,ref:n})});function $i(t){let{id:e,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:l="label"}=t;e=ve(e);let i=ve(),s={};n&&(r=r?`${i} ${r}`:i,s={id:i,htmlFor:l==="label"?e:void 0});let u=dn({id:e,"aria-label":o,"aria-labelledby":r});return{labelProps:s,fieldProps:u}}const jd=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),zd=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Hd(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return jd.has(n.script)}let e=t.split("-")[0];return zd.has(e)}const yi=Symbol.for("react-aria.i18n.locale");function vi(){let t=typeof window<"u"&&window[yi]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:Hd(t)?"rtl":"ltr"}}let ur=vi(),Dt=new Set;function Ko(){ur=vi();for(let t of Dt)t(ur)}function Wd(){let t=et(),[e,n]=a.useState(ur);return a.useEffect(()=>(Dt.size===0&&window.addEventListener("languagechange",Ko),Dt.add(n),()=>{Dt.delete(n),Dt.size===0&&window.removeEventListener("languagechange",Ko)}),[]),t?{locale:typeof window<"u"&&window[yi]||"en-US",direction:"ltr"}:e}const Gd=y.createContext(null);function $t(){let t=Wd();return a.useContext(Gd)||t}function cr(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const Ud=a.createContext(null),xi=7e3;let Re=null;function Lt(t,e="assertive",n=xi){Re?Re.announce(t,e,n):(Re=new qd,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?Re.announce(t,e,n):setTimeout(()=>{Re!=null&&Re.isAttached()&&(Re==null||Re.announce(t,e,n))},100))}class qd{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){var e;return(e=this.node)==null?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",r=xi){var l,i;if(!this.node)return;let o=document.createElement("div");typeof e=="object"?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,n==="assertive"?(l=this.assertiveLog)==null||l.appendChild(o):(i=this.politeLog)==null||i.appendChild(o),e!==""&&setTimeout(()=>{o.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}}function zr(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function Ci(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Ei(t){let e=a.useRef({isFocused:!1,observer:null});return ne(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),a.useCallback(n=>{let r=j(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){e.current.isFocused=!0;let o=r,l=i=>{if(e.current.isFocused=!1,o.disabled){let s=zr(i);t==null||t(s)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",l,{once:!0}),e.current.observer=new MutationObserver(()=>{var i;if(e.current.isFocused&&o.disabled){(i=e.current.observer)==null||i.disconnect();let s=o===re()?null:re();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let mn=!1;function Yd(t){for(;t&&!Jl(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=xe(t),n=e.document.activeElement;if(!n||n===t)return;mn=!0;let r=!1,o=d=>{(j(d)===n||r)&&d.stopImmediatePropagation()},l=d=>{(j(d)===n||r)&&(d.stopImmediatePropagation(),!t&&!r&&(r=!0,Ke(n),u()))},i=d=>{(j(d)===t||r)&&d.stopImmediatePropagation()},s=d=>{(j(d)===t||r)&&(d.stopImmediatePropagation(),r||(r=!0,Ke(n),u()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",l,!0),e.addEventListener("focusin",s,!0),e.addEventListener("focus",i,!0);let u=()=>{cancelAnimationFrame(c),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",l,!0),e.removeEventListener("focusin",s,!0),e.removeEventListener("focus",i,!0),mn=!1,r=!1},c=requestAnimationFrame(u);return u}let ot=null;const dr=new Set;let Kt=new Map,Qe=!1,fr=!1;const Xd={Tab:!0,Escape:!0};function Sn(t,e){for(let n of dr)n(t,e)}function Zd(t){return!(t.metaKey||!Xe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function gn(t){Qe=!0,!_e.isOpening&&Zd(t)&&(ot="keyboard",Sn("keyboard",t))}function ft(t){ot="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(Qe=!0,Sn("pointer",t))}function wi(t){!_e.isOpening&&Yl(t)&&(Qe=!0,ot="virtual")}function Si(t){let e=xe(j(t)),n=ee(j(t));j(t)===e||j(t)===n||mn||!t.isTrusted||(!Qe&&!fr&&(ot="virtual",Sn("virtual",t)),Qe=!1,fr=!1)}function Pi(){mn||(Qe=!1,fr=!0)}function pr(t){if(typeof window>"u"||typeof document>"u")return;const e=xe(t),n=ee(t);if(Kt.get(e))return;let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Qe=!0,r.apply(this,arguments)},n.addEventListener("keydown",gn,!0),n.addEventListener("keyup",gn,!0),n.addEventListener("click",wi,!0),e.addEventListener("focus",Si,!0),e.addEventListener("blur",Pi,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",ft,!0),n.addEventListener("pointermove",ft,!0),n.addEventListener("pointerup",ft,!0)),e.addEventListener("beforeunload",()=>{Ti(t)},{once:!0}),Kt.set(e,{focus:r})}const Ti=(t,e)=>{const n=xe(t),r=ee(t);e&&r.removeEventListener("DOMContentLoaded",e),Kt.has(n)&&(n.HTMLElement.prototype.focus=Kt.get(n).focus,r.removeEventListener("keydown",gn,!0),r.removeEventListener("keyup",gn,!0),r.removeEventListener("click",wi,!0),n.removeEventListener("focus",Si,!0),n.removeEventListener("blur",Pi,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",ft,!0),r.removeEventListener("pointermove",ft,!0),r.removeEventListener("pointerup",ft,!0)),Kt.delete(n))};function Jd(t){const e=ee(t);let n;return e.readyState!=="loading"?pr(t):(n=()=>{pr(t)},e.addEventListener("DOMContentLoaded",n)),()=>Ti(t,n)}typeof document<"u"&&Jd();function Nt(){return ot!=="pointer"}function Ot(){return ot}function Qd(t){ot=t,Sn(t,null)}const ef=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function tf(t,e,n){let r=n?j(n):void 0,o=ee(r),l=xe(r);const i=typeof l<"u"?l.HTMLInputElement:HTMLInputElement,s=typeof l<"u"?l.HTMLTextAreaElement:HTMLTextAreaElement,u=typeof l<"u"?l.HTMLElement:HTMLElement,c=typeof l<"u"?l.KeyboardEvent:KeyboardEvent;let d=re(o);return t=t||d instanceof i&&!ef.has(d.type)||d instanceof s||d instanceof u&&d.isContentEditable,!(t&&e==="keyboard"&&n instanceof c&&!Xd[n.key])}function nf(t,e,n){pr(),a.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,l)=>{tf(!!(n!=null&&n.isTextInput),o,l)&&t(Nt())};return dr.add(r),()=>{dr.delete(r)}},e)}function Ge(t){if(!t.isConnected)return;const e=ee(t);if(Ot()==="virtual"){let n=re(e);ql(()=>{const r=re(e);(r===n||r===e.body)&&t.isConnected&&Ke(t)})}else Ke(t)}function Hr(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:o}=t;const l=a.useCallback(u=>{if(j(u)===u.currentTarget)return r&&r(u),o&&o(!1),!0},[r,o]),i=Ei(l),s=a.useCallback(u=>{let c=j(u);const d=ee(c),f=d?re(d):re();c===u.currentTarget&&c===f&&(n&&n(u),o&&o(!0),i(u))},[o,n,i]);return{focusProps:{onFocus:!e&&(n||o||r)?s:void 0,onBlur:!e&&(r||o)?l:void 0}}}function Ro(t){if(!t)return;let e=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(r),e&&n.stopPropagation()}}function ki(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:Ro(t.onKeyDown),onKeyUp:Ro(t.onKeyUp)}}}let br=y.createContext(null);function rf(t){let e=a.useContext(br)||{};Fr(e,t);let{ref:n,...r}=e;return r}function Pn(t,e){let{focusProps:n}=Hr(t),{keyboardProps:r}=ki(t),o=J(n,r),l=rf(e),i=t.isDisabled?{}:l,s=a.useRef(t.autoFocus);a.useEffect(()=>{s.current&&e.current&&Ge(e.current),s.current=!1},[e]);let u=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(u=void 0),{focusableProps:J({...o,tabIndex:u},i)}}let ct="default",hr="",an=new WeakMap;function of(t){if(Ze()){if(ct==="default"){const e=ee(t);hr=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}ct="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";an.set(t,t.style[e]),t.style[e]="none"}}function Fo(t){if(Ze()){if(ct!=="disabled")return;ct="restoring",setTimeout(()=>{ql(()=>{if(ct==="restoring"){const e=ee(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=hr||""),hr="",ct="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&an.has(t)){let e=an.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),an.delete(t)}}const Vt=y.createContext({register:()=>{}});Vt.displayName="PressResponderContext";function lf(t){let e=a.useContext(Vt);if(e){let{register:n,ref:r,...o}=e;t=J(o,t),n()}return Fr(e,t.ref),t}var bt;class tn{constructor(e,n,r,o){$o(this,bt);Nn(this,bt,!0);let l=(o==null?void 0:o.target)??r.currentTarget;const i=l==null?void 0:l.getBoundingClientRect();let s,u=0,c,d=null;r.clientX!=null&&r.clientY!=null&&(c=r.clientX,d=r.clientY),i&&(c!=null&&d!=null?(s=c-i.left,u=d-i.top):(s=i.width/2,u=i.height/2)),this.type=e,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=s,this.y=u,this.key=r.key}continuePropagation(){Nn(this,bt,!1)}get shouldStopPropagation(){return go(this,bt)}}bt=new WeakMap;const Io=Symbol("linkClicked"),Bo="react-aria-pressable-style",No="data-react-aria-pressable";function Wt(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:l,onClick:i,isDisabled:s,isPressed:u,preventFocusOnPress:c,shouldCancelOnPointerExit:d,allowTextSelectionOnPress:f,ref:b,...p}=lf(t),[m,v]=a.useState(!1),g=a.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:$}=Cn(),D=a.useCallback((h,C)=>{let M=g.current;if(s||M.didFirePressStart)return!1;let E=!0;if(M.isTriggeringEvent=!0,r){let w=new tn("pressstart",C,h);r(w),E=w.shouldStopPropagation}return n&&n(!0),M.isTriggeringEvent=!1,M.didFirePressStart=!0,v(!0),E},[s,r,n]),P=a.useCallback((h,C,M=!0)=>{let E=g.current;if(!E.didFirePressStart)return!1;E.didFirePressStart=!1,E.isTriggeringEvent=!0;let w=!0;if(o){let T=new tn("pressend",C,h);o(T),w=T.shouldStopPropagation}if(n&&n(!1),v(!1),e&&M&&!s){let T=new tn("press",C,h);e(T),w&&(w=T.shouldStopPropagation)}return E.isTriggeringEvent=!1,w},[s,o,n,e]),F=Pe(P),R=a.useCallback((h,C)=>{let M=g.current;if(s)return!1;if(l){M.isTriggeringEvent=!0;let E=new tn("pressup",C,h);return l(E),M.isTriggeringEvent=!1,E.shouldStopPropagation}return!0},[s,l]),I=Pe(R),k=a.useCallback(h=>{let C=g.current;if(C.isPressed&&C.target){C.didFirePressStart&&C.pointerType!=null&&P(qe(C.target,h),C.pointerType,!1),C.isPressed=!1,C.isOverTarget=!1,C.activePointerId=null,C.pointerType=null,$(),f||Fo(C.target);for(let M of C.disposables)M();C.disposables=[]}},[f,$,P]),B=Pe(k);a.useEffect(()=>{s&&g.current.isPressed&&B({currentTarget:g.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[s]);let K=a.useCallback(h=>{d&&k(h)},[d,k]),_=a.useCallback(h=>{s||i==null||i(h)},[s,i]),U=a.useCallback((h,C)=>{if(!s&&i){let M=new MouseEvent("click",h);Ci(M,C),i(zr(M))}},[s,i]),z=a.useMemo(()=>{let h=g.current,C={onKeyDown(E){var w;if(Gn(E.nativeEvent,E.currentTarget)&&te(E.currentTarget,j(E))){Oo(j(E),E.key)&&E.preventDefault();let T=!0;!h.isPressed&&!E.repeat&&(h.target=E.currentTarget,h.isPressed=!0,h.pointerType="keyboard",T=D(E,"keyboard"));let S=E.currentTarget,N=q=>{Gn(q,S)&&!q.repeat&&te(S,j(q))&&h.target&&I(qe(h.target,q),"keyboard")};x(ee(E.currentTarget),"keyup",tt(N,M),!0),T&&E.stopPropagation(),E.metaKey&&Xe()&&((w=h.metaKeyEvents)==null||w.set(E.key,E.nativeEvent))}else E.key==="Meta"&&(h.metaKeyEvents=new Map)},onClick(E){if(!(E&&!te(E.currentTarget,j(E)))&&E&&E.button===0&&!h.isTriggeringEvent&&!_e.isOpening){let w=!0;if(s&&E.preventDefault(),!h.ignoreEmulatedMouseEvents&&!h.isPressed&&(h.pointerType==="virtual"||Yl(E.nativeEvent))){let T=D(E,"virtual"),S=I(E,"virtual"),N=F(E,"virtual");_(E),w=T&&S&&N}else if(h.isPressed&&h.pointerType!=="keyboard"){let T=h.pointerType||E.nativeEvent.pointerType||"virtual",S=I(qe(E.currentTarget,E),T),N=F(qe(E.currentTarget,E),T,!0);w=S&&N,h.isOverTarget=!1,_(E),B(E)}h.ignoreEmulatedMouseEvents=!1,w&&E.stopPropagation()}}},M=E=>{var w,T,S;if(h.isPressed&&h.target&&Gn(E,h.target)){Oo(j(E),E.key)&&E.preventDefault();let N=j(E),q=te(h.target,N);F(qe(h.target,E),"keyboard",q),q&&U(E,h.target),$(),E.key!=="Enter"&&Wr(h.target)&&te(h.target,N)&&!E[Io]&&(E[Io]=!0,_e(h.target,E,!1)),h.isPressed=!1,(w=h.metaKeyEvents)==null||w.delete(E.key)}else if(E.key==="Meta"&&((T=h.metaKeyEvents)!=null&&T.size)){let N=h.metaKeyEvents;h.metaKeyEvents=void 0;for(let q of N.values())(S=h.target)==null||S.dispatchEvent(new KeyboardEvent("keyup",q))}};if(typeof PointerEvent<"u"){C.onPointerDown=T=>{if(T.button!==0||!te(T.currentTarget,j(T)))return;if(mc(T.nativeEvent)){h.pointerType="virtual";return}h.pointerType=T.pointerType;let S=!0;if(!h.isPressed){h.isPressed=!0,h.isOverTarget=!0,h.activePointerId=T.pointerId,h.target=T.currentTarget,f||of(h.target),S=D(T,h.pointerType);let N=j(T);"releasePointerCapture"in N&&("hasPointerCapture"in N?N.hasPointerCapture(T.pointerId)&&N.releasePointerCapture(T.pointerId):N.releasePointerCapture(T.pointerId)),x(ee(T.currentTarget),"pointerup",E,!1),x(ee(T.currentTarget),"pointercancel",w,!1)}S&&T.stopPropagation()},C.onMouseDown=T=>{if(te(T.currentTarget,j(T))&&T.button===0){if(c){let S=Yd(T.target);S&&h.disposables.push(S)}T.stopPropagation()}},C.onPointerUp=T=>{!te(T.currentTarget,j(T))||h.pointerType==="virtual"||T.button===0&&!h.isPressed&&I(T,h.pointerType||T.pointerType)},C.onPointerEnter=T=>{T.pointerId===h.activePointerId&&h.target&&!h.isOverTarget&&h.pointerType!=null&&(h.isOverTarget=!0,D(qe(h.target,T),h.pointerType))},C.onPointerLeave=T=>{T.pointerId===h.activePointerId&&h.target&&h.isOverTarget&&h.pointerType!=null&&(h.isOverTarget=!1,F(qe(h.target,T),h.pointerType,!1),K(T))};let E=T=>{if(T.pointerId===h.activePointerId&&h.isPressed&&T.button===0&&h.target){if(te(h.target,j(T))&&h.pointerType!=null){let S=!1,N=setTimeout(()=>{h.isPressed&&h.target instanceof HTMLElement&&(S?B(T):(Ke(h.target),h.target.click()))},80);x(T.currentTarget,"click",()=>S=!0,!0),h.disposables.push(()=>clearTimeout(N))}else B(T);h.isOverTarget=!1}},w=T=>{B(T)};C.onDragStart=T=>{te(T.currentTarget,j(T))&&B(T)}}return C},[x,s,c,$,f,K,D,_,U]);return a.useEffect(()=>{if(!b)return;const h=ee(b.current);if(!h||!h.head||h.getElementById(Bo))return;const C=h.createElement("style");C.id=Bo;let M=ti(h);M&&(C.nonce=M),C.textContent=` -@layer { - [${No}] { - touch-action: pan-x pan-y pinch-zoom; - } -} - `.trim(),h.head.prepend(C)},[b]),a.useEffect(()=>{let h=g.current;return()=>{f||Fo(h.target??void 0);for(let C of h.disposables)C();h.disposables=[]}},[f]),{isPressed:u||m,pressProps:J(p,z,{[No]:!0})}}function Wr(t){return t.tagName==="A"&&t.hasAttribute("href")}function Gn(t,e){const{key:n,code:r}=t,o=e,l=o.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(o instanceof xe(o).HTMLInputElement&&!Di(o,n)||o instanceof xe(o).HTMLTextAreaElement||o.isContentEditable)&&!((l==="link"||!l&&Wr(o))&&n!=="Enter")}function qe(t,e){let n=e.clientX,r=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r,key:e.key}}function sf(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Wr(t)}function Oo(t,e){return t instanceof HTMLInputElement?!Di(t,e):sf(t)}const af=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Di(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":af.has(t.type)}function uf(t,e){let{elementType:n="button",isDisabled:r,onPress:o,onPressStart:l,onPressEnd:i,onPressUp:s,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:b,target:p,rel:m,type:v="button"}=t,g;n==="button"?g={type:v,disabled:r,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:g={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?p:void 0,type:n==="input"?v:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?m:void 0};let{pressProps:x,isPressed:$}=Wt({onPressStart:l,onPressEnd:i,onPressChange:u,onPress:o,onPressUp:s,onClick:f,isDisabled:r,preventFocusOnPress:c,ref:e}),{focusableProps:D}=Pn(t,e);d&&(D.tabIndex=r?-1:D.tabIndex);let P=J(D,x,pe(t,{labelable:!0}));return{isPressed:$,buttonProps:J(g,P,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}function Tn(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=t,l=a.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=Cn(),u=a.useCallback(f=>{te(f.currentTarget,j(f))&&l.current.isFocusWithin&&!te(f.currentTarget,f.relatedTarget)&&(l.current.isFocusWithin=!1,s(),n&&n(f),o&&o(!1))},[n,o,l,s]),c=Ei(u),d=a.useCallback(f=>{if(!te(f.currentTarget,j(f)))return;let b=j(f);const p=ee(b),m=re(p);if(!l.current.isFocusWithin&&m===b){r&&r(f),o&&o(!0),l.current.isFocusWithin=!0,c(f);let v=f.currentTarget;i(p,"focus",g=>{let x=j(g);if(l.current.isFocusWithin&&!te(v,x)){let $=new p.defaultView.FocusEvent("blur",{relatedTarget:x});Ci($,v);let D=zr($);u(D)}},{capture:!0})}},[r,o,c,i,u]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:u}}}function kn(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,o=a.useRef({isFocused:!1,isFocusVisible:e||Nt()}),[l,i]=a.useState(!1),[s,u]=a.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=a.useCallback(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=a.useCallback(p=>{o.current.isFocused=p,o.current.isFocusVisible=Nt(),i(p),c()},[c]);nf(p=>{o.current.isFocusVisible=p,c()},[n,l],{enabled:l,isTextInput:n});let{focusProps:f}=Hr({isDisabled:r,onFocusChange:d}),{focusWithinProps:b}=Tn({isDisabled:!r,onFocusWithinChange:d});return{isFocused:l,isFocusVisible:s,focusProps:r?b:f}}let mr=!1,nn=0;function cf(){mr=!0,setTimeout(()=>{mr=!1},500)}function Vo(t){t.pointerType==="touch"&&cf()}function df(){let t=ee(null);if(!(typeof t>"u"))return nn===0&&typeof PointerEvent<"u"&&t.addEventListener("pointerup",Vo),nn++,()=>{nn--,!(nn>0)&&typeof PointerEvent<"u"&&t.removeEventListener("pointerup",Vo)}}function Gt(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:o}=t,[l,i]=a.useState(!1),s=a.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;a.useEffect(df,[]);let{addGlobalListener:u,removeAllGlobalListeners:c}=Cn(),{hoverProps:d,triggerHoverEnd:f}=a.useMemo(()=>{let b=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!te(v.currentTarget,j(v)))return;s.isHovered=!0;let x=v.currentTarget;s.target=x,u(ee(j(v)),"pointerover",$=>{s.isHovered&&s.target&&!te(s.target,j($))&&p($,$.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:x,pointerType:g}),n&&n(!0),i(!0)},p=(v,g)=>{let x=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,c(),r&&r({type:"hoverend",target:x,pointerType:g}),n&&n(!1),i(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=v=>{mr&&v.pointerType==="mouse"||b(v,v.pointerType)},m.onPointerLeave=v=>{!o&&te(v.currentTarget,j(v))&&p(v,v.pointerType)}),{hoverProps:m,triggerHoverEnd:p}},[e,n,r,o,s,u,c]);return a.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:d,isHovered:l}}const Dn=a.createContext({}),Gr=Ht(function(e,n){[e,n]=Ce(e,n,Dn);let r=e,{isPending:o}=r,{buttonProps:l,isPressed:i}=uf(e,n);l=pf(l,o);let{focusProps:s,isFocused:u,isFocusVisible:c}=kn(e),{hoverProps:d,isHovered:f}=Gt({...e,isDisabled:e.isDisabled||o}),b={isHovered:f,isPressed:(r.isPressed||i)&&!o,isFocused:u,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:o??!1},p=Ee({...e,values:b,defaultClassName:"react-aria-Button"}),m=ve(l.id),v=ve(),g=l["aria-labelledby"];o&&(g?g=`${g} ${v}`:l["aria-label"]&&(g=`${m} ${v}`));let x=a.useRef(o);a.useEffect(()=>{let D={"aria-labelledby":g||m};(!x.current&&u&&o||x.current&&u&&!o)&&Lt(D,"assertive"),x.current=o},[o,u,g,m]);let $=pe(e,{global:!0});return delete $.onClick,y.createElement(fe.button,{...J($,p,l,s,d),type:l.type==="submit"&&o?"button":l.type,id:m,ref:n,"aria-labelledby":g,slot:e.slot||void 0,"aria-disabled":o?"true":l["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":b.isPressed||void 0,"data-hovered":f||void 0,"data-focused":u||void 0,"data-pending":o||void 0,"data-focus-visible":c||void 0},y.createElement(Ud.Provider,{value:{id:v}},p.children))}),ff=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function pf(t,e){if(e){for(const n in t)n.startsWith("on")&&!ff.test(n)&&(t[n]=void 0);t.href=void 0,t.target=void 0}return t}const bf=typeof document<"u"?y.useInsertionEffect??y.useLayoutEffect:()=>{};function $n(t,e,n){let[r,o]=a.useState(t||e),l=a.useRef(r),i=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{i.current,i.current=s},[s]);let u=s?t:r;bf(()=>{l.current=u});let[,c]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(l.current):f;Object.is(l.current,p)||(l.current=p,o(p),c(),n==null||n(p,...b))},[n]);return[u,d]}const Mi=a.createContext({}),hf=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Mi);let{children:r,level:o=3,className:l,...i}=e,s=fe[`h${o}`];return y.createElement(s,{...i,ref:n,className:l??"react-aria-Heading"},r)}),Ai=t=>t?"true":void 0;function Te(t,e){return Bd(t,(n,r)=>{const o=typeof e=="function"?e(r)??"":e??"";return Bt(o,n??"")??""})}const he=(t,e,n)=>typeof t=="function"?t({className:e}):e,mf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron down icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})}),gf=({height:t=9,width:e=9,...n})=>A.jsx("svg",{"aria-hidden":"true","aria-label":"External link icon",fill:"none",height:t,role:"presentation",viewBox:"0 0 7 7",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:A.jsx("path",{d:"M1.20592 6.84333L0.379822 6.01723L4.52594 1.8672H1.37819L1.38601 0.731812H6.48742V5.83714H5.34421L5.35203 2.6933L1.20592 6.84333Z",fill:"currentColor"})}),$f=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Close icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06Z",fill:"currentColor",fillRule:"evenodd"})}),_o=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Info icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),yf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Warning icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0",fill:"currentColor",fillRule:"evenodd"})}),jo=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Danger icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),vf=t=>A.jsx("svg",{"aria-hidden":"true","aria-label":"Success icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:A.jsx("path",{clipRule:"evenodd",d:"M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z",fill:"currentColor",fillRule:"evenodd"})}),Li=a.createContext({}),xf=a.createContext({placement:"bottom"}),Cf=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function zo(t){return t.dataset.liveAnnouncer==="true"||t.dataset.reactAriaTopLayer!==void 0}let Et=new WeakMap,$e=[];function Ur(t,e){let n=xe(t==null?void 0:t[0]),r=e instanceof n.Element?{root:e}:e,o=(r==null?void 0:r.root)??document.body,l=(r==null?void 0:r.shouldUseInert)&&Cf,i=new Set(t),s=new Set,u=g=>l&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true",c=(g,x)=>{l&&g instanceof n.HTMLElement?g.inert=x:x?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},d=new Set;if(Ne())for(let g of t){let x=g;for(;x&&x!==o;){let $=x.getRootNode();"shadowRoot"in $&&d.add($.shadowRoot),x=$.parentNode}}let f=g=>{for(let P of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(P);let x=P=>{if(s.has(P)||i.has(P)||P.parentElement&&s.has(P.parentElement)&&P.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let F of i)if(te(P,F))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},$=Gl(ee(g),g,NodeFilter.SHOW_ELEMENT,{acceptNode:x}),D=x(g);if(D===NodeFilter.FILTER_ACCEPT&&b(g),D!==NodeFilter.FILTER_REJECT){let P=$.nextNode();for(;P!=null;)b(P),P=$.nextNode()}},b=g=>{let x=Et.get(g)??0;u(g)&&x===0||(x===0&&c(g,!0),s.add(g),Et.set(g,x+1))};$e.length&&$e[$e.length-1].disconnect(),f(o);let p=new MutationObserver(g=>{for(let x of g)if(x.type==="childList"){if(x.target.isConnected&&![...i,...s].some($=>te($,x.target)))for(let $ of x.addedNodes)($ instanceof HTMLElement||$ instanceof SVGElement)&&zo($)?i.add($):$ instanceof Element&&f($);if(Ne()){for(let $ of d)if(!$.isConnected){p.disconnect();break}}}});p.observe(o,{childList:!0,subtree:!0});let m=new Set;if(Ne())for(let g of d){let x=new MutationObserver($=>{for(let D of $)if(D.type==="childList"){if(D.target.isConnected&&![...i,...s].some(P=>te(P,D.target)))for(let P of D.addedNodes)(P instanceof HTMLElement||P instanceof SVGElement)&&zo(P)?i.add(P):P instanceof Element&&f(P);if(Ne()){for(let P of d)if(!P.isConnected){p.disconnect();break}}}});x.observe(g,{childList:!0,subtree:!0}),m.add(x)}let v={visibleNodes:i,hiddenNodes:s,observe(){p.observe(o,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return $e.push(v),()=>{if(p.disconnect(),Ne())for(let g of m)g.disconnect();for(let g of s){let x=Et.get(g);x!=null&&(x===1?(c(g,!1),Et.delete(g)):Et.set(g,x-1))}v===$e[$e.length-1]?($e.pop(),$e.length&&$e[$e.length-1].observe()):$e.splice($e.indexOf(v),1)}}function Ef(t){let e=$e[$e.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const ke={top:"top",bottom:"top",left:"left",right:"left"},yn={top:"bottom",bottom:"top",left:"right",right:"left"},wf={top:"left",left:"top"},gr={top:"height",left:"width"},Ki={width:"totalWidth",height:"totalHeight"},rn={};let Sf=()=>typeof document<"u"?window.visualViewport:null;function Ho(t,e){let n=0,r=0,o=0,l=0,i=0,s=0,u={},c=((e==null?void 0:e.scale)??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let d=document.documentElement;o=d.clientWidth,l=d.clientHeight,n=(e==null?void 0:e.width)??o,r=(e==null?void 0:e.height)??l,u.top=d.scrollTop||t.scrollTop,u.left=d.scrollLeft||t.scrollLeft,e&&(i=e.offsetTop,s=e.offsetLeft)}else({width:n,height:r,top:i,left:s}=_t(t,!1)),u.top=t.scrollTop,u.left=t.scrollLeft,o=n,l=r;return _l()&&(t.tagName==="BODY"||t.tagName==="HTML")&&c&&(u.top=0,u.left=0,i=(e==null?void 0:e.pageTop)??0,s=(e==null?void 0:e.pageLeft)??0),{width:n,height:r,totalWidth:o,totalHeight:l,scroll:u,top:i,left:s}}function Pf(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Wo(t,e,n,r,o,l,i){let s=o.scroll[t]??0,u=r[gr[t]],c=i[t]+r.scroll[ke[t]]+l,d=i[t]+r.scroll[ke[t]]+u-l,f=e-s+r.scroll[ke[t]]+i[t]-r[ke[t]],b=e-s+n+r.scroll[ke[t]]+i[t]-r[ke[t]];return fd?Math.max(d-b,c-f):0}function Tf(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function Go(t){if(rn[t])return rn[t];let[e,n]=t.split(" "),r=ke[e]||"right",o=wf[r];ke[n]||(n="center");let l=gr[r],i=gr[o];return rn[t]={placement:e,crossPlacement:n,axis:r,crossAxis:o,size:l,crossSize:i},rn[t]}function Un(t,e,n,r,o,l,i,s,u,c,d){let{placement:f,crossPlacement:b,axis:p,crossAxis:m,size:v,crossSize:g}=r,x={};x[m]=t[m]??0,b==="center"?x[m]+=((t[g]??0)-(n[g]??0))/2:b!==m&&(x[m]+=(t[g]??0)-(n[g]??0)),x[m]+=l;const $=t[m]-n[g]+u+c,D=t[m]+t[g]-u-c;if(x[m]=cr(x[m],$,D),f===p){let P=s?d[v]:d[Ki[v]];x[yn[p]]=Math.floor(P-t[p]+o)}else x[p]=Math.floor(t[p]+t[v]+o);return x}function kf(t,e,n,r,o,l,i,s,u,c,d){let f=(t.top!=null?t.top:u[Ki.height]-(t.bottom??0)-i)-(u.scroll.top??0),b=c?n.top:0,p={top:Math.max(e.top+b,((d==null?void 0:d.offsetTop)??e.top)+b),bottom:Math.min(e.top+e.height+b,((d==null?void 0:d.offsetTop)??0)+((d==null?void 0:d.height)??0))};return s!=="top"?Math.max(0,p.bottom-f-((o.top??0)+(o.bottom??0)+l)):Math.max(0,f+i-p.top-((o.top??0)+(o.bottom??0)+l))}function Uo(t,e,n,r,o,l,i,s){let{placement:u,axis:c,size:d}=l;return u===c?Math.max(0,n[c]-(i.scroll[c]??0)-(t[c]+(s?e[c]:0))-(r[c]??0)-r[yn[c]]-o):Math.max(0,t[d]+t[c]+(s?e[c]:0)-n[c]-n[d]+(i.scroll[c]??0)-(r[c]??0)-r[yn[c]]-o)}function Df(t,e,n,r,o,l,i,s,u,c,d,f,b,p,m,v,g,x){let $=Go(t),{size:D,crossAxis:P,crossSize:F,placement:R,crossPlacement:I}=$,k=Un(e,s,n,$,d,f,c,b,m,v,u),B=d,K=Uo(s,c,e,o,l+d,$,u,g);if(i&&n[D]>K){let Q=Go(`${yn[R]} ${I}`),le=Un(e,s,n,Q,d,f,c,b,m,v,u);Uo(s,c,e,o,l+d,Q,u,g)>K&&($=Q,k=le,B=d)}let _="bottom";$.axis==="top"?$.placement==="top"?_="top":$.placement==="bottom"&&(_="bottom"):$.crossAxis==="top"&&($.crossPlacement==="top"?_="bottom":$.crossPlacement==="bottom"&&(_="top"));let U=Wo(P,k[P],n[F],s,u,l,c);k[P]+=U;let z=kf(k,s,c,b,o,l,n.height,_,u,g,x);p&&p{if(!n||r===null)return;let o=l=>{let i=j(l);if(!e.current||i instanceof Node&&!te(i,e.current)||i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)return;let s=r||Ri.get(e.current);s&&s()};return window.addEventListener("scroll",o,!0),()=>{window.removeEventListener("scroll",o,!0)}},[n,r,e])}let ae=typeof document<"u"?window.visualViewport:null;function Kf(t){let{direction:e}=$t(),{arrowSize:n,targetRef:r,overlayRef:o,arrowRef:l,scrollRef:i=o,placement:s="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d=typeof document<"u"?document.body:null,offset:f=0,crossOffset:b=0,shouldUpdatePosition:p=!0,isOpen:m=!0,onClose:v,maxHeight:g,arrowBoundaryOffset:x=0}=t,[$,D]=a.useState(null),P=[p,s,o.current,r.current,l==null?void 0:l.current,i.current,u,c,d,f,b,m,e,g,x,n],F=a.useRef(ae==null?void 0:ae.scale);a.useEffect(()=>{m&&(F.current=ae==null?void 0:ae.scale)},[m]);let R=a.useCallback(()=>{var z,h;if(p===!1||!m||!o.current||!r.current||!d||(ae==null?void 0:ae.scale)!==F.current)return;let B=null;if(i.current&&It(i.current)){let C=(z=re())==null?void 0:z.getBoundingClientRect(),M=i.current.getBoundingClientRect();B={type:"top",offset:((C==null?void 0:C.top)??0)-M.top},B.offset>M.height/2&&(B.type="bottom",B.offset=((C==null?void 0:C.bottom)??0)-M.bottom)}let K=o.current;!g&&o.current&&(K.style.top="0px",K.style.bottom="",K.style.maxHeight=(((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight)+"px");let _=Mf({placement:Ff(s,e),overlayNode:o.current,targetNode:r.current,scrollNode:i.current||o.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:b,maxHeight:g,arrowSize:n??(l!=null&&l.current?Mn(l.current,!0).width:0),arrowBoundaryOffset:x});if(!_.position)return;K.style.top="",K.style.bottom="",K.style.left="",K.style.right="",Object.keys(_.position).forEach(C=>K.style[C]=_.position[C]+"px"),K.style.maxHeight=_.maxHeight!=null?_.maxHeight+"px":"";let U=re();if(B&&U&&i.current){let C=U.getBoundingClientRect(),M=i.current.getBoundingClientRect(),E=C[B.type]-M[B.type];i.current.scrollTop+=E-B.offset}D(_)},P);ne(R,P),Rf(R),fn({ref:o,onResize:R}),fn({ref:r,onResize:R});let I=a.useRef(!1);ne(()=>{let B,K=()=>{I.current=!0,clearTimeout(B),B=setTimeout(()=>{I.current=!1},500),R()},_=()=>{I.current&&K()};return ae==null||ae.addEventListener("resize",K),ae==null||ae.addEventListener("scroll",_),()=>{ae==null||ae.removeEventListener("resize",K),ae==null||ae.removeEventListener("scroll",_)}},[R]);let k=a.useCallback(()=>{I.current||v==null||v()},[v,I]);return Lf({triggerRef:r,isOpen:m,onClose:v&&k}),{overlayProps:{style:{position:$?"absolute":"fixed",top:$?void 0:0,left:$?void 0:0,zIndex:1e5,...$==null?void 0:$.position,maxHeight:($==null?void 0:$.maxHeight)??"100vh"}},placement:($==null?void 0:$.placement)??null,triggerAnchorPoint:($==null?void 0:$.triggerAnchorPoint)??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:$==null?void 0:$.arrowOffsetLeft,top:$==null?void 0:$.arrowOffsetTop}},updatePosition:R}}function Rf(t){ne(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ff(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Xo=y.createContext(null),$r="react-aria-focus-scope-restore";let ie=null;function Fi(t){let{children:e,contain:n,restoreFocus:r,autoFocus:o}=t,l=a.useRef(null),i=a.useRef(null),s=a.useRef([]),{parentNode:u}=a.useContext(Xo)||{},c=a.useMemo(()=>new vr({scopeRef:s}),[s]);ne(()=>{let b=u||ce.root;if(ce.getTreeNode(b.scopeRef)&&ie&&!vn(ie,b.scopeRef)){let p=ce.getTreeNode(ie);p&&(b=p)}b.addChild(c),ce.addNode(c)},[c,u]),ne(()=>{let b=ce.getTreeNode(s);b&&(b.contain=!!n)},[n]),ne(()=>{var v;let b=(v=l.current)==null?void 0:v.nextSibling,p=[],m=g=>g.stopPropagation();for(;b&&b!==i.current;)p.push(b),b.addEventListener($r,m),b=b.nextSibling;return s.current=p,()=>{for(let g of p)g.removeEventListener($r,m)}},[e]),jf(s,r,n),Of(s,n),zf(s,r,n),_f(s,o),a.useEffect(()=>{const b=re(ee(s.current?s.current[0]:void 0));let p=null;if(De(b,s.current)){for(let m of ce.traverse())m.scopeRef&&De(b,m.scopeRef.current)&&(p=m);p===ce.getTreeNode(s)&&(ie=p.scopeRef)}},[s]),ne(()=>()=>{var p,m;let b=((m=(p=ce.getTreeNode(s))==null?void 0:p.parent)==null?void 0:m.scopeRef)??null;(s===ie||vn(s,ie))&&(!b||ce.getTreeNode(b))&&(ie=b),ce.removeTreeNode(s)},[s]);let d=a.useMemo(()=>If(s),[]),f=a.useMemo(()=>({focusManager:d,parentNode:c}),[c,d]);return y.createElement(Xo.Provider,{value:f},y.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:l}),e,y.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:i}))}function If(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:o,wrap:l,accept:i}=e,s=r||re(ee(n[0]??void 0)),u=n[0].previousElementSibling,c=Ye(n),d=Ve(c,{tabbable:o,accept:i},n);d.currentNode=De(s,n)?s:u;let f=d.nextNode();return!f&&l&&(d.currentNode=u,f=d.nextNode()),f&&Oe(f,!0),f},focusPrevious(e={}){let n=t.current,{from:r,tabbable:o,wrap:l,accept:i}=e,s=r||re(ee(n[0]??void 0)),u=n[n.length-1].nextElementSibling,c=Ye(n),d=Ve(c,{tabbable:o,accept:i},n);d.currentNode=De(s,n)?s:u;let f=d.previousNode();return!f&&l&&(d.currentNode=u,f=d.previousNode()),f&&Oe(f,!0),f},focusFirst(e={}){let n=t.current,{tabbable:r,accept:o}=e,l=Ye(n),i=Ve(l,{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let s=i.nextNode();return s&&Oe(s,!0),s},focusLast(e={}){let n=t.current,{tabbable:r,accept:o}=e,l=Ye(n),i=Ve(l,{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let s=i.previousNode();return s&&Oe(s,!0),s}}}function Ye(t){return t[0].parentElement}function Mt(t){let e=ce.getTreeNode(ie);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function Bf(t){if(!t.form)return Array.from(ee(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(r=>!r.form);const e=t.form.elements.namedItem(t.name);let n=xe(t);return e instanceof n.RadioNodeList?Array.from(e).filter(r=>r instanceof n.HTMLInputElement):e instanceof n.HTMLInputElement?[e]:[]}function Nf(t){if(t.checked)return!0;const e=Bf(t);return e.length>0&&!e.some(n=>n.checked)}function Of(t,e){let n=a.useRef(void 0),r=a.useRef(void 0);ne(()=>{let o=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const l=ee(o?o[0]:void 0);let i=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!Mt(t)||c.isComposing)return;let d=re(l),f=t.current;if(!f||!De(d,f))return;let b=Ye(f),p=Ve(b,{tabbable:!0},f);if(!d)return;p.currentNode=d;let m=c.shiftKey?p.previousNode():p.nextNode();m||(p.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,m=c.shiftKey?p.previousNode():p.nextNode()),c.preventDefault(),m&&(Oe(m,!0),m instanceof xe(m).HTMLInputElement&&m.select())},s=c=>{(!ie||vn(ie,t))&&De(j(c),t.current)?(ie=t,n.current=j(c)):Mt(t)&&!We(j(c),t)?n.current?n.current.focus():ie&&ie.current&&yr(ie.current):Mt(t)&&(n.current=j(c))},u=c=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{var p;let d=Ot(),f=(d==="virtual"||d===null)&&Rr()&&jl(),b=re(l);if(!f&&b&&Mt(t)&&!We(b,t)){ie=t;let m=j(c);m&&m.isConnected?(n.current=m,(p=n.current)==null||p.focus()):ie.current&&yr(ie.current)}})};return l.addEventListener("keydown",i,!1),l.addEventListener("focusin",s,!1),o==null||o.forEach(c=>c.addEventListener("focusin",s,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",u,!1)),()=>{l.removeEventListener("keydown",i,!1),l.removeEventListener("focusin",s,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",s,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",u,!1))}},[t,e]),ne(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function Ii(t){return We(t)}function De(t,e){return!t||!e?!1:e.some(n=>te(n,t))}function We(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of ce.traverse(ce.getTreeNode(e)))if(n&&De(t,n.current))return!0;return!1}function Vf(t){return We(t,ie)}function vn(t,e){var r;let n=(r=ce.getTreeNode(e))==null?void 0:r.parent;for(;n;){if(n.scopeRef===t)return!0;n=n.parent}return!1}function Oe(t,e=!1){if(t!=null&&!e)try{Ge(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function Bi(t,e=!0){let n=t[0].previousElementSibling,r=Ye(t),o=Ve(r,{tabbable:e},t);o.currentNode=n;let l=o.nextNode();return e&&!l&&(r=Ye(t),o=Ve(r,{tabbable:!1},t),o.currentNode=n,l=o.nextNode()),l}function yr(t,e=!0){Oe(Bi(t,e))}function _f(t,e){const n=y.useRef(e);a.useEffect(()=>{if(n.current){ie=t;const r=ee(t.current?t.current[0]:void 0);!De(re(r),ie.current)&&t.current&&yr(t.current)}n.current=!1},[t])}function jf(t,e,n){ne(()=>{if(e||n)return;let r=t.current;const o=ee(r?r[0]:void 0);let l=i=>{let s=j(i);De(s,t.current)?ie=t:Ii(s)||(ie=null)};return o.addEventListener("focusin",l,!1),r==null||r.forEach(i=>i.addEventListener("focusin",l,!1)),()=>{o.removeEventListener("focusin",l,!1),r==null||r.forEach(i=>i.removeEventListener("focusin",l,!1))}},[t,e,n])}function Zo(t){let e=ce.getTreeNode(ie);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function zf(t,e,n){const r=a.useRef(typeof document<"u"?re(ee(t.current?t.current[0]:void 0)):null);ne(()=>{let o=t.current;const l=ee(o?o[0]:void 0);if(!e||n)return;let i=()=>{(!ie||vn(ie,t))&&De(re(l),t.current)&&(ie=t)};return l.addEventListener("focusin",i,!1),o==null||o.forEach(s=>s.addEventListener("focusin",i,!1)),()=>{l.removeEventListener("focusin",i,!1),o==null||o.forEach(s=>s.removeEventListener("focusin",i,!1))}},[t,n]),ne(()=>{const o=ee(t.current?t.current[0]:void 0);if(!e)return;let l=i=>{if(i.key!=="Tab"||i.altKey||i.ctrlKey||i.metaKey||!Mt(t)||i.isComposing)return;let s=o.activeElement;if(!We(s,t)||!Zo(t))return;let u=ce.getTreeNode(t);if(!u)return;let c=u.nodeToRestore,d=Ve(o.body,{tabbable:!0});d.currentNode=s;let f=i.shiftKey?d.previousNode():d.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,u.nodeToRestore=void 0),(!f||!We(f,t))&&c){d.currentNode=c;do f=i.shiftKey?d.previousNode():d.nextNode();while(We(f,t));i.preventDefault(),i.stopPropagation(),f?Oe(f,!0):Ii(c)?Oe(c,!0):s.blur()}};return n||o.addEventListener("keydown",l,!0),()=>{n||o.removeEventListener("keydown",l,!0)}},[t,e,n]),ne(()=>{const o=ee(t.current?t.current[0]:void 0);if(!e)return;let l=ce.getTreeNode(t);if(l)return l.nodeToRestore=r.current??void 0,()=>{let i=ce.getTreeNode(t);if(!i)return;let s=i.nodeToRestore,u=re(o);if(e&&s&&(u&&We(u,t)||u===o.body&&Zo(t))){let c=ce.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let d=c.getTreeNode(t);for(;d;){if(d.nodeToRestore&&d.nodeToRestore.isConnected){Jo(d.nodeToRestore);return}d=d.parent}for(d=c.getTreeNode(t);d;){if(d.scopeRef&&d.scopeRef.current&&ce.getTreeNode(d.scopeRef)){let f=Bi(d.scopeRef.current,!0);Jo(f);return}d=d.parent}}})}}},[t,e])}function Jo(t){t.dispatchEvent(new CustomEvent($r,{bubbles:!0,cancelable:!0}))&&Oe(t)}function Ve(t,e,n){let r=e!=null&&e.tabbable?Ql:Jl,o=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null,l=ee(o),i=Gl(l,t||l,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return te(e==null?void 0:e.from,s)||e!=null&&e.tabbable&&s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(!Nf(s)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===s.name)?NodeFilter.FILTER_REJECT:r(s)&&(!n||De(s,n))&&(!(e!=null&&e.accept)||e.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e!=null&&e.from&&(i.currentNode=e.from),i}class qr{constructor(){this.fastMap=new Map,this.root=new vr({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,r){let o=this.fastMap.get(n??null);if(!o)return;let l=new vr({scopeRef:e});o.addChild(l),l.parent=o,this.fastMap.set(e,l),r&&(l.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let r=n.parent;for(let l of this.traverse())l!==n&&n.nodeToRestore&&l.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&De(l.nodeToRestore,n.scopeRef.current)&&(l.nodeToRestore=n.nodeToRestore);let o=n.children;r&&(r.removeChild(n),o.size>0&&o.forEach(l=>r&&r.addChild(l))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var n;let e=new qr;for(let r of this.traverse())e.addTreeNode(r.scopeRef,((n=r.parent)==null?void 0:n.scopeRef)??null,r.nodeToRestore);return e}}class vr{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let ce=new qr;function Hf(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=t,l=a.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=Pe(u=>{n&&Qo(u,e)&&(o&&o(u),l.current.isPointerDown=!0)}),s=Pe(u=>{n&&n(u)});a.useEffect(()=>{let u=l.current;if(r)return;const c=e.current,d=ee(c);if(typeof PointerEvent<"u"){let f=b=>{u.isPointerDown&&Qo(b,e)&&s(b),u.isPointerDown=!1};return d.addEventListener("pointerdown",i,!0),d.addEventListener("click",f,!0),()=>{d.removeEventListener("pointerdown",i,!0),d.removeEventListener("click",f,!0)}}},[e,r])}function Qo(t,e){if(t.button>0)return!1;let n=j(t);if(n){const r=n.ownerDocument;if(!r||!te(r.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}const Fe=[];function Ni(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:o,isDismissable:l=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:s}=t,u=a.useRef(void 0);a.useEffect(()=>{if(o&&!Fe.includes(e))return Fe.push(e),()=>{let m=Fe.indexOf(e);m>=0&&Fe.splice(m,1)}},[o,e]);let c=()=>{Fe[Fe.length-1]===e&&n&&n()},d=m=>{const v=Fe[Fe.length-1];u.current=v,(!s||s(j(m)))&&v===e&&m.stopPropagation()},f=m=>{(!s||s(j(m)))&&(Fe[Fe.length-1]===e&&m.stopPropagation(),u.current===e&&c()),u.current=void 0},b=m=>{m.key==="Escape"&&!i&&!m.nativeEvent.isComposing&&(m.stopPropagation(),m.preventDefault(),c())};Hf({ref:e,onInteractOutside:l&&o?f:void 0,onInteractOutsideStart:d});let{focusWithinProps:p}=Tn({isDisabled:!r,onBlurWithin:m=>{!m.relatedTarget||Vf(m.relatedTarget)||(!s||s(m.relatedTarget))&&(n==null||n())}});return{overlayProps:{onKeyDown:b,...p},underlayProps:{}}}const Rt=typeof document<"u"&&window.visualViewport;let on=0,qn;function Oi(t={}){let{isDisabled:e}=t;ne(()=>{if(!e)return on++,on===1&&(Ze()?qn=Gf():qn=Wf()),()=>{on--,on===0&&qn()}},[e])}function Wf(){let t=window.innerWidth-document.documentElement.clientWidth;return tt(t>0&&("scrollbarGutter"in document.documentElement.style?un(document.documentElement,"scrollbarGutter","stable"):un(document.documentElement,"paddingRight",`${t}px`)),un(document.documentElement,"overflow","hidden"))}function Gf(){let t=un(document.documentElement,"overflow","hidden"),e,n=!1,r=d=>{let f=j(d);e=Je(f)?f:Ir(f,!0),n=!1;let b=f.ownerDocument.defaultView.getSelection();b&&!b.isCollapsed&&b.containsNode(f,!0)&&(n=!0),d.composedPath().some(p=>p instanceof HTMLInputElement&&p.type==="range")&&(n=!0),"selectionStart"in f&&"selectionEnd"in f&&f.selectionStart{if(!(d.touches.length===2||n)){if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&d.preventDefault()}},s=d=>{var p;let f=j(d),b=d.relatedTarget;if(b&&At(b))b.focus({preventScroll:!0}),el(b,At(f));else if(!b){let m=(p=f.parentElement)==null?void 0:p.closest("[tabindex]");m==null||m.focus({preventScroll:!0})}},u=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(d){let f=re(),b=f!=null&&At(f);u.call(this,{...d,preventScroll:!0}),(!d||!d.preventScroll)&&el(this,b)};let c=tt(Yn(document,"touchstart",r,{passive:!1,capture:!0}),Yn(document,"touchmove",i,{passive:!1,capture:!0}),Yn(document,"blur",s,!0));return()=>{t(),c(),o.remove(),HTMLElement.prototype.focus=u}}function un(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Yn(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function el(t,e){e||!Rt?tl(t):Rt.addEventListener("resize",()=>tl(t),{once:!0})}function tl(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Ir(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let o=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topo.top+n.clientHeight){let i=o.bottom;Rt&&(i=Math.min(i,Rt.offsetTop+Rt.height));let s=l.top-o.top-((i-o.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+s)),behavior:"smooth"})}}n=r.parentElement}}function Uf(t,e){let{triggerRef:n,popoverRef:r,groupRef:o,isNonModal:l,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...u}=t,c=u.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=Ni({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},o??r),{overlayProps:b,arrowProps:p,placement:m,triggerAnchorPoint:v}=Kf({...u,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return Oi({isDisabled:l||!e.isOpen}),a.useEffect(()=>{if(e.isOpen&&r.current)return l?Ef((o==null?void 0:o.current)??r.current):Ur([(o==null?void 0:o.current)??r.current],{shouldUseInert:!0})},[l,e.isOpen,r,o]),{popoverProps:J(d,b),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:v}}var Vi={};Vi={dismiss:"تجاهل"};var _i={};_i={dismiss:"Отхвърляне"};var ji={};ji={dismiss:"Odstranit"};var zi={};zi={dismiss:"Luk"};var Hi={};Hi={dismiss:"Schließen"};var Wi={};Wi={dismiss:"Απόρριψη"};var Gi={};Gi={dismiss:"Dismiss"};var Ui={};Ui={dismiss:"Descartar"};var qi={};qi={dismiss:"Lõpeta"};var Yi={};Yi={dismiss:"Hylkää"};var Xi={};Xi={dismiss:"Rejeter"};var Zi={};Zi={dismiss:"התעלם"};var Ji={};Ji={dismiss:"Odbaci"};var Qi={};Qi={dismiss:"Elutasítás"};var es={};es={dismiss:"Ignora"};var ts={};ts={dismiss:"閉じる"};var ns={};ns={dismiss:"무시"};var rs={};rs={dismiss:"Atmesti"};var os={};os={dismiss:"Nerādīt"};var ls={};ls={dismiss:"Lukk"};var is={};is={dismiss:"Negeren"};var ss={};ss={dismiss:"Zignoruj"};var as={};as={dismiss:"Descartar"};var us={};us={dismiss:"Dispensar"};var cs={};cs={dismiss:"Revocare"};var ds={};ds={dismiss:"Пропустить"};var fs={};fs={dismiss:"Zrušiť"};var ps={};ps={dismiss:"Opusti"};var bs={};bs={dismiss:"Odbaci"};var hs={};hs={dismiss:"Avvisa"};var ms={};ms={dismiss:"Kapat"};var gs={};gs={dismiss:"Скасувати"};var $s={};$s={dismiss:"取消"};var ys={};ys={dismiss:"關閉"};var vs={};vs={"ar-AE":Vi,"bg-BG":_i,"cs-CZ":ji,"da-DK":zi,"de-DE":Hi,"el-GR":Wi,"en-US":Gi,"es-ES":Ui,"et-EE":qi,"fi-FI":Yi,"fr-FR":Xi,"he-IL":Zi,"hr-HR":Ji,"hu-HU":Qi,"it-IT":es,"ja-JP":ts,"ko-KR":ns,"lt-LT":rs,"lv-LV":os,"nb-NO":ls,"nl-NL":is,"pl-PL":ss,"pt-BR":as,"pt-PT":us,"ro-RO":cs,"ru-RU":ds,"sk-SK":fs,"sl-SI":ps,"sr-SP":bs,"sv-SE":hs,"tr-TR":ms,"uk-UA":gs,"zh-CN":$s,"zh-TW":ys};const qf=Symbol.for("react-aria.i18n.locale"),Yf=Symbol.for("react-aria.i18n.strings");let at;class An{constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,r])=>r)),this.defaultLocale=n}getStringForLocale(e,n){let o=this.getStringsForLocale(n)[e];if(!o)throw new Error(`Could not find intl message ${e} in ${n} locale`);return o}getStringsForLocale(e){let n=this.strings[e];return n||(n=Xf(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[qf];if(at===void 0){let o=window[Yf];if(!o)return null;at={};for(let l in o)at[l]=new An({[n]:o[l]},n)}let r=at==null?void 0:at[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}function Xf(t,e,n="en-US"){if(e[t])return e[t];let r=Zf(t);if(e[r])return e[r];for(let o in e)if(o.startsWith(r+"-"))return e[o];return e[n]}function Zf(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const nl=new Map,rl=new Map;class Jf{constructor(e,n){this.locale=e,this.strings=n}format(e,n){let r=this.strings.getStringForLocale(e,this.locale);return typeof r=="function"?r(n,this):r}plural(e,n,r="cardinal"){let o=n["="+e];if(o)return typeof o=="function"?o():o;let l=this.locale+":"+r,i=nl.get(l);i||(i=new Intl.PluralRules(this.locale,{type:r}),nl.set(l,i));let s=i.select(e);return o=n[s]||n.other,typeof o=="function"?o():o}number(e){let n=rl.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),rl.set(this.locale,n)),n.format(e)}select(e,n){let r=e[n]||e.other;return typeof r=="function"?r():r}}const ol=new WeakMap;function Qf(t){let e=ol.get(t);return e||(e=new An(t),ol.set(t,e)),e}function ep(t,e){return e&&An.getGlobalDictionaryForPackage(e)||Qf(t)}function Yr(t,e){let{locale:n}=$t(),r=ep(t,e);return a.useMemo(()=>new Jf(n,r),[n,r])}const ll={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function tp(t={}){let{style:e,isFocusable:n}=t,[r,o]=a.useState(!1),{focusWithinProps:l}=Tn({isDisabled:!n,onFocusWithinChange:s=>o(s)}),i=a.useMemo(()=>r?e:e?{...ll,...e}:ll,[r]);return{visuallyHiddenProps:{...l,style:i}}}function np(t){let{children:e,elementType:n="div",isFocusable:r,style:o,...l}=t,{visuallyHiddenProps:i}=tp(t);return y.createElement(n,J(l,i),e)}function rp(t){return t&&t.__esModule?t.default:t}function xr(t){let{onDismiss:e,...n}=t,r=Yr(rp(vs),"@react-aria/overlays"),o=dn(n,r.format("dismiss")),l=()=>{e&&e()};return y.createElement(np,null,y.createElement("button",{...o,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}const op=y.forwardRef(({children:t,...e},n)=>{let r=a.useRef(!1),o=a.useContext(Vt),l=J(o||{},{...e,register(){r.current=!0,o&&o.register()}});return l.ref=nt(n||(o==null?void 0:o.ref)),Fr(o,l.ref),a.useEffect(()=>{r.current||(r.current=!0)},[]),y.createElement(Vt.Provider,{value:l},t)});function lp({children:t}){let e=a.useMemo(()=>({register:()=>{}}),[]);return y.createElement(Vt.Provider,{value:e},t)}const ip=a.createContext({});function sp(){return a.useContext(ip)??{}}const xs=y.createContext(null);function Cr(t){let e=et(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[o,l]=a.useState(!1),i=a.useMemo(()=>({contain:o,setContain:l}),[o,l]),{getContainer:s}=sp();if(!t.portalContainer&&s&&(n=s()),!n)return null;let u=t.children;return t.disableFocusManagement||(u=y.createElement(Fi,{restoreFocus:!0,contain:(t.shouldContainFocus||o)&&!r},u)),u=y.createElement(xs.Provider,{value:i},y.createElement(lp,null,u)),Tu.createPortal(u,n)}function Cs(){let t=a.useContext(xs),e=t==null?void 0:t.setContain;ne(()=>{e==null||e(!0)},[e])}function Ln(t){let[e,n]=$n(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=a.useCallback(()=>{n(!0)},[n]),o=a.useCallback(()=>{n(!1)},[n]),l=a.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:o,toggle:l}}const Xr=a.createContext(null),il=a.createContext(null),ap=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Xr);let r=a.useContext(lt),o=Ln(e),l=e.isOpen!=null||e.defaultOpen!=null||!r?o:r,i=or(n,l.isOpen)||e.isExiting||!1,s=Vd(),{direction:u}=$t();if(s){let c=e.children;return typeof c=="function"&&(c=c({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),y.createElement(y.Fragment,null,c)}return l&&!l.isOpen&&!i?null:y.createElement(up,{...e,triggerRef:e.triggerRef,state:l,popoverRef:n,isExiting:i,dir:u})});function up({state:t,isExiting:e,UNSTABLE_portalContainer:n,clearContexts:r,...o}){var K,_;let l=a.useRef(null),i=a.useRef(null),s=a.useContext(il),u=s&&o.trigger==="SubmenuTrigger",{popoverProps:c,underlayProps:d,arrowProps:f,placement:b,triggerAnchorPoint:p}=Uf({...o,offset:o.offset??8,arrowRef:l,groupRef:u?s:i},t),m=o.popoverRef,v=Br(m,!!b)||o.isEntering||!1,g=Ee({...o,defaultClassName:"react-aria-Popover",values:{trigger:o.trigger||null,placement:b,isEntering:v,isExiting:e}}),x=!o.isNonModal||o.trigger==="SubmenuTrigger",[$,D]=a.useState(!1);ne(()=>{m.current&&D(x&&!m.current.querySelector("[role=dialog]"))},[m,x]),a.useEffect(()=>{$&&(o.trigger!=="SubmenuTrigger"||Ot()!=="pointer")&&m.current&&!It(m.current)&&Ge(m.current)},[$,m,o.trigger]);let P=a.useMemo(()=>{let U=g.children;if(r)for(let z of r)U=y.createElement(z.Provider,{value:null},U);return U},[g.children,r]),[F,R]=a.useState(null),I=a.useCallback(()=>{o.triggerRef.current&&R(o.triggerRef.current.getBoundingClientRect().width+"px")},[o.triggerRef]);ne(I,[I]),fn({ref:(K=g.style)!=null&&K["--trigger-width"]?void 0:o.triggerRef,onResize:I});let k={...c.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,...g.style,"--trigger-width":((_=g.style)==null?void 0:_["--trigger-width"])||F},B=y.createElement(fe.div,{...J(pe(o,{global:!0}),c),...g,role:$?"dialog":void 0,tabIndex:$?-1:void 0,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"],ref:m,slot:o.slot||void 0,style:k,dir:o.dir,"data-trigger":o.trigger,"data-placement":b,"data-entering":v||void 0,"data-exiting":e||void 0},!o.isNonModal&&y.createElement(xr,{onDismiss:t.close}),y.createElement(xf.Provider,{value:{...f,placement:b,ref:l}},P),y.createElement(xr,{onDismiss:t.close}));return u?y.createElement(Cr,{...o,shouldContainFocus:$,isExiting:e,portalContainer:n??(s==null?void 0:s.current)??void 0},B):y.createElement(Cr,{...o,shouldContainFocus:$,isExiting:e,portalContainer:n},!o.isNonModal&&t.isOpen&&y.createElement("div",{"data-testid":"underlay",...d,style:{position:"fixed",inset:0}}),y.createElement("div",{ref:i,style:{display:"contents"}},y.createElement(il.Provider,{value:i},B)))}class yt{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,n,r){let o=this.clone();return n.addDescendants(o,e),o}}class Es extends yt{filter(e,n,r){let[o,l]=ws(e,n,this.firstChildKey,r),i=this.clone();return i.firstChildKey=o,i.lastChildKey=l,i}}const oo=class oo extends yt{};oo.type="header";let sl=oo;const lo=class lo extends yt{};lo.type="loader";let Er=lo;const io=class io extends Es{filter(e,n,r){if(r(this.textValue,this)){let o=this.clone();return n.addDescendants(o,e),o}return null}};io.type="item";let wr=io;const so=class so extends Es{filter(e,n,r){let o=super.filter(e,n,r);if(o&&o.lastChildKey!==null){let l=e.getItem(o.lastChildKey);if(l&&l.type!=="header")return o}return null}};so.type="section";let Sr=so;class cp{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),o=(r==null?void 0:r.firstChildKey)!=null?n.get(r.firstChildKey):null;for(;o;)yield o,o=o.nextKey!=null?n.get(o.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);return(n==null?void 0:n.key)??null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}getItem(e){return this.keyMap.get(e)??null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n.itemCount=this.itemCount,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,n){this.addNode(e);let r=n.getChildren(e.key);for(let o of r)this.addDescendants(o,n)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,r=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!r}filter(e){let n=new this.constructor,[r,o]=ws(this,n,this.firstKey,e);return n==null||n.commit(r,o),n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function ws(t,e,n,r){if(n==null)return[null,null];let o=null,l=null,i=t.getItem(n);for(;i!=null;){let s=i.filter(t,e,r);s!=null&&(s.nextKey=null,l&&(s.prevKey=l.key,l.nextKey=s.key),o==null&&(o=s),e.addNode(s),l=s),i=i.nextKey!=null?t.getItem(i.nextKey):null}if(l&&l.type==="separator"){let s=l.prevKey;e.removeNode(l.key),s!=null?(l=e.getItem(s),l.nextKey=null):l=null}return[(o==null?void 0:o.key)??null,(l==null?void 0:l.key)??null]}class Ss{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)==null?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}}function Ps(t){let{children:e,items:n,idScope:r,addIdAndValue:o,dependencies:l=[]}=t,i=a.useMemo(()=>{},[e]),s=a.useMemo(()=>new WeakMap,[...l,i]);return a.useMemo(()=>{if(n&&typeof e=="function"){let u=[];for(let c of n){let d=fp(c)?c:null,f=d?s.get(d):null;if(!f){f=e(c);let b=f.props.id??(c==null?void 0:c.key)??(c==null?void 0:c.id);r!=null&&f.props.id==null&&b!=null&&(b=r+":"+b);let p=b??u.length;f=a.cloneElement(f,o?{key:p,id:b,value:c}:{key:p}),d&&s.set(d,f)}u.push(f)}return u}else if(typeof e!="function")return e},[e,n,s,r,o])}function fp(t){switch(typeof t){case"object":return t!=null;case"function":case"symbol":return!0;default:return!1}}var Xn={exports:{}},Zn={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var al;function pp(){if(al)return Zn;al=1;var t=ku();function e(f,b){return f===b&&(f!==0||1/f===1/b)||f!==f&&b!==b}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,i=t.useDebugValue;function s(f,b){var p=b(),m=r({inst:{value:p,getSnapshot:b}}),v=m[0].inst,g=m[1];return l(function(){v.value=p,v.getSnapshot=b,u(v)&&g({inst:v})},[f,p,b]),o(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),i(p),p}function u(f){var b=f.getSnapshot;f=f.value;try{var p=b();return!n(f,p)}catch{return!0}}function c(f,b){return b()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Zn.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Zn}var ul;function bp(){return ul||(ul=1,Xn.exports=pp()),Xn.exports}var hp=bp();const Ts=a.createContext(!1),jt=a.createContext(null);function ks(t){if(a.useContext(jt))return t.content;let{collection:n,document:r}=yp(t.createCollection);return y.createElement(y.Fragment,null,y.createElement(Od,null,y.createElement(jt.Provider,{value:r},t.content)),y.createElement(mp,{render:t.children,collection:n}))}function mp({collection:t,render:e}){return e(t)}function gp(t,e,n){let r=et(),o=a.useRef(r);o.current=r;let l=a.useCallback(()=>o.current?n():e(),[e,n]);return hp.useSyncExternalStore(t,l)}const $p=typeof y.useSyncExternalStore=="function"?y.useSyncExternalStore:gp;function yp(t){let[e]=a.useState(()=>new dp((t==null?void 0:t())||new cp)),n=a.useCallback(i=>e.subscribe(i),[e]),r=a.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),o=a.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:$p(n,r,o),document:e}}const Pr=a.createContext(null);function vp(t){var n;return n=class extends yt{},n.type=t,n}function Ds(t,e,n,r,o,l){typeof t=="string"&&(t=vp(t));let i=a.useCallback(u=>{u==null||u.setProps(e,n,t,r,l)},[e,n,r,l,t]),s=a.useContext(Pr);if(s){let u=s.ownerDocument.nodesByProps.get(e);return u||(u=s.ownerDocument.createElement(t.type),u.setProps(e,n,t,r,l),s.appendChild(u),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,u)),o?y.createElement(Pr.Provider,{value:u},o):null}return y.createElement(t.type,{ref:i},o)}function Ms(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=a.forwardRef((o,l)=>{let i=a.useContext(br);if(!a.useContext(Ts)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,l)}return Ds(t,o,l,"children"in o?o.children:null,null,u=>y.createElement(br.Provider,{value:i},y.createElement(n,{node:u})))});return r.displayName=e.name,r}function xp(t,e,n=As){let r=({node:l})=>e(l.props,l.props.ref,l),o=a.forwardRef((l,i)=>{let s=n(l);return Ds(t,l,i,null,s,u=>y.createElement(r,{node:u}))??y.createElement(y.Fragment,null)});return o.displayName=e.name,o}function As(t){return Ps({...t,addIdAndValue:!0})}const cl=a.createContext(null);function Cp(t){let e=a.useContext(cl),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope??(e==null?void 0:e.idScope),o=As({...t,idScope:r,dependencies:n});return a.useContext(jt)&&(o=y.createElement(Ep,null,o)),e=a.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),y.createElement(cl.Provider,{value:e},o)}function Ep({children:t}){let e=a.useContext(jt),n=a.useMemo(()=>y.createElement(jt.Provider,{value:null},y.createElement(Ts.Provider,{value:!0},t)),[t]);return et()?y.createElement(Pr.Provider,{value:e},n):Lr.createPortal(n,e)}const wp=a.createContext(null),Sp={CollectionRoot({collection:t,renderDropIndicator:e}){return dl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return dl(t,e,n)}};function dl(t,e,n){return Ps({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){if(r.type==="content")return y.createElement(y.Fragment,null);let o=r.render(r);return!n||r.type!=="item"?o:y.createElement(y.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),o,Pp(t,r,n))}})}function Pp(t,e,n){let r=e.key,o=t.getKeyAfter(r),l=o!=null?t.getItem(o):null;for(;l!=null&&l.type!=="item";)o=t.getKeyAfter(l.key),l=o!=null?t.getItem(o):null;let i=e.nextKey!=null?t.getItem(e.nextKey):null;for(;i!=null&&i.type!=="item";)i=i.nextKey!=null?t.getItem(i.nextKey):null;let s=[];if(i==null){let u=e;for(;(u==null?void 0:u.type)==="item"&&(!l||u.parentKey!==l.parentKey&&l.level{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),ee(b.target).activeElement!==b.target&&Ke(b.target),o&&o({...b,type:"longpress"}),s.current=void 0},l),b.pointerType==="touch")){let p=v=>{v.preventDefault()},m=xe(b.target);u(b.target,"contextmenu",p,{once:!0}),u(m,"pointerup",()=>{setTimeout(()=>{c(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){s.current&&clearTimeout(s.current),r&&(b.pointerType==="mouse"||b.pointerType==="touch")&&r({...b,type:"longpressend"})}}),f=hc(o&&!e?i:void 0);return{longPressProps:J(d,f)}}function ha(t,e,n){let{type:r}=t,{isOpen:o}=e;a.useEffect(()=>{n&&n.current&&Ri.set(n.current,e.close)});let l;r==="menu"?l=!0:r==="listbox"&&(l="listbox");let i=ve();return{triggerProps:{"aria-haspopup":l,"aria-expanded":o,"aria-controls":o?i:void 0,onPress:e.toggle},overlayProps:{id:i}}}function Np(t){return t&&t.__esModule?t.default:t}function Op(t,e,n){let{type:r="menu",isDisabled:o,trigger:l="press"}=t,i=ve(),{triggerProps:s,overlayProps:u}=ha({type:r},e,n),c=p=>{if(!o&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},d=Yr(Np(pa),"@react-aria/menu"),{longPressProps:f}=ba({isDisabled:o||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!o&&(Ke(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!o&&(Ke(p.target),e.toggle())}};return delete s.onPress,{menuTriggerProps:{...s,...l==="press"?b:f,id:i,onKeyDown:c},menuProps:{...u,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}function Tr(t){return ln()?t.altKey:t.ctrlKey}function cn(t,e){var o,l;let n=`[data-key="${CSS.escape(String(e))}"]`,r=(o=t.current)==null?void 0:o.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),(l=t.current)==null?void 0:l.querySelector(n)}const ma=new WeakMap;function Vp(t){let e=ve();return ma.set(t,e),e}function _p(t){return ma.get(t)}const jp=1e3;function zp(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,o=a.useRef({search:"",timeout:void 0}).current,l=i=>{let s=Hp(i.key);if(!(!s||i.ctrlKey||i.metaKey||!te(i.currentTarget,j(i))||o.search.length===0&&s===" ")){if(s===" "&&o.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),o.search+=s,e.getKeyForSearch!=null){let u=e.getKeyForSearch(o.search,n.focusedKey);u==null&&(u=e.getKeyForSearch(o.search)),u!=null&&(n.setFocusedKey(u),r&&r(u))}clearTimeout(o.timeout),o.timeout=setTimeout(()=>{o.search=""},jp)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}function Hp(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function ga(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:l=!1,disallowEmptySelection:i=!1,disallowSelectAll:s=!1,escapeKeyBehavior:u="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:b=!1,scrollRef:p=r,linkBehavior:m="action"}=t,{direction:v}=$t(),g=zt(),x=h=>{var M,E,w,T,S,N,q,W,X,Q,le,Z,be,we;if(h.altKey&&h.key==="Tab"&&h.preventDefault(),!r.current||!te(r.current,j(h)))return;const C=(L,H)=>{if(L!=null){if(e.isLink(L)&&m==="selection"&&c&&!Tr(h)){Lr.flushSync(()=>{e.setFocusedKey(L,H)});let oe=cn(r,L),Se=e.getItemProps(L);oe&&g.open(oe,h,Se.href,Se.routerOptions);return}if(e.setFocusedKey(L,H),e.isLink(L)&&m==="override")return;h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&!Tr(h)&&e.replaceSelection(L)}};switch(h.key){case"ArrowDown":if(n.getKeyBelow){let L=e.focusedKey!=null?(M=n.getKeyBelow)==null?void 0:M.call(n,e.focusedKey):(E=n.getFirstKey)==null?void 0:E.call(n);L==null&&l&&(L=(w=n.getFirstKey)==null?void 0:w.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L))}break;case"ArrowUp":if(n.getKeyAbove){let L=e.focusedKey!=null?(T=n.getKeyAbove)==null?void 0:T.call(n,e.focusedKey):(S=n.getLastKey)==null?void 0:S.call(n);L==null&&l&&(L=(N=n.getLastKey)==null?void 0:N.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){let L=e.focusedKey!=null?(q=n.getKeyLeftOf)==null?void 0:q.call(n,e.focusedKey):(W=n.getFirstKey)==null?void 0:W.call(n);L==null&&l&&(L=v==="rtl"?(X=n.getFirstKey)==null?void 0:X.call(n,e.focusedKey):(Q=n.getLastKey)==null?void 0:Q.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L,v==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let L=e.focusedKey!=null?(le=n.getKeyRightOf)==null?void 0:le.call(n,e.focusedKey):(Z=n.getFirstKey)==null?void 0:Z.call(n);L==null&&l&&(L=v==="rtl"?(be=n.getLastKey)==null?void 0:be.call(n,e.focusedKey):(we=n.getFirstKey)==null?void 0:we.call(n,e.focusedKey)),L!=null&&(h.preventDefault(),C(L,v==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&h.shiftKey)return;h.preventDefault();let L=n.getFirstKey(e.focusedKey,ut(h));e.setFocusedKey(L),L!=null&&(ut(h)&&h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&h.shiftKey)return;h.preventDefault();let L=n.getLastKey(e.focusedKey,ut(h));e.setFocusedKey(L),L!=null&&(ut(h)&&h.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let L=n.getKeyPageBelow(e.focusedKey);L!=null&&(h.preventDefault(),C(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(h.preventDefault(),C(L))}break;case"a":ut(h)&&e.selectionMode==="multiple"&&s!==!0&&(h.preventDefault(),e.selectAll());break;case"Escape":u==="clearSelection"&&!i&&e.selectedKeys.size!==0&&(h.stopPropagation(),h.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if(h.shiftKey)r.current.focus();else{let L=Ve(r.current,{tabbable:!0}),H,oe;do oe=L.lastChild(),oe&&(H=oe);while(oe);let Se=re();H&&(!It(H)||Se&&!Ql(Se))&&Ke(H)}break}}},$=a.useRef({top:0,left:0});Tt(p,"scroll",()=>{var h,C;$.current={top:((h=p.current)==null?void 0:h.scrollTop)??0,left:((C=p.current)==null?void 0:C.scrollLeft)??0}});let D=h=>{var C,M;if(e.isFocused){te(h.currentTarget,j(h))||e.setFocused(!1);return}if(te(h.currentTarget,j(h))){if(e.setFocused(!0),e.focusedKey==null){let E=T=>{T!=null&&(e.setFocusedKey(T),c&&!e.isSelected(T)&&e.replaceSelection(T))},w=h.relatedTarget;w&&h.currentTarget.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?E(e.lastSelectedKey??((C=n.getLastKey)==null?void 0:C.call(n))):E(e.firstSelectedKey??((M=n.getFirstKey)==null?void 0:M.call(n)))}else p.current&&(p.current.scrollTop=$.current.top,p.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&p.current){let E=cn(r,e.focusedKey);E instanceof HTMLElement&&(!It(E)&&!f&&Ke(E),Ot()==="keyboard"&&Eo(E,{containingElement:r.current}))}}},P=h=>{te(h.currentTarget,h.relatedTarget)||e.setFocused(!1)},F=a.useRef(!1);Tt(r,Mu,f?h=>{let{detail:C}=h;h.stopPropagation(),e.setFocused(!0),(C==null?void 0:C.focusStrategy)==="first"&&(F.current=!0)}:void 0),Co(()=>{var h;if(F.current){let C=((h=n.getFirstKey)==null?void 0:h.call(n))??null;if(C==null){let M=re();Ls(r.current),Jr(M,null),e.collection.size>0&&(F.current=!1)}else e.setFocusedKey(C),F.current=!1}},[e.collection]),Co(()=>{e.collection.size>0&&(F.current=!1)},[e.focusedKey]),Tt(r,Du,f?h=>{var C;h.stopPropagation(),e.setFocused(!1),(C=h.detail)!=null&&C.clearFocusKey&&e.setFocusedKey(null)}:void 0);const R=a.useRef(o),I=a.useRef(!1);a.useEffect(()=>{var h,C;if(R.current){let M=null;o==="first"&&(M=((h=n.getFirstKey)==null?void 0:h.call(n))??null),o==="last"&&(M=((C=n.getLastKey)==null?void 0:C.call(n))??null);let E=e.selectedKeys;if(E.size){for(let w of E)if(e.canSelectItem(w)){M=w;break}}e.setFocused(!0),e.setFocusedKey(M),M==null&&!f&&r.current&&Ge(r.current),e.collection.size>0&&(R.current=!1,I.current=!0)}});let k=a.useRef(e.focusedKey),B=a.useRef(null);a.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==k.current||I.current)&&p.current&&r.current){let h=Ot(),C=cn(r,e.focusedKey);if(!(C instanceof HTMLElement))return;(h==="keyboard"||I.current)&&(B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame(()=>{p.current&&(sn(p.current,C),h!=="virtual"&&Eo(C,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&k.current!=null&&r.current&&Ge(r.current),k.current=e.focusedKey,I.current=!1}),a.useEffect(()=>()=>{B.current&&cancelAnimationFrame(B.current)},[]),Tt(r,"react-aria-focus-scope-restore",h=>{h.preventDefault(),e.setFocused(!0)});let K={onKeyDown:x,onFocus:D,onBlur:P,onMouseDown(h){p.current===j(h)&&h.preventDefault()}},{typeSelectProps:_}=zp({keyboardDelegate:n,selectionManager:e});d||(K=J(_,K));let U;f||(U=e.focusedKey==null?0:-1);let z=Vp(e.collection);return{collectionProps:J(K,{tabIndex:U,"data-collection":z})}}class pl{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?cn(this.ref,e):null;if(!r)return null;let o=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-o.left-n.clientLeft+n.scrollLeft,y:l.top-o.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class Qr{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new pl(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new pl(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,r;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((r=e.props)==null?void 0:r.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,r=!1){let o=e;for(;o!=null;){let l=this.collection.getItem(o);if((l==null?void 0:l.type)==="item"&&(r||!this.isDisabled(l)))return o;o=n(o)}return null}getNextKey(e,n){let r=e;return r=this.collection.getKeyAfter(r),this.findNextNonDisabled(r,o=>this.collection.getKeyAfter(o),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let r=e;return r=this.collection.getKeyBefore(r),this.findNextNonDisabled(r,o=>this.collection.getKeyBefore(o),n==null?void 0:n.includeDisabled)}findKey(e,n,r){let o=e,l=this.layoutDelegate.getItemRect(o);if(!l||o==null)return null;let i=l;do{if(o=n(o),o==null)break;l=this.layoutDelegate.getItemRect(o)}while(l&&r(i,l)&&o!=null);return o}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getNextKey(r,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getPreviousKey(r,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,r){return n?this.getPreviousKey(e,r):this.getNextKey(e,r)}getKeyRightOf(e,n){let r=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let r=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Je(n))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Je(n))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.x-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xo[0]l||new Qr({collection:n,disabledKeys:r,disabledBehavior:c,ref:o,collator:u,layoutDelegate:i,orientation:s}),[l,i,n,r,o,u,c,s]),{collectionProps:f}=ga({...t,ref:o,selectionManager:e,keyboardDelegate:d});return{listProps:f}}function Gp(t){let{id:e,selectionManager:n,key:r,ref:o,shouldSelectOnPressUp:l,shouldUseVirtualFocus:i,focus:s,isDisabled:u,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,b=zt();e=ve(e);let p=S=>{if(S.pointerType==="keyboard"&&Tr(S))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&o.current){let N=n.getItemProps(r);b.open(o.current,S,N.href,N.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):S&&S.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||S&&(ut(S)||S.pointerType==="touch"||S.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};a.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(i?Ls(o.current):s?s():re()!==o.current&&o.current&&Ge(o.current))},[o,r,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),u=u||n.isDisabled(r);let m={};!i&&!u?m={tabIndex:r===n.focusedKey?0:-1,onFocus(S){j(S)===o.current&&n.setFocusedKey(r)}}:u&&(m.onMouseDown=S=>{S.preventDefault()}),a.useEffect(()=>{u&&n.focusedKey===r&&n.setFocusedKey(null)},[n,u,r]);let v=n.isLink(r)&&f==="override",g=c&&t.UNSTABLE_itemBehavior==="action",x=n.isLink(r)&&f!=="selection"&&f!=="none",$=!u&&n.canSelectItem(r)&&!v&&!g,D=(c||x)&&!u,P=D&&(n.selectionBehavior==="replace"?!$:!$||n.isEmpty),F=D&&$&&n.selectionBehavior==="replace",R=P||F,I=a.useRef(null),k=R&&$,B=a.useRef(!1),K=a.useRef(!1),_=n.getItemProps(r),U=S=>{var N;c&&(c(),(N=o.current)==null||N.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),x&&o.current&&b.open(o.current,S,_.href,_.routerOptions)},z={ref:o};if(l?(z.onPressStart=S=>{I.current=S.pointerType,B.current=k,S.pointerType==="keyboard"&&(!R||hl(S.key))&&p(S)},d?(z.onPressUp=P?void 0:S=>{S.pointerType==="mouse"&&$&&p(S)},z.onPress=P?U:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&$&&p(S)}):z.onPress=S=>{if(P||F&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!bl(S.key))return;U(S)}else S.pointerType!=="keyboard"&&$&&p(S)}):(z.onPressStart=S=>{I.current=S.pointerType,B.current=k,K.current=P,$&&(S.pointerType==="mouse"&&!P||S.pointerType==="keyboard"&&(!D||hl(S.key)))&&p(S)},z.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&R&&bl(S.key)||S.pointerType==="mouse"&&K.current)&&(R?U(S):$&&p(S))}),m["data-collection"]=_p(n.collection),m["data-key"]=r,z.preventFocusOnPress=i,i&&(z=J(z,{onPressStart(S){S.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(S){S.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),_)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])_[S]&&(z[S]=tt(z[S],_[S]));let{pressProps:h,isPressed:C}=Wt(z),M=F?S=>{I.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),U(S))}:void 0,{longPressProps:E}=ba({isDisabled:!k,onLongPress(S){S.pointerType==="touch"&&(p(S),n.setSelectionBehavior("toggle"))}}),w=S=>{I.current==="touch"&&B.current&&S.preventDefault()},T=f!=="none"&&n.isLink(r)?S=>{_e.isOpening||S.preventDefault()}:void 0;return{itemProps:J(m,$||P||i&&!u?h:{},k?E:{},{onDoubleClick:M,onDragStartCapture:w,onClick:T,id:e},i?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:C,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:u,allowsSelection:$,hasAction:R}}function bl(t){return t==="Enter"}function hl(t){return t===" "}function $a(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}const ml=new WeakMap;function ya(t){let e=ml.get(t);if(e!=null)return e;let n=0,r=o=>{for(let l of o)l.type==="section"?r($a(l,t)):l.type==="item"&&n++};return r(t),ml.set(t,n),n}function Up(t){let e=Ln(t),[n,r]=a.useState(null),[o,l]=a.useState([]),i=()=>{l([]),e.close()};return{focusStrategy:n,...e,open(c=null){r(c),e.open()},toggle(c=null){r(c),e.toggle()},close(){i()},expandedKeysStack:o,openSubmenu:(c,d)=>{l(f=>d>f.length?f:[...f.slice(0,d),c])},closeSubmenu:(c,d)=>{l(f=>f[d]===c?f.slice(0,d):f)}}}function va(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function qp(t){return Yp(t)}function Yp(t,e){for(let n of t)return n}function Qn(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...gl(t,e),e],o=[...gl(t,n),n],l=r.slice(0,o.length).findIndex((i,s)=>i!==o[s]);return l!==-1?(e=r[l],n=o[l],e.index-n.index):r.findIndex(i=>i===n)>=0?1:(o.findIndex(i=>i===e)>=0,-1)}function gl(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}class Le extends Set{constructor(e,n,r){super(e),e instanceof Le?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}class to{constructor(e,n,r){this.collection=e,this.state=n,this.allowsCellSelection=(r==null?void 0:r.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null,this.fullCollection=(r==null?void 0:r.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Qn(this.collection,r,e)<0)&&(e=r)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Qn(this.collection,r,e)>0)&&(e=r)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Le([n],n,n);else{let o=this.state.selectedKeys,l=o.anchorKey??n;r=new Le(o,l,n);for(let i of this.getKeyRange(l,o.currentKey??n))r.delete(i);for(let i of this.getKeyRange(n,l))this.canSelectItem(i)&&r.add(i)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),o=this.collection.getItem(n);return r&&o?Qn(this.collection,r,o)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var l;if((l=this.layoutDelegate)!=null&&l.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let r=[],o=e;for(;o!=null;){let i=this.collection.getItem(o);if(i&&(i.type==="item"||i.type==="cell"&&this.allowsCellSelection)&&r.push(o),o===n)return r;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Le(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Le([n],n,n):new Le;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Le;for(let r of e){let o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],r=o=>{var l;for(;o!=null;){if(this.canSelectItemIn(o,e)){let i=e.getItem(o);(i==null?void 0:i.type)==="item"&&n.push(o),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&r(((l=qp(va(i,e)))==null?void 0:l.key)??null)}o=e.getKeyAfter(o)}};return r(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Le)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var o;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=n.getItem(e);return!(!r||(o=r==null?void 0:r.props)!=null&&o.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var r,o;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((r=n==null?void 0:n.props)!=null&&r.isDisabled))&&((o=n==null?void 0:n.props)==null?void 0:o.disabledBehavior)!=="selection"}isLink(e){var n,r;return!!((r=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&r.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new to(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Xp{build(e,n){return this.context=n,$l(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(y.isValidElement(n)&&n.type===y.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let o=0;for(let l of r)yield*this.getFullNode({value:l,index:o},{renderer:n}),o++}else{let o=[];y.Children.forEach(n,i=>{i&&o.push(i)});let l=0;for(let i of o){let s=this.getFullNode({element:i,index:l},{});for(let u of s)l++,yield u}}}getKey(e,n,r,o){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${o}${n.key}`;let l=n.value;if(l!=null){let i=l.key??l.id;if(i==null)throw new Error("No key found for item");return i}return o?`${o}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,o){if(y.isValidElement(e.element)&&e.element.type===y.Fragment){let u=[];y.Children.forEach(e.element.props.children,d=>{u.push(d)});let c=e.index??0;for(const d of u)yield*this.getFullNode({element:d,index:c++},n,r,o);return}let l=e.element;if(!l&&e.value&&n&&n.renderer){let u=this.cache.get(e.value);if(u&&(!u.shouldInvalidate||!u.shouldInvalidate(this.context))){u.index=e.index,u.parentKey=o?o.key:null,yield u;return}l=n.renderer(e.value)}if(y.isValidElement(l)){let u=l.type;if(typeof u!="function"&&typeof u.getCollectionNode!="function"){let b=l.type;throw new Error(`Unknown element <${b}> in collection.`)}let c=u.getCollectionNode(l.props,this.context),d=e.index??0,f=c.next();for(;!f.done&&f.value;){let b=f.value;e.index=d;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(l,e,n,r));let v=[...this.getFullNode({...b,key:p,index:d,wrapper:Zp(e.wrapper,b.wrapper)},this.getChildState(n,b),r?`${r}${l.key}`:l.key,o)];for(let g of v){if(g.value=b.value??e.value??null,g.value&&this.cache.set(g.value,g),e.type&&g.type!==e.type)throw new Error(`Unsupported type <${er(g.type)}> in <${er((o==null?void 0:o.type)??"unknown parent type")}>. Only <${er(e.type)}> is supported.`);d++,yield g}f=c.next(v)}return}if(e.key==null||e.type==null)return;let i=this,s={type:e.type,props:e.props,key:e.key,parentKey:o?o.key:null,value:e.value??null,level:((o==null?void 0:o.level)??0)+((o==null?void 0:o.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:$l(function*(){if(!e.hasChildNodes||!e.childNodes)return;let u=0;for(let c of e.childNodes()){c.key!=null&&(c.key=`${s.key}${c.key}`);let d=i.getFullNode({...c,index:u},i.getChildState(n,c),s.key,s);for(let f of d)u++,yield f}})};yield s}constructor(){this.cache=new WeakMap}}function $l(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function Zp(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function er(t){return t[0].toUpperCase()+t.slice(1)}function Jp(t,e,n){let r=a.useMemo(()=>new Xp,[]),{children:o,items:l,collection:i}=t;return a.useMemo(()=>{if(i)return i;let u=r.build({children:o,items:l},n);return e(u)},[r,o,l,i,n,e])}function Qp(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function eb(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:l="all"}=t,i=a.useRef(!1),[,s]=a.useState(!1),u=a.useRef(null),c=a.useRef(null),[,d]=a.useState(null),f=a.useMemo(()=>yl(t.selectedKeys),[t.selectedKeys]),b=a.useMemo(()=>yl(t.defaultSelectedKeys,new Le),[t.defaultSelectedKeys]),[p,m]=$n(f,b,t.onSelectionChange),v=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[g,x]=a.useState(o);o==="replace"&&g==="toggle"&&typeof p=="object"&&p.size===0&&x("replace");let $=a.useRef(o);return a.useEffect(()=>{o!==$.current&&(x(o),$.current=o)},[o]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:g,setSelectionBehavior:x,get isFocused(){return i.current},setFocused(D){i.current=D,s(D)},get focusedKey(){return u.current},get childFocusStrategy(){return c.current},setFocusedKey(D,P="first"){u.current=D,c.current=P,d(D)},selectedKeys:p,setSelectedKeys(D){(r||!Qp(D,p))&&m(D)},disabledKeys:v,disabledBehavior:l}}function yl(t,e){return t?t==="all"?"all":new Le(t):e}const tb=a.createContext(null),uo=class uo extends yt{filter(e,n,r){let o=e.getItem(this.firstChildKey);if(o&&r(o.textValue,this)){let l=this.clone();return n.addDescendants(l,e),l}return null}};uo.type="submenutrigger";let vl=uo;function nb(t,e){let{role:n="dialog"}=t,r=Ft();r=t["aria-label"]?void 0:r;let o=a.useRef(!1);return a.useEffect(()=>{if(e.current&&!It(e.current)){Ge(e.current);let l=setTimeout(()=>{(re()===e.current||re()===document.body)&&(o.current=!0,e.current&&(e.current.blur(),Ge(e.current)),o.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),Cs(),a.useRef(!1),a.useEffect(()=>{}),{dialogProps:{...pe(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{o.current&&l.stopPropagation()}},titleProps:{id:r}}}const xa=a.createContext(null),lt=a.createContext(null);function rb(t){let e=Up(t),n=a.useRef(null),{triggerProps:r,overlayProps:o}=ha({type:"dialog"},e,n);return r.id=ve(),o["aria-labelledby"]=r.id,y.createElement(rt,{values:[[lt,e],[tb,e],[xa,o],[Xr,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":o["aria-labelledby"]}]]},y.createElement(op,{...r,ref:n,isPressed:e.isOpen},t.children))}const ob=a.forwardRef(function(e,n){let r=e["aria-labelledby"];[e,n]=Ce(e,n,xa);let{dialogProps:o,titleProps:l}=nb({...e,"aria-labelledby":r},n),i=a.useContext(lt);!o["aria-label"]&&!o["aria-labelledby"]&&e["aria-labelledby"]&&(o["aria-labelledby"]=e["aria-labelledby"]);let s=Ee({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(i==null?void 0:i.close)||(()=>{})}}),u=pe(e,{global:!0});return y.createElement(fe.section,{...J(u,s,o),render:e.render,ref:n,slot:e.slot||void 0},y.createElement(rt,{values:[[Mi,{slots:{[bn]:{},title:{...l,level:2}}}],[Dn,{slots:{[bn]:{},close:{onPress:()=>i==null?void 0:i.close()}}}]]},s.children))});function lb(t,e,n){let{overlayProps:r,underlayProps:o}=Ni({...t,isOpen:e.isOpen,onClose:e.close},n);return Oi({isDisabled:!e.isOpen}),Cs(),a.useEffect(()=>{if(e.isOpen&&n.current)return Ur([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:J(r),underlayProps:o}}const ib=a.createContext(null),no=a.createContext(null),sb=a.forwardRef(function(e,n){if(a.useContext(no))return y.createElement(xl,{...e,modalRef:n},e.children);let{isDismissable:o,isKeyboardDismissDisabled:l,isOpen:i,defaultOpen:s,onOpenChange:u,children:c,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...m}=e;return y.createElement(Ca,{isDismissable:o,isKeyboardDismissDisabled:l,isOpen:i,defaultOpen:s,onOpenChange:u,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},y.createElement(xl,{...m,modalRef:n},c))});function ab(t,e){[t,e]=Ce(t,e,ib);let n=a.useContext(lt),r=Ln(t),o=t.isOpen!=null||t.defaultOpen!=null||!n?r:n,l=nt(e),i=a.useRef(null),s=or(l,o.isOpen),u=or(i,o.isOpen),c=s||u||t.isExiting||!1,d=et();return!o.isOpen&&!c||d?null:y.createElement(ub,{...t,state:o,isExiting:c,overlayRef:l,modalRef:i})}const Ca=a.forwardRef(ab);function ub({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:r}=e,{modalProps:o,underlayProps:l}=lb(e,r,n),i=Br(e.overlayRef)||e.isEntering||!1,s=Ee({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:i,isExiting:e.isExiting,state:r}}),u=pc(),c,d;if(typeof document<"u"){let b=Je(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,m=b.getBoundingClientRect().height%1;c=b.scrollWidth-p,d=b.scrollHeight-m}let f={...s.style,"--visual-viewport-width":u.width+"px","--visual-viewport-height":u.height+"px","--page-width":c!==void 0?c+"px":void 0,"--page-height":d!==void 0?d+"px":void 0};return y.createElement(Cr,{isExiting:e.isExiting,portalContainer:t},y.createElement(fe.div,{...J(pe(e,{global:!0}),l),...s,style:f,ref:e.overlayRef,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},y.createElement(rt,{values:[[no,{modalProps:o,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[lt,r]]},s.children)))}function xl(t){let{modalProps:e,modalRef:n,isExiting:r,isDismissable:o}=a.useContext(no),l=a.useContext(lt),i=a.useMemo(()=>ht(t.modalRef,n),[t.modalRef,n]),s=nt(i),u=Br(s),c=Ee({...t,defaultClassName:"react-aria-Modal",values:{isEntering:u,isExiting:r,state:l}});return y.createElement(fe.div,{...J(pe(t,{global:!0}),e),...c,ref:s,"data-entering":u||void 0,"data-exiting":r||void 0},o&&y.createElement(xr,{onDismiss:l.close}),c.children)}const cb=y.forwardRef(({children:t,...e},n)=>{n=nt(n);let{pressProps:r}=Wt({...e,ref:n}),{focusableProps:o}=Pn(e,n),l=y.Children.only(t);a.useEffect(()=>{},[n,e.isDisabled]);let i=parseInt(y.version,10)<19?l.ref:l.props.ref;return y.cloneElement(l,{...J(r,o,l.props),ref:ht(i,n)})}),Cl=({children:t,className:e,slot:n,style:r,variant:o,...l})=>{const i=a.useMemo(()=>Pd({variant:o}),[o]);return A.jsx(Gr,{"aria-label":"Close",className:Te(e,i),"data-slot":"close-button",slot:n,style:r,...l,children:s=>typeof t=="function"?t(s):t??A.jsx($f,{"data-slot":"close-button-icon"})})},db=Object.assign(Cl,{Root:Cl}),Me=a.createContext({}),El=({children:t,...e})=>{const n=a.useMemo(()=>({slots:En(),placement:void 0}),[]);return A.jsx(Me,{value:n,children:A.jsx(rb,{"data-slot":"alert-dialog-root",...e,children:t})})},fb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx(cb,{children:A.jsx("div",{className:he(r==null?void 0:r.trigger,e),"data-slot":"alert-dialog-trigger",role:"button",...n,children:t})})},pb=({children:t,className:e,isDismissable:n=!1,isKeyboardDismissDisabled:r=!0,onClick:o,variant:l,...i})=>{const{slots:s}=a.useContext(Me),u=a.useMemo(()=>En({variant:l}),[l]),c=a.useMemo(()=>({slots:{...s,...u}}),[s,u]);return A.jsx(Ca,{className:Te(e,u==null?void 0:u.backdrop()),"data-slot":"alert-dialog-backdrop",isDismissable:n,isKeyboardDismissDisabled:r,onClick:d=>{d.stopPropagation(),o==null||o(d)},...i,children:d=>A.jsxs(Me,{value:c,children:[typeof t=="function"?t(d):t," "]})})},bb=({children:t,className:e,placement:n="auto",size:r,...o})=>{const{slots:l}=a.useContext(Me),i=a.useMemo(()=>En({size:r}),[r]),s=a.useMemo(()=>({placement:n,slots:{...l,...i}}),[n,l,i]);return A.jsx(sb,{className:Te(e,i==null?void 0:i.container()),"data-placement":n,"data-slot":"alert-dialog-container",...o,children:u=>A.jsx(Me,{value:s,children:typeof t=="function"?t(u):t})})},hb=({children:t,className:e,...n})=>{const{placement:r,slots:o}=a.useContext(Me);return A.jsx(ob,{className:he(o==null?void 0:o.dialog,e),"data-placement":r,"data-slot":"alert-dialog-dialog",role:"alertdialog",...n,children:t})},mb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.header,e),"data-slot":"alert-dialog-header",...n,children:t})},gb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx(hf,{className:he(r==null?void 0:r.heading,e),"data-slot":"alert-dialog-heading",slot:"title",...n,children:t})},$b=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.body,e),"data-slot":"alert-dialog-body",...n,children:t})},yb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Me);return A.jsx("div",{className:he(r==null?void 0:r.footer,e),"data-slot":"alert-dialog-footer",...n,children:t})},vb=({children:t,className:e,status:n="danger",...r})=>{const o=a.useMemo(()=>En({status:n}),[n]),l=()=>{switch(n){case"default":return A.jsx(_o,{"data-slot":"alert-dialog-default-icon"});case"accent":return A.jsx(_o,{"data-slot":"alert-dialog-default-icon"});case"success":return A.jsx(vf,{"data-slot":"alert-dialog-default-icon"});case"warning":return A.jsx(yf,{"data-slot":"alert-dialog-default-icon"});case"danger":return A.jsx(jo,{"data-slot":"alert-dialog-default-icon"});default:return A.jsx(jo,{"data-slot":"alert-dialog-default-icon"})}};return A.jsx(Ae.div,{className:o==null?void 0:o.icon({className:e}),"data-slot":"alert-dialog-icon",...r,children:t??l()})},xb=({className:t,...e})=>{const{slots:n}=a.useContext(Me);return A.jsx(db,{className:Te(t,n==null?void 0:n.closeTrigger()),"data-slot":"alert-dialog-close-trigger",slot:"close",...e})},Fh=Object.assign(El,{Root:El,Trigger:fb,Backdrop:pb,Container:bb,Dialog:hb,Header:mb,Heading:gb,Body:$b,Footer:yb,Icon:vb,CloseTrigger:xb});function Cb(t){let e=eo({usage:"search",...t}),n=a.useCallback((l,i)=>i.length===0?!0:(l=l.normalize("NFC"),i=i.normalize("NFC"),e.compare(l.slice(0,i.length),i)===0),[e]),r=a.useCallback((l,i)=>i.length===0?!0:(l=l.normalize("NFC"),i=i.normalize("NFC"),e.compare(l.slice(-i.length),i)===0),[e]),o=a.useCallback((l,i)=>{if(i.length===0)return!0;l=l.normalize("NFC"),i=i.normalize("NFC");let s=0,u=i.length;for(;s+u<=l.length;s++){let c=l.slice(s,s+u);if(e.compare(i,c)===0)return!0}return!1},[e]);return a.useMemo(()=>({startsWith:n,endsWith:r,contains:o}),[n,r,o])}const ro=a.createContext({}),Ea=a.createContext(null),wa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Sa={...wa,customError:!0,valid:!1},wt={isInvalid:!1,validationDetails:wa,validationErrors:[]},Eb=a.createContext({}),wl="__reactAriaFormValidationState";function wb(t){if(t[wl]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}=t[wl];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}}return Sb(t)}function Sb(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:l,validate:i,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let u=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Sa}:null,c=a.useMemo(()=>{if(!i||o==null)return null;let K=Pb(i,o);return Sl(K)},[i,o]);l!=null&&l.validationDetails.valid&&(l=void 0);let d=a.useContext(Eb),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(K=>kr(d[K])):kr(d[r]):[],[d,r]),[b,p]=a.useState(d),[m,v]=a.useState(!1);d!==b&&(p(d),v(!1));let g=a.useMemo(()=>Sl(m?[]:f),[m,f]),x=a.useRef(wt),[$,D]=a.useState(wt),P=a.useRef(wt),F=()=>{if(!R)return;I(!1);let K=c||l||x.current;tr(K,P.current)||(P.current=K,D(K))},[R,I]=a.useState(!1);return a.useEffect(F),{realtimeValidation:u||g||c||l||wt,displayValidation:s==="native"?u||g||$:u||g||c||l||$,updateValidation(K){s==="aria"&&!tr($,K)?D(K):x.current=K},resetValidation(){let K=wt;tr(K,P.current)||(P.current=K,D(K)),s==="native"&&I(!1),v(!0)},commitValidation(){s==="native"&&I(!0),v(!0)}}}function kr(t){return t?Array.isArray(t)?t:[t]:[]}function Pb(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return kr(n)}return[]}function Sl(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Sa}:null}function tr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}const Pa=a.createContext(null),Kn=a.createContext({}),Ta=a.createContext(null),Tb=a.forwardRef(function(e,n){let{render:r}=a.useContext(Ta);return y.createElement(y.Fragment,null,r(e,n))});function ka(t,e){var l;let n=t==null?void 0:t.renderDropIndicator,r=(l=t==null?void 0:t.isVirtualDragging)==null?void 0:l.call(t),o=a.useCallback(i=>{if(r||e!=null&&e.isDropTarget(i))return n?n(i):y.createElement(Tb,{target:i})},[e==null?void 0:e.target,r,n]);return t!=null&&t.useDropIndicator?o:void 0}function kb(t,e,n){var l,i,s;let r=t.focusedKey,o=null;if((l=e==null?void 0:e.isVirtualDragging)!=null&&l.call(e)&&((i=n==null?void 0:n.target)==null?void 0:i.type)==="item"&&(o=n.target.key,n.target.dropPosition==="after")){let u=n.collection.getKeyAfter(o),c=null;if(u!=null){let d=((s=n.collection.getItem(o))==null?void 0:s.level)??0;for(;u!=null;){let f=n.collection.getItem(u);if(!f)break;if(f.type!=="item"){u=n.collection.getKeyAfter(u);continue}if((f.level??0)<=d)break;c=u,u=n.collection.getKeyAfter(u)}}o=u??c??o}return a.useMemo(()=>new Set([r,o].filter(u=>u!=null)),[r,o])}const Rn=new WeakMap;function Db(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function Da(t,e){let n=Rn.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${Db(e)}`}function Mb(t,e,n){let r=pe(t,{labelable:!0}),o=t.selectionBehavior||"toggle",l=t.orientation||"vertical",i=t.linkBehavior||(o==="replace"?"action":"override");o==="toggle"&&i==="action"&&(i="override");let{listProps:s}=Wp({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:u}=Tn({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),c=ve(t.id);Rn.set(e,{id:c,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:i,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:d,fieldProps:f}=$i({...t,id:c,labelElementType:"span"});return{labelProps:d,listBoxProps:J(r,u,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":l,...J(f,s)})}}function Ab(t,e,n){var B,K;let{key:r}=t,o=Rn.get(e),l=t.isDisabled??e.selectionManager.isDisabled(r),i=t.isSelected??e.selectionManager.isSelected(r),s=t.shouldSelectOnPressUp??(o==null?void 0:o.shouldSelectOnPressUp),u=t.shouldFocusOnHover??(o==null?void 0:o.shouldFocusOnHover),c=t.shouldUseVirtualFocus??(o==null?void 0:o.shouldUseVirtualFocus),d=t.isVirtualized??(o==null?void 0:o.isVirtualized),f=Ft(),b=Ft(),p={role:"option","aria-disabled":l||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":t["aria-label"],"aria-labelledby":f,"aria-describedby":b},m=e.collection.getItem(r);if(d){let _=Number(m==null?void 0:m.index);p["aria-posinset"]=Number.isNaN(_)?void 0:_+1,p["aria-setsize"]=ya(e.collection)}let v=o!=null&&o.onAction?()=>{var _;return(_=o==null?void 0:o.onAction)==null?void 0:_.call(o,r)}:void 0,g=Da(e,r),{itemProps:x,isPressed:$,isFocused:D,hasAction:P,allowsSelection:F}=Gp({selectionManager:e.selectionManager,key:r,ref:n,shouldSelectOnPressUp:s,allowsDifferentPressOrigin:s&&u,isVirtualized:d,shouldUseVirtualFocus:c,isDisabled:l,onAction:v||(B=m==null?void 0:m.props)!=null&&B.onAction?tt((K=m==null?void 0:m.props)==null?void 0:K.onAction,v):void 0,linkBehavior:o==null?void 0:o.linkBehavior,UNSTABLE_itemBehavior:o==null?void 0:o.UNSTABLE_itemBehavior,id:g}),{hoverProps:R}=Gt({isDisabled:l||!u,onHoverStart(){Nt()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(r))}}),I=pe(m==null?void 0:m.props);delete I.id;let k=zl(m==null?void 0:m.props);return{optionProps:{...p,...J(I,x,R,k),id:g},labelProps:{id:f},descriptionProps:{id:b},isFocused:D,isFocusVisible:D&&e.selectionManager.isFocused&&Nt(),isSelected:i,isDisabled:l,isPressed:$,allowsSelection:F,hasAction:P}}function Lb(t){let{heading:e,"aria-label":n}=t,r=ve();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation",onMouseDown:o=>{o.preventDefault()}}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}class Dr{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let s of i.childNodes)n(s)};for(let i of e)n(i);let r=null,o=0,l=0;for(let[i,s]of this.keyMap)r?(r.nextKey=i,s.prevKey=r.key):(this.firstKey=i,s.prevKey=void 0),s.type==="item"&&(s.index=o++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l,this.lastKey=(r==null?void 0:r.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}function Ma(t){let{filter:e,layoutDelegate:n}=t,r=eb(t),o=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=a.useCallback(c=>e?new Dr(e(c)):new Dr(c),[e]),i=a.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),s=Jp(t,l,i),u=a.useMemo(()=>new to(s,r,{layoutDelegate:n}),[s,r,n]);return Aa(s,u),{collection:s,disabledKeys:o,selectionManager:u}}function Kb(t,e){let n=a.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),r=t.selectionManager.withCollection(n);return Aa(n,r),{collection:n,selectionManager:r,disabledKeys:t.disabledKeys}}function Aa(t,e){const n=a.useRef(null);a.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){let r=n.current.getKeyAfter(e.focusedKey),o=null;for(;r!=null;){let l=t.getItem(r);if(l&&l.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyAfter(r)}if(o==null)for(r=n.current.getKeyBefore(e.focusedKey);r!=null;){let l=t.getItem(r);if(l&&l.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyBefore(r)}e.setFocusedKey(o)}n.current=t},[t,e])}const Fn=a.createContext(null),vt=a.createContext(null),Rb=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Fn);let r=a.useContext(vt);return r?y.createElement(La,{state:r,props:e,listBoxRef:n}):y.createElement(ks,{content:y.createElement(Cp,e)},o=>y.createElement(Fb,{props:e,listBoxRef:n,collection:o}))});function Fb({props:t,listBoxRef:e,collection:n}){t={...t,collection:n,children:null,items:null};let{layoutDelegate:r}=a.useContext(Zr),o=Ma({...t,layoutDelegate:r});return y.createElement(La,{state:o,props:t,listBoxRef:e})}function La({state:t,props:e,listBoxRef:n}){[e,n]=Ce(e,n,Dp);let{dragAndDropHooks:r,layout:o="stack",orientation:l="vertical",filter:i}=e,s=Kb(t,i),{collection:u,selectionManager:c}=s,d=!!(r!=null&&r.useDraggableCollectionState),f=!!(r!=null&&r.useDroppableCollectionState),{direction:b}=$t(),{disabledBehavior:p,disabledKeys:m}=c,v=eo({usage:"search",sensitivity:"base"}),{isVirtualized:g,layoutDelegate:x,dropTargetDelegate:$,CollectionRoot:D}=a.useContext(Zr),P=a.useMemo(()=>e.keyboardDelegate||new Qr({collection:u,collator:v,ref:n,disabledKeys:m,disabledBehavior:p,layout:o,orientation:l,direction:b,layoutDelegate:x}),[u,v,n,p,m,l,b,e.keyboardDelegate,o,x]),{listBoxProps:F}=Mb({...e,shouldSelectOnPressUp:d||e.shouldSelectOnPressUp,keyboardDelegate:P,isVirtualized:g},s,n);a.useRef(d),a.useRef(f),a.useEffect(()=>{},[d,f]);let R,I,k,B=!1,K=null,_=a.useRef(null);if(d&&r){R=r.useDraggableCollectionState({collection:u,selectionManager:c,preview:r.renderDragPreview?_:void 0}),r.useDraggableCollection({},R,n);let S=r.DragPreview;K=r.renderDragPreview?y.createElement(S,{ref:_},r.renderDragPreview):null}if(f&&r){I=r.useDroppableCollectionState({collection:u,selectionManager:c});let S=r.dropTargetDelegate||$||new r.ListDropTargetDelegate(u,n,{orientation:l,layout:o,direction:b});k=r.useDroppableCollection({keyboardDelegate:P,dropTargetDelegate:S},I,n),B=I.isDropTarget({type:"root"})}let{focusProps:U,isFocused:z,isFocusVisible:h}=kn(),C=s.collection.size===0,M={isDropTarget:B,isEmpty:C,isFocused:z,isFocusVisible:h,layout:e.layout||"stack",orientation:l,state:s},E=Ee({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:M}),w=null;C&&e.renderEmptyState&&(w=y.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(M)));let T=pe(e,{global:!0});return y.createElement(Fi,null,y.createElement(fe.div,{...J(T,E,F,U,k==null?void 0:k.collectionProps),ref:n,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":B||void 0,"data-empty":C||void 0,"data-focused":z||void 0,"data-focus-visible":h||void 0,"data-layout":e.layout||"stack","data-orientation":l},y.createElement(rt,{values:[[Fn,e],[vt,s],[Kn,{dragAndDropHooks:r,dragState:R,dropState:I}],[Fp,{elementType:"div"}],[Ta,{render:Nb}],[wp,{name:"ListBoxSection",render:Ka}]]},y.createElement(Kp,null,y.createElement(D,{collection:u,scrollRef:n,persistedKeys:kb(c,r,I),renderDropIndicator:ka(r,I)}))),w,K))}function Ka(t,e,n,r="react-aria-ListBoxSection"){let o=a.useContext(vt),{dragAndDropHooks:l,dropState:i}=a.useContext(Kn),{CollectionBranch:s}=a.useContext(Zr),[u,c]=jr(),{headingProps:d,groupProps:f}=Lb({heading:c,"aria-label":t["aria-label"]??void 0}),b=Ee({...t,id:void 0,children:void 0,defaultClassName:r,values:void 0}),p=pe(t,{global:!0});return delete p.id,y.createElement(fe.section,{...J(p,b,f),ref:e},y.createElement(Ap.Provider,{value:{...d,ref:u}},y.createElement(s,{collection:o.collection,parent:n,renderDropIndicator:ka(l,i)})))}const Ib=xp(Sr,Ka),Bb=Ms(wr,function(e,n,r){let o=nt(n),l=a.useContext(vt),{dragAndDropHooks:i,dragState:s,dropState:u}=a.useContext(Kn),c=s&&!(s.isDisabled||s.selectionManager.isDisabled(r.key)),{optionProps:d,labelProps:f,descriptionProps:b,...p}=Ab({key:r.key,"aria-label":e==null?void 0:e["aria-label"]},l,o),{hoverProps:m,isHovered:v}=Gt({isDisabled:!p.allowsSelection&&!p.hasAction&&!c,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{keyboardProps:g}=ki(e),{focusProps:x}=Hr(e),$=null;s&&i&&($=i.useDraggableItem({key:r.key,hasAction:p.hasAction},s));let D=null;u&&i&&(D=i.useDroppableItem({target:{type:"item",key:r.key,dropPosition:"on"}},u,o));let P=s&&s.isDragging(r.key),F=Ee({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...p,isHovered:v,selectionMode:l.selectionManager.selectionMode,selectionBehavior:l.selectionManager.selectionBehavior,allowsDragging:!!s,isDragging:P,isDropTarget:D==null?void 0:D.isDropTarget}});a.useEffect(()=>{r.textValue},[r.textValue]);let R=e.href?fe.a:fe.div,I=pe(e,{global:!0});return delete I.id,delete I.onClick,e.href&&d.tabIndex==null&&(d.tabIndex=-1),y.createElement(R,{...J(I,F,d,m,g,x,$==null?void 0:$.dragProps,D==null?void 0:D.dropProps),ref:o,"data-allows-dragging":!!s||void 0,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":P||void 0,"data-drop-target":(D==null?void 0:D.isDropTarget)||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode},y.createElement(rt,{values:[[Ut,{slots:{[bn]:f,label:f,description:b}}],[Rp,{isSelected:p.isSelected}]]},F.children))});function Nb(t,e){e=nt(e);let{dragAndDropHooks:n,dropState:r}=a.useContext(Kn),{dropIndicatorProps:o,isHidden:l,isDropTarget:i}=n.useDropIndicator(t,r,e);return l?null:y.createElement(Vb,{...t,dropIndicatorProps:o,isDropTarget:i,ref:e})}function Ob(t,e){let{dropIndicatorProps:n,isDropTarget:r,...o}=t,l=Ee({...o,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:r}});return y.createElement(y.Fragment,null,y.createElement(fe.div,{...n,...l,role:"option",ref:e,"data-drop-target":r||void 0}))}const Vb=a.forwardRef(Ob);Ms(Er,function(e,n,r){let o=a.useContext(vt),{isLoading:l,onLoadMore:i,scrollOffset:s,...u}=e,c=a.useRef(null),d=a.useMemo(()=>({onLoadMore:i,collection:o==null?void 0:o.collection,sentinelRef:c,scrollOffset:s}),[i,s,o==null?void 0:o.collection]);gc(d,c);let f=Ee({...u,id:void 0,children:r.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),b={tabIndex:-1};return y.createElement(y.Fragment,null,y.createElement("div",{style:{position:"relative",width:0,height:0},inert:$c(!0)},y.createElement("div",{"data-testid":"loadMoreSentinel",ref:c,style:{position:"absolute",height:1,width:1}})),l&&f.children&&y.createElement(y.Fragment,null,y.createElement(fe.div,{...J(pe(e,{global:!0}),b),...f,role:"option",ref:n},f.children)))});function _b(t){let{description:e,errorMessage:n,isInvalid:r,validationState:o}=t,{labelProps:l,fieldProps:i}=$i(t),s=Ft([!!e,!!n,r,o]),u=Ft([!!e,!!n,r,o]);return i=J(i,{"aria-describedby":[s,u,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:l,fieldProps:i,descriptionProps:{id:s},errorMessageProps:{id:u}}}function jb(t,e,n){let{validationBehavior:r,focus:o}=t;ne(()=>{if(r==="native"&&(n!=null&&n.current)&&!n.current.disabled){let c=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(c),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(Hb(n.current))}});let l=a.useRef(!1),i=Pe(()=>{l.current||e.resetValidation()}),s=Pe(c=>{var f,b;e.displayValidation.isInvalid||e.commitValidation();let d=(f=n==null?void 0:n.current)==null?void 0:f.form;!c.defaultPrevented&&n&&d&&Wb(d)===n.current&&(o?o():(b=n.current)==null||b.focus(),Qd("keyboard")),c.preventDefault()}),u=Pe(()=>{e.commitValidation()});a.useEffect(()=>{let c=n==null?void 0:n.current;if(!c)return;let d=c.form,f=d==null?void 0:d.reset;return d&&(d.reset=()=>{l.current=!window.event||window.event.type==="message"&&j(window.event)instanceof MessagePort,f==null||f.call(d),l.current=!1}),c.addEventListener("invalid",s),c.addEventListener("change",u),d==null||d.addEventListener("reset",i),()=>{c.removeEventListener("invalid",s),c.removeEventListener("change",u),d==null||d.removeEventListener("reset",i),d&&(d.reset=f)}},[n,r])}function zb(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function Hb(t){return{isInvalid:!t.validity.valid,validationDetails:zb(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function Wb(t){var e;for(let n=0;n{var $;($=f.onClick)==null||$.call(f,x),Vu(x,v,t.href,t.routerOptions)}})}}const Ub=a.createContext(null),qb=a.forwardRef(function(e,n){[e,n]=Ce(e,n,Ub);let r=e.href&&!e.isDisabled?"a":"span",{linkProps:o,isPressed:l}=Gb({...e,elementType:r},n),i=fe[r],{hoverProps:s,isHovered:u}=Gt(e),{focusProps:c,isFocused:d,isFocusVisible:f}=kn(),b=Ee({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:l,isHovered:u,isFocused:d,isFocusVisible:f}}),p=pe(e,{global:!0});return delete p.onClick,y.createElement(i,{ref:n,slot:e.slot||void 0,...J(p,b,o,s,c),"data-focused":d||void 0,"data-hovered":u||void 0,"data-pressed":l||void 0,"data-focus-visible":f||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),Ra=a.createContext({}),Pl=({children:t,className:e,...n})=>{const r=y.useMemo(()=>Ad(),[]);return A.jsx(Ra,{value:{slots:r},children:A.jsx(qb,{...n,className:Te(e,r==null?void 0:r.base()),children:o=>A.jsx(A.Fragment,{children:typeof t=="function"?t(o):t})})})},Yb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ra);return A.jsx(Ae.span,{className:he(r==null?void 0:r.icon,e),"data-default-icon":Ai(!t),"data-slot":"link-icon",...n,children:t??A.jsx(gf,{"data-slot":"link-default-icon"})})},Ih=Object.assign(Pl,{Root:Pl,Icon:Yb}),Xb=a.createContext({}),Zb="__button_group_child",Tl=({children:t,className:e,fullWidth:n,isDisabled:r,isIconOnly:o,size:l,slot:i,style:s,variant:u,[Zb]:c,...d})=>{const f=a.useContext(Xb),b=c===!0,p=l??(b?f==null?void 0:f.size:void 0),m=u??(b?f==null?void 0:f.variant:void 0),v=r??(b?f==null?void 0:f.isDisabled:void 0),g=n??(b?f==null?void 0:f.fullWidth:void 0),x=Ed({fullWidth:g,isIconOnly:o,size:p,variant:m});return A.jsx(Gr,{className:Te(e,x),"data-slot":"button",isDisabled:v,slot:i,style:s,...d,children:$=>typeof t=="function"?t($):t})},Bh=Object.assign(Tl,{Root:Tl}),xt=a.createContext({}),kl=({children:t,className:e,variant:n="default",...r})=>{const o=y.useMemo(()=>wd({variant:n}),[n]),l=A.jsx(Ae.div,{className:o.base({className:e}),"data-slot":"card",...r,children:t});return A.jsx(xt,{value:{slots:o},children:n==="transparent"?l:A.jsx(Li,{value:{variant:n},children:l})})},Jb=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},Qb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(xt);return A.jsx(Ae.h3,{className:he(r==null?void 0:r.title,e),"data-slot":"card-title",...n,children:t})},eh=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(xt);return A.jsx(Ae.p,{className:he(r==null?void 0:r.description,e),"data-slot":"card-description",...n,children:t})},th=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},nh=({className:t,...e})=>{const{slots:n}=a.useContext(xt);return A.jsx(Ae.div,{className:he(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},Nh=Object.assign(kl,{Root:kl,Header:Jb,Title:Qb,Description:eh,Content:th,Footer:nh}),Fa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Ia={...Fa,customError:!0,valid:!1},St={isInvalid:!1,validationDetails:Fa,validationErrors:[]},rh=a.createContext({}),Mr="__reactAriaFormValidationState";function oh(t){if(t[Mr]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}=t[Mr];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:l}}return lh(t)}function lh(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:l,validate:i,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let u=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Ia}:null,c=a.useMemo(()=>{if(!i||o==null)return null;let K=ih(i,o);return Dl(K)},[i,o]);l!=null&&l.validationDetails.valid&&(l=void 0);let d=a.useContext(rh),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(K=>Ar(d[K])):Ar(d[r]):[],[d,r]),[b,p]=a.useState(d),[m,v]=a.useState(!1);d!==b&&(p(d),v(!1));let g=a.useMemo(()=>Dl(m?[]:f),[m,f]),x=a.useRef(St),[$,D]=a.useState(St),P=a.useRef(St),F=()=>{if(!R)return;I(!1);let K=c||l||x.current;nr(K,P.current)||(P.current=K,D(K))},[R,I]=a.useState(!1);return a.useEffect(F),{realtimeValidation:u||g||c||l||St,displayValidation:s==="native"?u||g||$:u||g||c||l||$,updateValidation(K){s==="aria"&&!nr($,K)?D(K):x.current=K},resetValidation(){let K=St;nr(K,P.current)||(P.current=K,D(K)),s==="native"&&I(!1),v(!0)},commitValidation(){s==="native"&&I(!0),v(!0)}}}function Ar(t){return t?Array.isArray(t)?t:[t]:[]}function ih(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return Ar(n)}return[]}function Dl(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Ia}:null}function nr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}const sh=typeof document<"u"?y.useInsertionEffect??y.useLayoutEffect:()=>{};function ah(t,e,n){let[r,o]=a.useState(t||e),l=a.useRef(r),i=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{i.current,i.current=s},[s]);let u=s?t:r;sh(()=>{l.current=u});let[,c]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(l.current):f;Object.is(l.current,p)||(l.current=p,o(p),c(),n==null||n(p,...b))},[n]);return[u,d]}const Ba=a.createContext({}),Ml=({children:t,className:e,color:n,size:r,variant:o,...l})=>{const i=y.useMemo(()=>Sd({color:n,size:r,variant:o}),[n,r,o]),s=y.useMemo(()=>typeof t=="string"||typeof t=="number"?A.jsx(Na,{children:t}):t,[t]);return A.jsx(Ba,{value:{slots:i},children:A.jsx(Ae.span,{...l,className:he(i.base,e),"data-slot":"chip",children:s})})},Na=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ba);return A.jsx(Ae.span,{className:he(r==null?void 0:r.label,e),"data-slot":"chip-label",...n,children:t})},Oh=Object.assign(Ml,{Root:Ml,Label:Na}),In=a.createContext({});let uh=t=>{let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,...o}=t;return o};const ch=Ht(function(e,n){[e,n]=Ce(e,n,In);let{hoverProps:r,isHovered:o}=Gt({...e,isDisabled:e.disabled}),{isFocused:l,isFocusVisible:i,focusProps:s}=kn({isTextInput:!0,autoFocus:e.autoFocus}),u=!!e["aria-invalid"]&&e["aria-invalid"]!=="false",c=Ee({...e,values:{isHovered:o,isFocused:l,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:u},defaultClassName:"react-aria-Input"});return y.createElement(fe.input,{...J(uh(e),s,r),...c,ref:n,"data-focused":l||void 0,"data-disabled":e.disabled||void 0,"data-hovered":o||void 0,"data-focus-visible":i||void 0,"data-invalid":u||void 0})});function Oa(t,e){let{inputElementType:n="input",isDisabled:r=!1,isRequired:o=!1,isReadOnly:l=!1,type:i="text",validationBehavior:s="aria"}=t,[u,c]=ah(t.value,t.defaultValue||"",t.onChange),{focusableProps:d}=Pn(t,e),f=oh({...t,value:u}),{isInvalid:b,validationErrors:p,validationDetails:m}=f.displayValidation,{labelProps:v,fieldProps:g,descriptionProps:x,errorMessageProps:$}=_b({...t,isInvalid:b,errorMessage:t.errorMessage||p}),D=pe(t,{labelable:!0});const P={type:i,pattern:t.pattern};let[F]=a.useState(u);return Xl(e,t.defaultValue??F,c),jb(t,f,e),{labelProps:v,inputProps:J(D,n==="input"?P:void 0,{disabled:r,readOnly:l,required:o&&s==="native","aria-required":o&&s==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":t["aria-errormessage"],"aria-activedescendant":t["aria-activedescendant"],"aria-autocomplete":t["aria-autocomplete"],"aria-haspopup":t["aria-haspopup"],"aria-controls":t["aria-controls"],value:u,onChange:R=>c(j(R).value),autoComplete:t.autoComplete,autoCapitalize:t.autoCapitalize,maxLength:t.maxLength,minLength:t.minLength,name:t.name,form:t.form,placeholder:t.placeholder,inputMode:t.inputMode,autoCorrect:t.autoCorrect,spellCheck:t.spellCheck,[parseInt(y.version,10)>=17?"enterKeyHint":"enterkeyhint"]:t.enterKeyHint,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onCompositionEnd:t.onCompositionEnd,onCompositionStart:t.onCompositionStart,onCompositionUpdate:t.onCompositionUpdate,onSelect:t.onSelect,onBeforeInput:t.onBeforeInput,onInput:t.onInput,...d,...g}),descriptionProps:x,errorMessageProps:$,isInvalid:b,validationErrors:p,validationDetails:m}}var Va={};Va={buttonLabel:"عرض المقترحات",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} خيار`,other:()=>`${e.number(t.optionCount)} خيارات`})} متاحة.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`المجموعة المدخلة ${t.groupTitle}, مع ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} خيار`,other:()=>`${e.number(t.groupCount)} خيارات`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", محدد",other:""},t.isSelected)}`,listboxLabel:"مقترحات",selectedAnnouncement:t=>`${t.optionText}، محدد`};var _a={};_a={buttonLabel:"Покажи предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} опция`,other:()=>`${e.number(t.optionCount)} опции`})} на разположение.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Въведена група ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} опция`,other:()=>`${e.number(t.groupCount)} опции`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", избрани",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, избрани`};var ja={};ja={buttonLabel:"Zobrazit doporučení",countAnnouncement:(t,e)=>`K dispozici ${e.plural(t.optionCount,{one:()=>`je ${e.number(t.optionCount)} možnost`,other:()=>`jsou/je ${e.number(t.optionCount)} možnosti/-í`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina „${t.groupTitle}“ ${e.plural(t.groupCount,{one:()=>`s ${e.number(t.groupCount)} možností`,other:()=>`se ${e.number(t.groupCount)} možnostmi`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:" (vybráno)",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybráno`};var za={};za={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} mulighed tilgængelig`,other:()=>`${e.number(t.optionCount)} muligheder tilgængelige`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angivet gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} mulighed`,other:()=>`${e.number(t.groupCount)} muligheder`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var Ha={};Ha={buttonLabel:"Empfehlungen anzeigen",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} Option`,other:()=>`${e.number(t.optionCount)} Optionen`})} verfügbar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Eingetretene Gruppe ${t.groupTitle}, mit ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} Option`,other:()=>`${e.number(t.groupCount)} Optionen`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", ausgewählt",other:""},t.isSelected)}`,listboxLabel:"Empfehlungen",selectedAnnouncement:t=>`${t.optionText}, ausgewählt`};var Wa={};Wa={buttonLabel:"Προβολή προτάσεων",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} επιλογή`,other:()=>`${e.number(t.optionCount)} επιλογές `})} διαθέσιμες.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Εισαγμένη ομάδα ${t.groupTitle}, με ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} επιλογή`,other:()=>`${e.number(t.groupCount)} επιλογές`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", επιλεγμένο",other:""},t.isSelected)}`,listboxLabel:"Προτάσεις",selectedAnnouncement:t=>`${t.optionText}, επιλέχθηκε`};var Ga={};Ga={focusAnnouncement:(t,e)=>`${e.select({true:()=>`Entered group ${t.groupTitle}, with ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selected",other:""},t.isSelected)}`,countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} available.`,selectedAnnouncement:t=>`${t.optionText}, selected`,buttonLabel:"Show suggestions",listboxLabel:"Suggestions"};var Ua={};Ua={buttonLabel:"Mostrar sugerencias",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opción`,other:()=>`${e.number(t.optionCount)} opciones`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Se ha unido al grupo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opción`,other:()=>`${e.number(t.groupCount)} opciones`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seleccionado",other:""},t.isSelected)}`,listboxLabel:"Sugerencias",selectedAnnouncement:t=>`${t.optionText}, seleccionado`};var qa={};qa={buttonLabel:"Kuva soovitused",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} valik`,other:()=>`${e.number(t.optionCount)} valikud`})} saadaval.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Sisestatud rühm ${t.groupTitle}, valikuga ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} valik`,other:()=>`${e.number(t.groupCount)} valikud`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valitud",other:""},t.isSelected)}`,listboxLabel:"Soovitused",selectedAnnouncement:t=>`${t.optionText}, valitud`};var Ya={};Ya={buttonLabel:"Näytä ehdotukset",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} vaihtoehto`,other:()=>`${e.number(t.optionCount)} vaihtoehdot`})} saatavilla.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Mentiin ryhmään ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} vaihtoehdon`,other:()=>`${e.number(t.groupCount)} vaihtoehdon`})} kanssa.`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valittu",other:""},t.isSelected)}`,listboxLabel:"Ehdotukset",selectedAnnouncement:t=>`${t.optionText}, valittu`};var Xa={};Xa={buttonLabel:"Afficher les suggestions",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groupe ${t.groupTitle} rejoint, avec ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", sélectionné(s)",other:""},t.isSelected)}`,listboxLabel:"Suggestions",selectedAnnouncement:t=>`${t.optionText}, sélectionné`};var Za={};Za={buttonLabel:"הצג הצעות",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`אפשרות ${e.number(t.optionCount)}`,other:()=>`${e.number(t.optionCount)} אפשרויות`})} במצב זמין.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`נכנס לקבוצה ${t.groupTitle}, עם ${e.plural(t.groupCount,{one:()=>`אפשרות ${e.number(t.groupCount)}`,other:()=>`${e.number(t.groupCount)} אפשרויות`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", נבחר",other:""},t.isSelected)}`,listboxLabel:"הצעות",selectedAnnouncement:t=>`${t.optionText}, נבחר`};var Ja={};Ja={buttonLabel:"Prikaži prijedloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} opcije/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", odabranih",other:""},t.isSelected)}`,listboxLabel:"Prijedlozi",selectedAnnouncement:t=>`${t.optionText}, odabrano`};var Qa={};Qa={buttonLabel:"Javaslatok megjelenítése",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} lehetőség`,other:()=>`${e.number(t.optionCount)} lehetőség`})} áll rendelkezésre.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Belépett a(z) ${t.groupTitle} csoportba, amely ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} lehetőséget`,other:()=>`${e.number(t.groupCount)} lehetőséget`})} tartalmaz. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", kijelölve",other:""},t.isSelected)}`,listboxLabel:"Javaslatok",selectedAnnouncement:t=>`${t.optionText}, kijelölve`};var eu={};eu={buttonLabel:"Mostra suggerimenti",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opzione disponibile`,other:()=>`${e.number(t.optionCount)} opzioni disponibili`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingresso nel gruppo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opzione`,other:()=>`${e.number(t.groupCount)} opzioni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selezionato",other:""},t.isSelected)}`,listboxLabel:"Suggerimenti",selectedAnnouncement:t=>`${t.optionText}, selezionato`};var tu={};tu={buttonLabel:"候補を表示",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 個のオプション`,other:()=>`${e.number(t.optionCount)} 個のオプション`})}を利用できます。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`入力されたグループ ${t.groupTitle}、${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 個のオプション`,other:()=>`${e.number(t.groupCount)} 個のオプション`})}を含む。`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:"、選択済み",other:""},t.isSelected)}`,listboxLabel:"候補",selectedAnnouncement:t=>`${t.optionText}、選択済み`};var nu={};nu={buttonLabel:"제안 사항 표시",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)}개 옵션`,other:()=>`${e.number(t.optionCount)}개 옵션`})}을 사용할 수 있습니다.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`입력한 그룹 ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)}개 옵션`,other:()=>`${e.number(t.groupCount)}개 옵션`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 선택됨",other:""},t.isSelected)}`,listboxLabel:"제안",selectedAnnouncement:t=>`${t.optionText}, 선택됨`};var ru={};ru={buttonLabel:"Rodyti pasiūlymus",countAnnouncement:(t,e)=>`Yra ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} parinktis`,other:()=>`${e.number(t.optionCount)} parinktys (-ių)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Įvesta grupė ${t.groupTitle}, su ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} parinktimi`,other:()=>`${e.number(t.groupCount)} parinktimis (-ių)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", pasirinkta",other:""},t.isSelected)}`,listboxLabel:"Pasiūlymai",selectedAnnouncement:t=>`${t.optionText}, pasirinkta`};var ou={};ou={buttonLabel:"Rādīt ieteikumus",countAnnouncement:(t,e)=>`Pieejamo opciju skaits: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcijas`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ievadīta grupa ${t.groupTitle}, ar ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opciju`,other:()=>`${e.number(t.groupCount)} opcijām`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", atlasīta",other:""},t.isSelected)}`,listboxLabel:"Ieteikumi",selectedAnnouncement:t=>`${t.optionText}, atlasīta`};var lu={};lu={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativer`})} finnes.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angitt gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativer`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var iu={};iu={buttonLabel:"Suggesties weergeven",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} optie`,other:()=>`${e.number(t.optionCount)} opties`})} beschikbaar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groep ${t.groupTitle} ingevoerd met ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} optie`,other:()=>`${e.number(t.groupCount)} opties`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", geselecteerd",other:""},t.isSelected)}`,listboxLabel:"Suggesties",selectedAnnouncement:t=>`${t.optionText}, geselecteerd`};var su={};su={buttonLabel:"Wyświetlaj sugestie",countAnnouncement:(t,e)=>`dostępna/dostępne(-nych) ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcja`,other:()=>`${e.number(t.optionCount)} opcje(-i)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Dołączono do grupy ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcją`,other:()=>`${e.number(t.groupCount)} opcjami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", wybrano",other:""},t.isSelected)}`,listboxLabel:"Sugestie",selectedAnnouncement:t=>`${t.optionText}, wybrano`};var au={};au={buttonLabel:"Mostrar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo inserido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var uu={};uu={buttonLabel:"Apresentar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo introduzido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var cu={};cu={buttonLabel:"Afișare sugestii",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opțiune`,other:()=>`${e.number(t.optionCount)} opțiuni`})} disponibile.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grup ${t.groupTitle} introdus, cu ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opțiune`,other:()=>`${e.number(t.groupCount)} opțiuni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selectat",other:""},t.isSelected)}`,listboxLabel:"Sugestii",selectedAnnouncement:t=>`${t.optionText}, selectat`};var du={};du={buttonLabel:"Показать предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметров`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введенная группа ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметром`,other:()=>`${e.number(t.groupCount)} параметрами`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", выбранными",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, выбрано`};var fu={};fu={buttonLabel:"Zobraziť návrhy",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} možnosť`,other:()=>`${e.number(t.optionCount)} možnosti/-í`})} k dispozícii.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} možnosťou`,other:()=>`${e.number(t.groupCount)} možnosťami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", vybraté",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybraté`};var pu={};pu={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Na voljo je ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Vnesena skupina ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcija`,other:()=>`${e.number(t.groupCount)} opcije`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izbrano",other:""},t.isSelected)}`,listboxLabel:"Predlogi",selectedAnnouncement:t=>`${t.optionText}, izbrano`};var bu={};bu={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena grupa ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} optione/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izabranih",other:""},t.isSelected)}`,listboxLabel:"Predlozi",selectedAnnouncement:t=>`${t.optionText}, izabrano`};var hu={};hu={buttonLabel:"Visa förslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativ`})} tillgängliga.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingick i gruppen ${t.groupTitle} med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativ`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valda",other:""},t.isSelected)}`,listboxLabel:"Förslag",selectedAnnouncement:t=>`${t.optionText}, valda`};var mu={};mu={buttonLabel:"Önerileri göster",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} seçenek`,other:()=>`${e.number(t.optionCount)} seçenekler`})} kullanılabilir.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Girilen grup ${t.groupTitle}, ile ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} seçenek`,other:()=>`${e.number(t.groupCount)} seçenekler`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seçildi",other:""},t.isSelected)}`,listboxLabel:"Öneriler",selectedAnnouncement:t=>`${t.optionText}, seçildi`};var gu={};gu={buttonLabel:"Показати пропозиції",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметри(-ів)`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введена група ${t.groupTitle}, з ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметр`,other:()=>`${e.number(t.groupCount)} параметри(-ів)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", вибрано",other:""},t.isSelected)}`,listboxLabel:"Пропозиції",selectedAnnouncement:t=>`${t.optionText}, вибрано`};var $u={};$u={buttonLabel:"显示建议",countAnnouncement:(t,e)=>`有 ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 个选项`,other:()=>`${e.number(t.optionCount)} 个选项`})}可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`进入了 ${t.groupTitle} 组,其中有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 个选项`,other:()=>`${e.number(t.groupCount)} 个选项`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已选择",other:""},t.isSelected)}`,listboxLabel:"建议",selectedAnnouncement:t=>`${t.optionText}, 已选择`};var yu={};yu={buttonLabel:"顯示建議",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 選項`,other:()=>`${e.number(t.optionCount)} 選項`})} 可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`輸入的群組 ${t.groupTitle}, 有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 選項`,other:()=>`${e.number(t.groupCount)} 選項`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已選取",other:""},t.isSelected)}`,listboxLabel:"建議",selectedAnnouncement:t=>`${t.optionText}, 已選取`};var vu={};vu={"ar-AE":Va,"bg-BG":_a,"cs-CZ":ja,"da-DK":za,"de-DE":Ha,"el-GR":Wa,"en-US":Ga,"es-ES":Ua,"et-EE":qa,"fi-FI":Ya,"fr-FR":Xa,"he-IL":Za,"hr-HR":Ja,"hu-HU":Qa,"it-IT":eu,"ja-JP":tu,"ko-KR":nu,"lt-LT":ru,"lv-LV":ou,"nb-NO":lu,"nl-NL":iu,"pl-PL":su,"pt-BR":au,"pt-PT":uu,"ro-RO":cu,"ru-RU":du,"sk-SK":fu,"sl-SI":pu,"sr-SP":bu,"sv-SE":hu,"tr-TR":mu,"uk-UA":gu,"zh-CN":$u,"zh-TW":yu};function dh(t){return t&&t.__esModule?t.default:t}function fh(t,e){let{buttonRef:n,popoverRef:r,inputRef:o,listBoxRef:l,keyboardDelegate:i,layoutDelegate:s,shouldFocusWrap:u,isReadOnly:c,isDisabled:d}=t,f=a.useRef(null);n=n??f;let b=Yr(dh(vu),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=Op({type:"listbox",isDisabled:d||c},e,n);Rn.set(e,{id:m.id});let{collection:v}=e,{disabledKeys:g}=e.selectionManager,x=a.useMemo(()=>i||new Qr({collection:v,disabledKeys:g,ref:l,layoutDelegate:s}),[i,s,v,g,l]),{collectionProps:$}=ga({selectionManager:e.selectionManager,keyboardDelegate:x,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:u,ref:o,isVirtualized:!0}),D=zt(),P=L=>{if(!L.nativeEvent.isComposing)switch(L.key){case"Enter":case"Tab":if(e.isOpen&&L.key==="Enter"&&L.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let H=e.collection.getItem(e.selectionManager.focusedKey);if(H!=null&&H.props.href){let oe=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);L.key==="Enter"&&oe instanceof HTMLAnchorElement&&D.open(oe,L,H.props.href,H.props.routerOptions),e.close();break}else if(H!=null&&H.props.onAction){H.props.onAction(),e.close();break}}(L.key==="Enter"||e.isOpen)&&e.commit();break;case"Escape":(!e.selectionManager.isEmpty||e.inputValue===""||t.allowsCustomValue)&&L.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},F=L=>{let H=(n==null?void 0:n.current)&&n.current===L.relatedTarget,oe=te(r.current,L.relatedTarget);H||oe||(t.onBlur&&t.onBlur(L),e.setFocused(!1))},R=L=>{e.isFocused||(t.onFocus&&t.onFocus(L),e.setFocused(!0))},I=ph([e.selectionManager.selectedKeys,e.selectionManager.selectionMode]),{isInvalid:k,validationErrors:B,validationDetails:K}=e.displayValidation,{labelProps:_,inputProps:U,descriptionProps:z,errorMessageProps:h}=Oa({...t,isRequired:t.selectionMode==="multiple"?t.isRequired&&e.selectionManager.isEmpty:t.isRequired,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:tt(e.isOpen&&$.onKeyDown,P,t.onKeyDown),onBlur:F,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:R,autoComplete:"off",validate:void 0,[Mr]:e,"aria-describedby":[I,t["aria-describedby"]].filter(Boolean).join(" ")||void 0},o);Xl(o,e.defaultValue,e.setValue);let C=L=>{var H;L.pointerType==="touch"&&((H=o.current)==null||H.focus(),e.toggle(null,"manual"))},M=L=>{var H;L.pointerType!=="touch"&&((H=o.current)==null||H.focus(),e.toggle(L.pointerType==="keyboard"||L.pointerType==="virtual"?"first":null,"manual"))},E=dn({id:p.id,"aria-label":b.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||_.id}),w=dn({id:m.id,"aria-label":b.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||_.id}),T=a.useRef(0),S=L=>{var it,Yt;if(d||c)return;if(L.timeStamp-T.current<500){L.preventDefault(),(it=o.current)==null||it.focus();return}let H=j(L).getBoundingClientRect(),oe=L.changedTouches[0],Se=Math.ceil(H.left+.5*H.width),Bn=Math.ceil(H.top+.5*H.height);oe.clientX===Se&&oe.clientY===Bn&&(L.preventDefault(),(Yt=o.current)==null||Yt.focus(),e.toggle(null,"manual"),T.current=L.timeStamp)},N=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0,q=(N==null?void 0:N.parentKey)??null,W=e.selectionManager.focusedKey??null,X=a.useRef(q),Q=a.useRef(W);a.useEffect(()=>{if(ln()&&N!=null&&W!=null&&W!==Q.current){let L=e.selectionManager.isSelected(W),H=q!=null?e.collection.getItem(q):null,oe=(H==null?void 0:H["aria-label"])||(typeof(H==null?void 0:H.rendered)=="string"?H.rendered:"")||"",Se=b.format("focusAnnouncement",{isGroupChange:(H&&q!==X.current)??!1,groupTitle:oe,groupCount:H?[...$a(H,e.collection)].length:0,optionText:N["aria-label"]||N.textValue||"",isSelected:L});Lt(Se)}X.current=q,Q.current=W});let le=ya(e.collection),Z=a.useRef(le),be=a.useRef(e.isOpen);a.useEffect(()=>{let L=e.isOpen!==be.current&&(e.selectionManager.focusedKey==null||ln());if(e.isOpen&&(L||le!==Z.current)){let H=b.format("countAnnouncement",{optionCount:le});Lt(H)}Z.current=le,be.current=e.isOpen});let we=a.useRef(e.selectedKey);return a.useEffect(()=>{if(ln()&&e.isFocused&&e.selectedItem&&e.selectedKey!==we.current){let L=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",H=b.format("selectedAnnouncement",{optionText:L});Lt(H)}we.current=e.selectedKey}),a.useEffect(()=>{if(e.isOpen)return Ur([o.current,r.current].filter(L=>L!=null))},[e.isOpen,o,r]),cc(()=>{!N&&o.current&&re(ee(o.current))===o.current&&Jr(o.current,null)},[N]),Tt(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:_,buttonProps:{...p,...E,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:C,onPressStart:M,isDisabled:d||c},inputProps:J(U,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":N?Da(e,N.key):void 0,onTouchEnd:S,autoCorrect:"off",spellCheck:"false"}),listBoxProps:J(m,w,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),valueProps:{id:I},descriptionProps:z,errorMessageProps:h,isInvalid:k,validationErrors:B,validationDetails:K}}function ph(t=[]){let e=ve(),[n,r]=a.useState(!0),[o,l]=a.useState(t);return o.some((i,s)=>!Object.is(i,t[s]))&&(r(!0),l(t)),a.useEffect(()=>{n&&!document.getElementById(e)&&r(!1)},[e,n,o]),n?e:void 0}function bh(t){var fo;let{defaultFilter:e,menuTrigger:n="input",allowsEmptyCollection:r=!1,allowsCustomValue:o,shouldCloseOnBlur:l=!0,selectionMode:i="single"}=t,[s,u]=a.useState(!1),[c,d]=a.useState(!1),[f,b]=a.useState(null),p=a.useMemo(()=>t.defaultValue!==void 0?t.defaultValue:i==="single"?t.defaultSelectedKey??null:[],[t.defaultValue,t.defaultSelectedKey,i]),m=a.useMemo(()=>t.value!==void 0?t.value:i==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,i]),[v,g]=$n(m,p,t.onChange),x=i==="single"&&Array.isArray(v)?v[0]:v,$=G=>{var se;if(i==="single"){let ue=Array.isArray(G)?G[0]??null:G;g(ue),ue!==x&&((se=t.onSelectionChange)==null||se.call(t,ue))}else{let ue=[];Array.isArray(G)?ue=G:G!=null&&(ue=[G]),g(ue)}},{collection:D,selectionManager:P,disabledKeys:F}=Ma({...t,items:t.items??t.defaultItems,selectionMode:i,disallowEmptySelection:i==="single",allowDuplicateSelectionEvents:!0,selectedKeys:a.useMemo(()=>mh(x),[x]),onSelectionChange:G=>{var se;if(G!=="all")if(i==="single"){let ue=G.values().next().value??null;ue===x?((se=t.onSelectionChange)==null||se.call(t,ue),le(),W()):$(ue)}else $([...G])}}),R=i==="single"?P.firstSelectedKey:null,I=a.useMemo(()=>[...P.selectedKeys].map(G=>D.getItem(G)).filter(G=>G!=null),[P.selectedKeys,D]),[k,B]=$n(t.inputValue,Al(t.defaultInputValue,R,D)||"",t.onInputChange),[K]=a.useState(x),[_]=a.useState(k),U=D,z=a.useMemo(()=>t.items!=null||!e?D:hh(D,k,e),[D,k,e,t.items]),[h,C]=a.useState(z),M=a.useRef("focus"),w=Ln({...t,onOpenChange:G=>{t.onOpenChange&&t.onOpenChange(G,G?M.current:void 0),P.setFocused(G),G||P.setFocusedKey(null)},isOpen:void 0,defaultOpen:void 0}),T=(G=null,se)=>{let ue=se==="manual"||se==="focus"&&n==="focus";(r||z.size>0||ue&&U.size>0||t.items)&&(ue&&!w.isOpen&&t.items===void 0&&u(!0),M.current=se,b(G),w.open())},S=(G=null,se)=>{let ue=se==="manual"||se==="focus"&&n==="focus";!(r||z.size>0||ue&&U.size>0||t.items)&&!w.isOpen||(ue&&!w.isOpen&&t.items===void 0&&u(!0),w.isOpen||(M.current=se),q(G))},N=a.useCallback(()=>{C(s?U:z)},[s,U,z]),q=a.useCallback((G=null)=>{w.isOpen&&N(),b(G),w.toggle()},[w,N]),W=a.useCallback(()=>{w.isOpen&&(N(),w.close())},[w,N]),[X,Q]=a.useState(k),le=()=>{var se;let G=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";Q(G),B(G)},Z=a.useRef(x),be=a.useRef(R!=null?((fo=D.getItem(R))==null?void 0:fo.textValue)??"":"");a.useEffect(()=>{var se;c&&(z.size>0||r)&&!w.isOpen&&k!==X&&n!=="manual"&&T(null,"input"),!s&&!r&&w.isOpen&&z.size===0&&W(),x!=null&&x!==Z.current&&i==="single"&&W(),k!==X&&(P.setFocusedKey(null),u(!1),i==="single"&&k===""&&(t.inputValue===void 0||m===void 0)&&$(null)),x!==Z.current&&(t.inputValue===void 0||m===void 0)?le():X!==k&&Q(k);let G=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";!c&&R!=null&&t.inputValue===void 0&&R===Z.current&&be.current!==G&&(Q(G),B(G)),Z.current=x,be.current=G});let we=wb({...t,value:a.useMemo(()=>Array.isArray(x)&&x.length===0?null:{inputValue:k,value:x,selectedKey:R},[k,R,x])}),L=()=>{o&&R==null?H():oe()},H=()=>{if(i==="multiple"){Q(k),W();return}let G=null;Z.current=G,$(G),W()},oe=(G=!1)=>{var se,ue,po;if(m!==void 0&&t.inputValue!==void 0){let bo=R!=null?((se=D.getItem(R))==null?void 0:se.textValue)??"":"";(G||i==="multiple"||k!==bo)&&((ue=t.onSelectionChange)==null||ue.call(t,R),(po=t.onChange)==null||po.call(t,x)),Q(bo),W()}else le(),W()};const Se=()=>{var G;if(o){const se=R!=null?((G=D.getItem(R))==null?void 0:G.textValue)??"":"";k===se?oe():H()}else oe()};let Bn=()=>{w.isOpen&&P.focusedKey!=null?P.isSelected(P.focusedKey)&&i==="single"?oe(!0):P.select(P.focusedKey):Se()},it=a.useRef([k,x]),Yt=G=>{G?(it.current=[k,x],n==="focus"&&!t.isReadOnly&&T(null,"focus")):(l&&Se(),(k!==it.current[0]||x!==it.current[1])&&we.commitValidation()),d(G)},Pu=a.useMemo(()=>w.isOpen?s?U:z:h,[w.isOpen,U,z,s,h]),co=t.defaultSelectedKey??(i==="single"?K:null);return{...we,...w,focusStrategy:f,toggle:S,open:T,close:Se,selectionManager:P,value:x,defaultValue:p??K,setValue:$,selectedKey:R,selectedItems:I,defaultSelectedKey:co,setSelectedKey:$,disabledKeys:F,isFocused:c,setFocused:Yt,selectedItem:I[0]??null,collection:Pu,inputValue:k,defaultInputValue:Al(t.defaultInputValue,co,D)??_,setInputValue:B,commit:Bn,revert:L}}function hh(t,e,n){return new Dr(xu(t,t,e,n))}function xu(t,e,n,r){let o=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let i=xu(t,va(l,t),n,r);[...i].some(s=>s.type==="item")&&o.push({...l,childNodes:i})}else l.type==="item"&&r(l.textValue,n)?o.push({...l}):l.type!=="item"&&o.push({...l});return o}function Al(t,e,n){var r;return t==null&&e!=null?((r=n.getItem(e))==null?void 0:r.textValue)??"":t}function mh(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}const gh=a.createContext(null),Cu=a.createContext(null),$h=Ht(function(e,n){[e,n]=Ce(e,n,gh);let{children:r,isDisabled:o=!1,isInvalid:l=!1,isRequired:i=!1,isReadOnly:s=!1}=e,u=a.useMemo(()=>y.createElement(Fn.Provider,{value:{items:e.items??e.defaultItems}},typeof r=="function"?r({isOpen:!1,isDisabled:o,isInvalid:l,isRequired:i,defaultChildren:null,isReadOnly:s}):r),[r,o,l,i,s,e.items,e.defaultItems]);return y.createElement(ks,{content:u},c=>y.createElement(vh,{props:e,collection:c,comboBoxRef:n}))}),yh=[wn,Dn,In,ro,Ut];function vh({props:t,collection:e,comboBoxRef:n}){let{name:r,formValue:o="key",allowsCustomValue:l}=t;l&&(o="text");let{validationBehavior:i}=_r(Pa)||{},s=t.validationBehavior??i??"native",{contains:u}=Cb({sensitivity:"base"}),c=bh({...t,defaultFilter:t.defaultFilter||u,items:t.items,children:void 0,collection:e,validationBehavior:s}),d=a.useRef(null),f=a.useRef(null),b=a.useRef(null),p=a.useRef(null),m=a.useRef(null),[v,g]=jr(!t["aria-label"]&&!t["aria-labelledby"]),{buttonProps:x,inputProps:$,listBoxProps:D,labelProps:P,descriptionProps:F,errorMessageProps:R,valueProps:I,...k}=fh({...gi(t),label:g,inputRef:f,buttonRef:d,listBoxRef:p,popoverRef:m,name:o==="text"?r:void 0,validationBehavior:s},c),[B,K]=a.useState(null),_=a.useCallback(()=>{var E;if(f.current&&!b.current){let w=(E=d.current)==null?void 0:E.getBoundingClientRect(),T=f.current.getBoundingClientRect(),S=w?Math.min(w.left,T.left):T.left,N=w?Math.max(w.right,T.right):T.right;K(N-S+"px")}},[d,f,K]);fn({ref:f,onResize:_});let U=a.useMemo(()=>({get current(){return b.current||f.current}}),[b,f]),z=a.useMemo(()=>({isOpen:c.isOpen,isDisabled:t.isDisabled||!1,isInvalid:k.isInvalid||!1,isRequired:t.isRequired||!1,isReadOnly:t.isReadOnly||!1}),[c.isOpen,t.isDisabled,k.isInvalid,t.isRequired,t.isReadOnly]),h=Ee({...t,values:z,defaultClassName:"react-aria-ComboBox"}),C=pe(t,{global:!0});delete C.id;let M=[];if(r&&o==="key"){let E=Array.isArray(c.value)?c.value:[c.value];E.length===0&&(E=[null]),M=E.map((w,T)=>y.createElement("input",{key:T,type:"hidden",name:r,form:t.form,value:w??""}))}return y.createElement(rt,{values:[[Cu,c],[wn,{...P,ref:v}],[Dn,{...x,ref:d,isPressed:c.isOpen}],[In,{...$,ref:f}],[lt,c],[Xr,{ref:m,triggerRef:U,scrollRef:p,placement:"bottom start",isNonModal:!0,trigger:"ComboBox",style:{"--trigger-width":B},clearContexts:yh}],[Fn,{...D,ref:p}],[vt,c],[Ut,{slots:{description:F,errorMessage:R}}],[ro,{ref:b,isInvalid:k.isInvalid,isDisabled:t.isDisabled||!1}],[Ea,k],[xh,I]]},y.createElement(fe.div,{...C,...h,ref:n,slot:t.slot||void 0,"data-focused":c.isFocused||void 0,"data-open":c.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":k.isInvalid||void 0,"data-required":t.isRequired||void 0},h.children,M))}const xh=a.createContext(null),qt=a.createContext({}),Ll=({children:t,className:e,fullWidth:n,menuTrigger:r="focus",variant:o,...l})=>{const i=y.useMemo(()=>Td({fullWidth:n}),[n]);return A.jsx(qt,{value:{slots:i,variant:o},children:A.jsx($h,{"data-slot":"combo-box",menuTrigger:r,...l,className:Te(e,i==null?void 0:i.base()),children:s=>A.jsx(A.Fragment,{children:typeof t=="function"?t(s):t})})})},Ch=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(qt),o=he(r==null?void 0:r.inputGroup,e);return A.jsx("div",{className:o,"data-slot":"combo-box-input-group",...n,children:t})},Eh=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(qt),o=a.useContext(Cu);return A.jsx(Gr,{className:Te(e,r==null?void 0:r.trigger()),"data-open":Ai(o==null?void 0:o.isOpen),"data-slot":"combo-box-trigger",...n,children:t??A.jsx(mf,{"data-slot":"combo-box-trigger-default-icon"})})},wh=({children:t,className:e,placement:n="bottom",...r})=>{const{slots:o}=a.useContext(qt);return A.jsx(Li,{value:{variant:"default"},children:A.jsx(ap,{...r,className:Te(e,o==null?void 0:o.popover()),"data-slot":"combo-box-popover",placement:n,children:t})})},Vh=Object.assign(Ll,{Root:Ll,InputGroup:Ch,Trigger:Eh,Popover:wh}),Sh=({...t})=>{const e=a.useId();return A.jsxs("svg",{"data-slot":"spinner-icon",viewBox:"0 0 24 24",...t,children:[A.jsxs("defs",{children:[A.jsxs("linearGradient",{id:`«data-slot-icon-def-1»-${e}`,x1:"50%",x2:"50%",y1:"5.271%",y2:"91.793%",children:[A.jsx("stop",{offset:"0%",stopColor:"currentColor"}),A.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]}),A.jsxs("linearGradient",{id:`«data-slot-icon-def-2»-${e}`,x1:"50%",x2:"50%",y1:"15.24%",y2:"87.15%",children:[A.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:0}),A.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]})]}),A.jsxs("g",{fill:"none",children:[A.jsx("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),A.jsx("path",{d:"M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",fill:`url(#«data-slot-icon-def-1»-${e})`,transform:"translate(1.5 1.625)"}),A.jsx("path",{d:"M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",fill:`url(#«data-slot-icon-def-2»-${e})`,transform:"translate(1.5 1.625)"})]})]})},Kl=({className:t,color:e,size:n,...r})=>A.jsx(Ae.span,{"data-slot":"spinner",...r,className:Fd({className:t,color:e,size:n}),children:A.jsx(Sh,{"aria-hidden":!0,"aria-label":"Loading",role:"presentation"})}),_h=Object.assign(Kl,{Root:Kl}),Ph=a.createContext({}),Th=a.createContext(null),kh=Ht(function(e,n){[e,n]=Ce(e,n,Th);let{validationBehavior:r}=_r(Pa)||{},o=e.validationBehavior??r??"native",l=a.useRef(null);[e,l]=Ce(e,l,Mp);let[i,s]=jr(!e["aria-label"]&&!e["aria-labelledby"]),[u,c]=a.useState("input"),{labelProps:d,inputProps:f,descriptionProps:b,errorMessageProps:p,...m}=Oa({...gi(e),inputElementType:u,label:s,validationBehavior:o},l),v=a.useCallback($=>{l.current=$,$&&c($ instanceof HTMLTextAreaElement?"textarea":"input")},[l]),g=Ee({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:m.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-TextField"}),x=pe(e,{global:!0});return delete x.id,y.createElement(fe.div,{...x,...g,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":m.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},y.createElement(rt,{values:[[wn,{...d,ref:i}],[In,{...f,ref:v}],[Ph,{...f,ref:v}],[ro,{role:"presentation",isInvalid:m.isInvalid,isDisabled:e.isDisabled||!1}],[Ut,{slots:{description:b,errorMessage:p}}],[Ea,m]]},g.children))}),Eu=a.createContext({}),Rl=({children:t,className:e,fullWidth:n,variant:r,...o})=>{const l=y.useMemo(()=>Id({fullWidth:n}),[n]);return A.jsx(kh,{"data-slot":"textfield",...o,className:Te(e,l),children:i=>A.jsx(Eu,{value:{variant:r},children:A.jsx(A.Fragment,{children:typeof t=="function"?t(i):t})})})},Fl=({className:t,fullWidth:e,variant:n,...r})=>{const o=a.useContext(Eu),l=a.useContext(qt),i=n??o.variant??l.variant;return A.jsx(ch,{className:Te(t,Dd({fullWidth:e,variant:i})),"data-slot":"input",...r})},jh=Object.assign(Fl,{Root:Fl}),zh=Object.assign(Rl,{Root:Rl}),Il=({children:t,className:e,isDisabled:n,isInvalid:r,isRequired:o,...l})=>A.jsx(_d,{className:Md({isRequired:o,isDisabled:n,isInvalid:r,className:e}),"data-slot":"label",...l,children:t}),Hh=Object.assign(Il,{Root:Il}),Bl=({children:t,className:e,...n})=>A.jsx(Ip,{className:kd({className:e}),"data-slot":"description",slot:"description",...n,children:t}),Wh=Object.assign(Bl,{Root:Bl}),wu=a.createContext({}),Nl=({children:t,className:e,variant:n,...r})=>{const o=y.useMemo(()=>Kd({variant:n}),[n]);return A.jsx(Bb,{className:Te(e,o.item()),"data-slot":"list-box-item",...r,children:l=>A.jsx(wu,{value:{slots:o,state:l},children:typeof t=="function"?t(l):t})})},Su=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(wu),l=o==null?void 0:o.isSelected,i=typeof t=="function"?t(o??{}):t||A.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:l?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:A.jsx("polyline",{points:"1 9 7 14 15 4"})});return A.jsx(Ae.span,{"aria-hidden":"true",className:he(r==null?void 0:r.indicator,e),"data-slot":"list-box-item-indicator","data-visible":l||void 0,...n,children:i})},Dh=Object.assign(Nl,{Root:Nl,Indicator:Su}),Mh=({children:t,className:e,...n})=>{const r=y.useMemo(()=>Rd({class:typeof e=="string"?e:void 0}),[e]);return A.jsx(Ib,{className:r,...n,children:t})},Ah=Mh;function Ol({className:t,variant:e,...n}){const r=y.useMemo(()=>Ld({variant:e}),[e]);return A.jsx(Rb,{className:Te(t,r),"data-slot":"list-box",...n})}const Gh=Object.assign(Ol,{Root:Ol,Item:Dh,ItemIndicator:Su,Section:Ah});export{Fh as A,Bh as B,Vh as C,Wh as D,jh as I,Hh as L,_h as S,zh as T,Gh as a,Dh as b,Nh as c,nc as d,Ih as e,Oh as f,Ed as g}; diff --git a/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js b/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js deleted file mode 100644 index bc281fa6..00000000 --- a/src/gateway/static/dashboard/assets/index-CSyrpBqZ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-C0gVlZW-.js","assets/tanstack-query-W9y7rsMr.js","assets/react-q-ooZ0ti.js","assets/Table-DEsIhjZo.js","assets/heroui-CewI8xK4.js","assets/AliasesPage-mAjq9eh5.js","assets/Field-gj3-ox4q.js","assets/BudgetsPage-Us4jYLgv.js","assets/KeysPage-BhG598Pa.js","assets/ModelScopeControl-CNKA1fyP.js","assets/ModelsPage-DaewNAhO.js","assets/OverviewPage-BYSSsHzo.js","assets/ProvidersPage-swJiAs79.js","assets/SettingsPage-BNeqLlOB.js","assets/ToolsGuardrailsPage-ChC-YhRl.js","assets/UsagePage-BVzIiui8.js","assets/UsersPage-BxkuFQkF.js"])))=>i.map(i=>d[i]); -var we=Object.defineProperty;var Se=(e,r,s)=>r in e?we(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var re=(e,r,s)=>Se(e,typeof r!="symbol"?r+"":r,s);import{u as y,j as t,a as v,b as x,k as H,Q as ke,c as Pe}from"./tanstack-query-W9y7rsMr.js";import{d as Ee,r as o,N as le,O as Ne,H as Ce,R as Te,e as b,f as _e}from"./react-q-ooZ0ti.js";import{C as L,L as ce,I as ue,a as Ae,b as Ie,B as P,c as I,d as C,T as Le,e as qe}from"./heroui-CewI8xK4.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const f of l.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Re=Ee();const Oe="modulepreload",De=function(e){return"/"+e},se={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=f(s.map(m=>{if(m=De(m),m in se)return;se[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const h=document.createElement("link");if(h.rel=p?"stylesheet":Oe,p||(h.as="script"),h.crossOrigin="",h.href=m,d&&h.setAttribute("nonce",d),document.head.appendChild(h),p)return new Promise((u,j)=>{h.addEventListener("load",u),h.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(f){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=f,window.dispatchEvent(c),!c.defaultPrevented)throw f}return n.then(f=>{for(const c of f||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);re(this,"status");this.name="ApiError",this.status=s}}let R=null;function ne(e){R=e}let Q=null;function q(e){Q=e}async function V(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Fe(e){let r;try{r=await fetch("/v1/settings",{headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await V(r));return!0}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),Q&&s.set("Authorization",`Bearer ${Q}`);let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw R==null||R(),new E(a.status,await V(a));if(!a.ok)throw new E(a.status,await V(a));if(a.status!==204)return await a.json()}const O="otari.dashboard.masterKey",de=o.createContext(null);function Ke(){try{return window.sessionStorage.getItem(O)}catch{return null}}function Me({children:e}){const r=y(),[s,a]=o.useState(()=>{const d=Ke();return q(d),d}),n=o.useCallback(()=>{q(null),a(null),r.clear();try{window.sessionStorage.removeItem(O)}catch{}},[r]),l=o.useCallback(d=>{const m=d.trim();q(m),r.clear(),a(m);try{window.sessionStorage.setItem(O,m)}catch{}},[r]),f=o.useCallback(d=>{const m=d.trim();q(m),a(m);try{window.sessionStorage.setItem(O,m)}catch{}},[]);o.useEffect(()=>(ne(n),()=>ne(null)),[n]);const c=o.useMemo(()=>({masterKey:s,isAuthenticated:s!=null,login:l,replaceMasterKey:f,logout:n}),[s,l,f,n]);return t.jsx(de.Provider,{value:c,children:e})}function W(){const e=o.useContext(de);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ue(e){return e instanceof E&&e.status===0}function Be(){const e=y(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ue(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function $e(){return Be()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",F="pricing",me="settings",fe="tool-settings",G="aliases",J="discoverable",Y="providers",X="provider-health",he="stored-providers",ze="model-metadata",Qe="build",T="keys",_="budgets",xe="users",Z="usage",Ve=6e4,ae=60*6e4;function Ft(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function He(){return v({queryKey:[Qe],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Ve,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Kt(){return v({queryKey:[J],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[Y],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Ut(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Bt(){return v({queryKey:[X],queryFn:()=>i("/v1/providers/health"),staleTime:ae,refetchInterval:ae})}function $t(){const e=y();return x({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([X],r)})}function zt(){return v({queryKey:[he],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function K(e){e.invalidateQueries({queryKey:[he]}),e.invalidateQueries({queryKey:[Y]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]}),e.invalidateQueries({queryKey:[X]})}function Qt(){const e=y();return x({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>K(e)})}function Vt(){const e=y();return x({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>K(e)})}function Ht(){const e=y();return x({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>K(e)})}function Wt(){const e=y();return x({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>K(e)})}function Gt(){return x({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Jt(){return x({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Yt(){return v({queryKey:[ze],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Xt(){return v({queryKey:[G],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Zt(){const e=y();return x({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function er(){const e=y();return x({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function We(){return v({queryKey:[me],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function Ge(){const e=y();return x({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([me],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]})}})}function tr(){return x({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function rr(){return v({queryKey:[fe],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function sr(){const e=y();return x({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([fe],r)}})}function nr(){return x({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const M=1e3,Je=100;async function Ye(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function or(){const e=y();return x({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){return x({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function cr(){const e=y();return x({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[Y]})}})}function ur(){return x({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const U=1e3,Xe=100;async function Ze(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const B=1e3,et=100;async function tt(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function gr(){const e=y();return x({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=y();return x({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const $=1e3,rt=100;async function st(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>ee(e)})}function Sr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>ee(e)})}function kr(){const e=y();return x({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{ee(e),e.invalidateQueries({queryKey:[T]})}})}function te(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Pr(e,r,s){return v({queryKey:[Z,"list",e,r,s],queryFn:()=>{const a=te(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:H,staleTime:1e4})}function Er(e){return v({queryKey:[Z,"count",e],queryFn:()=>i(`/v1/usage/count?${te(e).toString()}`),placeholderData:H,staleTime:1e4})}function Nr(e,r,s=!0){return v({queryKey:[Z,"summary",e,r],queryFn:()=>{const a=te(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:H,staleTime:3e4})}function Cr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Tr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function _r(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ar(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${nt[s]} ${r[1]}`}const at=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ir(e){return at.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function it(e){return`${(e*100).toFixed(1)}%`}function qr(e,r){return r===void 0||r===0?null:(e-r)/r}function Rr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),f=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,d="second";for(const[p,g]of f){if(d=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",it(Math.abs(e))," vs prev"]})}function ot(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function lt({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:ot(e)}):null}function ct({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Fr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Kr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ut="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:f,disabled:c}){const d=o.useId(),m=e??(r?d:void 0),p=t.jsx("select",{id:m,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ut,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):f});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:m,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Ur({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:f=!1}){const c=h=>{var u;return((u=a.find(j=>j.value===h))==null?void 0:u.label)??h},[d,m]=o.useState(()=>c(r));o.useEffect(()=>{m(c(r))},[r]);const p=d.trim().toLowerCase(),g=a.filter(h=>!p||h.value.toLowerCase().includes(p)||h.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(L.Root,{allowsEmptyCollection:!0,allowsCustomValue:f,menuTrigger:"focus",inputValue:d,onInputChange:h=>{m(h),f?s(h.trim()):h.trim()===""&&s("")},onSelectionChange:h=>{h!=null&&s(String(h))},className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(L.InputGroup,{children:[t.jsx(ue,{placeholder:n,autoComplete:"off",onFocus:h=>h.currentTarget.select()}),t.jsx(L.Trigger,{})]}),t.jsx(L.Popover,{children:t.jsx(Ae,{items:g,className:"max-h-72 overflow-auto",children:h=>t.jsx(Ie,{id:h.value,textValue:h.label,children:h.label})})})]})}function dt(){var l;const e=We(),r=Ge(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(ct,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function mt(){const{data:e}=He(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function ft(){const e=mt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const ye=200,ve=480,z=240,ht=60,ge="otari.dashboard.sidebarWidth",pe="otari.dashboard.sidebarCollapsed",oe=16,D=e=>Math.min(ve,Math.max(ye,e));function xt(){if(typeof window>"u")return z;try{const e=window.localStorage.getItem(ge),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?z:D(r)}catch{return z}}function yt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pe)==="1"}catch{return!1}}const vt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],gt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function pt(){const{logout:e}=W(),r=o.useRef(null),[s,a]=o.useState(xt),[n,l]=o.useState(yt),[f,c]=o.useState(!1);o.useEffect(()=>{const u=window.setTimeout(()=>{try{window.localStorage.setItem(ge,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(u)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(pe,n?"1":"0")}catch{}},[n]);const d=o.useCallback(u=>{u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),c(!0)},[]),m=o.useCallback(u=>{var A;if(!u.currentTarget.hasPointerCapture(u.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(D(u.clientX-j))},[]),p=o.useCallback(u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId),c(!1)},[]),g=o.useCallback(u=>{u.key==="ArrowLeft"?(u.preventDefault(),a(j=>D(j-oe))):u.key==="ArrowRight"&&(u.preventDefault(),a(j=>D(j+oe)))},[]),h=n?ht:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(ft,{}),t.jsx($e,{}),t.jsx(dt,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:h},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!f&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(u=>!u),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:vt.map((u,j)=>{const A=gt.filter(k=>k.section===u.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&u.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:u.label}):null,j>0&&(n||!u.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(le,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:je})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",je?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},u.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":ye,"aria-valuemax":ve,tabIndex:0,onPointerDown:d,onPointerMove:m,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Ne,{})})})]})]})}function bt(){const{login:e}=W(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,f]=o.useState(!1),c=async()=>{const d=r.trim();if(!(!d||l)){f(!0),n(null);try{await Fe(d)?e(d):n(new Error("Invalid master key."))}catch(m){n(m)}finally{f(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(I,{className:"w-full max-w-md",children:t.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:d=>{d.preventDefault(),c()},children:[t.jsxs(Le,{value:r,onChange:d=>{s(d),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(ue,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(lt,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is held only in this browser tab (session storage) and sent directly to this gateway."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(qe,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const jt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-C0gVlZW-.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-mAjq9eh5.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-Us4jYLgv.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-BhG598Pa.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DaewNAhO.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Et=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BYSSsHzo.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,3,4]))).OverviewIndex})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-swJiAs79.js");return{ProvidersPage:e}},__vite__mapDeps([12,1,2,6,4,3]))).ProvidersPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-BNeqLlOB.js");return{SettingsPage:e}},__vite__mapDeps([13,1,2,4]))).SettingsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-ChC-YhRl.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([14,1,2,4]))).ToolsGuardrailsPage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-BVzIiui8.js");return{UsagePage:e}},__vite__mapDeps([15,1,2,3,4]))).UsagePage})),At=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-BxkuFQkF.js");return{UsersPage:e}},__vite__mapDeps([16,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function It(){const{isAuthenticated:e}=W();return e?t.jsx(Ce,{children:t.jsx(Te,{children:t.jsxs(b,{element:t.jsx(pt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(At,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"*",element:t.jsx(_e,{to:"/",replace:!0})})]})})}):t.jsx(bt,{})}function Lt({children:e}){const[r]=o.useState(()=>new ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Pe,{client:r,children:t.jsx(Me,{children:e})})}const be=document.getElementById("root");if(!be)throw new Error("Root element #root not found");Re.createRoot(be).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(It,{})})}));export{Jt as $,Ar as A,We as B,Kr as C,Tr as D,lt as E,Mr as F,ir as G,or as H,ct as I,Mt as J,Bt as K,qr as L,Ir as M,Dr as N,Lr as O,Fr as P,it as Q,Rr as R,Or as S,zt as T,Ht as U,Gt as V,Ge as W,Vt as X,$t as Y,Ut as Z,Qt as _,Pr as a,lr as a0,cr as a1,ur as a2,tr as a3,W as a4,Wt as a5,rr as a6,sr as a7,nr as a8,kr as a9,wr as aa,Er as b,Nr as c,Ur as d,Kt as e,Xt as f,er as g,ot as h,Zt as i,yr as j,gr as k,pr as l,br as m,Sr as n,vr as o,dr as p,fr as q,hr as r,xr as s,mr as t,jr as u,Ft as v,ar as w,Yt as x,_r as y,Cr as z}; diff --git a/src/gateway/static/dashboard/assets/index-D1FfVwkg.js b/src/gateway/static/dashboard/assets/index-D1FfVwkg.js deleted file mode 100644 index 86d60c14..00000000 --- a/src/gateway/static/dashboard/assets/index-D1FfVwkg.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-Dm6r6wPy.js","assets/tanstack-query-W9y7rsMr.js","assets/react-q-ooZ0ti.js","assets/Table-DEsIhjZo.js","assets/heroui-CewI8xK4.js","assets/AliasesPage-AOThQmDL.js","assets/Field-gj3-ox4q.js","assets/BudgetsPage-o3Sj5U5B.js","assets/KeysPage-CbUCEimJ.js","assets/ModelScopeControl-Bpbo36Ko.js","assets/ModelsPage-WLlH9ed9.js","assets/OverviewPage-DXIwdDWG.js","assets/ProvidersPage-Bz-mLWy0.js","assets/SettingsPage-BzPdd2gR.js","assets/ToolsGuardrailsPage-qp13etCg.js","assets/UsagePage-DU8IagMv.js","assets/UsersPage-DjQ_32XA.js"])))=>i.map(i=>d[i]); -var be=Object.defineProperty;var je=(e,r,s)=>r in e?be(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var ee=(e,r,s)=>je(e,typeof r!="symbol"?r+"":r,s);import{u as f,j as t,a as v,b as h,k as Q,Q as we,c as Se}from"./tanstack-query-W9y7rsMr.js";import{d as ke,r as o,N as ie,O as Pe,H as Ee,R as Ne,e as b,f as Ce}from"./react-q-ooZ0ti.js";import{C as I,L as oe,I as le,a as Te,b as _e,B as P,c as L,d as C,T as Ae,e as Le}from"./heroui-CewI8xK4.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Ie=ke();const qe="modulepreload",Re=function(e){return"/"+e},te={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let m=function(y){return Promise.all(y.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),x=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=m(s.map(y=>{if(y=Re(y),y in te)return;te[y]=!0;const p=y.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${g}`))return;const d=document.createElement("link");if(d.rel=p?"stylesheet":qe,p||(d.as="script"),d.crossOrigin="",d.href=y,x&&d.setAttribute("nonce",x),document.head.appendChild(d),p)return new Promise((u,j)=>{d.addEventListener("load",u),d.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return n.then(m=>{for(const c of m||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);ee(this,"status");this.name="ApiError",this.status=s}}let q=null;function re(e){q=e}async function $(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Oe(e){let r;try{r=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await $(r));return!0}async function De(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json");let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw q==null||q(),new E(a.status,await $(a));if(!a.ok)throw new E(a.status,await $(a));if(a.status!==204)return await a.json()}const z="otari.dashboard.hasSession",ce=o.createContext(null);function Fe(){try{return window.localStorage.getItem(z)==="1"}catch{return!1}}function Me({children:e}){const r=f(),[s,a]=o.useState(Fe),n=o.useCallback(()=>{De(),a(!1),r.clear();try{window.localStorage.removeItem(z)}catch{}},[r]),l=o.useCallback(()=>{r.clear(),a(!0);try{window.localStorage.setItem(z,"1")}catch{}},[r]);o.useEffect(()=>(re(n),()=>re(null)),[n]);const m=o.useMemo(()=>({isAuthenticated:s,login:l,logout:n}),[s,l,n]);return t.jsx(ce.Provider,{value:m,children:e})}function V(){const e=o.useContext(ce);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ke(e){return e instanceof E&&e.status===0}function Ue(){const e=f(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ke(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function Be(){return Ue()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",O="pricing",ue="settings",de="tool-settings",H="aliases",W="discoverable",G="providers",J="provider-health",me="stored-providers",$e="model-metadata",ze="build",T="keys",_="budgets",he="users",Y="usage",Qe=6e4,se=60*6e4;function Dt(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function Ve(){return v({queryKey:[ze],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Qe,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Ft(){return v({queryKey:[W],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[G],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Kt(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Ut(){return v({queryKey:[J],queryFn:()=>i("/v1/providers/health"),staleTime:se,refetchInterval:se})}function Bt(){const e=f();return h({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([J],r)})}function $t(){return v({queryKey:[me],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function D(e){e.invalidateQueries({queryKey:[me]}),e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]}),e.invalidateQueries({queryKey:[J]})}function zt(){const e=f();return h({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>D(e)})}function Qt(){const e=f();return h({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>D(e)})}function Vt(){const e=f();return h({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>D(e)})}function Ht(){const e=f();return h({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>D(e)})}function Wt(){return h({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Gt(){return h({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Jt(){return v({queryKey:[$e],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Yt(){return v({queryKey:[H],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Xt(){const e=f();return h({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function Zt(){const e=f();return h({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function He(){return v({queryKey:[ue],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function We(){const e=f();return h({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([ue],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]})}})}function er(){return h({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function tr(){return v({queryKey:[de],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function rr(){const e=f();return h({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([de],r)}})}function sr(){return h({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const F=1e3,Ge=100;async function Je(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function ir(){const e=f();return h({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function or(){return h({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function lr(){const e=f();return h({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[G]})}})}function cr(){return h({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const M=1e3,Ye=100;async function Xe(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function mr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=f();return h({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=f();return h({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const K=1e3,Ze=100;async function et(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function vr(){const e=f();return h({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function gr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=f();return h({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const U=1e3,tt=100;async function rt(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>X(e)})}function wr(){const e=f();return h({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>X(e)})}function Sr(){const e=f();return h({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:[T]})}})}function Z(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function kr(e,r,s){return v({queryKey:[Y,"list",e,r,s],queryFn:()=>{const a=Z(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:Q,staleTime:1e4})}function Pr(e){return v({queryKey:[Y,"count",e],queryFn:()=>i(`/v1/usage/count?${Z(e).toString()}`),placeholderData:Q,staleTime:1e4})}function Er(e,r,s=!0){return v({queryKey:[Y,"summary",e,r],queryFn:()=>{const a=Z(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:Q,staleTime:3e4})}function Nr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Cr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function Tr(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _r(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${st[s]} ${r[1]}`}const nt=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ar(e){return nt.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function at(e){return`${(e*100).toFixed(1)}%`}function Ir(e,r){return r===void 0||r===0?null:(e-r)/r}function qr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),m=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,x="second";for(const[p,g]of m){if(x=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",at(Math.abs(e))," vs prev"]})}function it(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function ot({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:it(e)}):null}function lt({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Dr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Fr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ct="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:m,disabled:c}){const x=o.useId(),y=e??(r?x:void 0),p=t.jsx("select",{id:y,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ct,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):m});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Kr({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:m=!1}){const c=d=>{var u;return((u=a.find(j=>j.value===d))==null?void 0:u.label)??d},[x,y]=o.useState(()=>c(r));o.useEffect(()=>{y(c(r))},[r]);const p=x.trim().toLowerCase(),g=a.filter(d=>!p||d.value.toLowerCase().includes(p)||d.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(I.Root,{allowsEmptyCollection:!0,allowsCustomValue:m,menuTrigger:"focus",inputValue:x,onInputChange:d=>{y(d),m?s(d.trim()):d.trim()===""&&s("")},onSelectionChange:d=>{d!=null&&s(String(d))},className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(I.InputGroup,{children:[t.jsx(le,{placeholder:n,autoComplete:"off",onFocus:d=>d.currentTarget.select()}),t.jsx(I.Trigger,{})]}),t.jsx(I.Popover,{children:t.jsx(Te,{items:g,className:"max-h-72 overflow-auto",children:d=>t.jsx(_e,{id:d.value,textValue:d.label,children:d.label})})})]})}function ut(){var l;const e=He(),r=We(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(lt,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function dt(){const{data:e}=Ve(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function mt(){const e=dt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const fe=200,xe=480,B=240,ht=60,ye="otari.dashboard.sidebarWidth",ve="otari.dashboard.sidebarCollapsed",ae=16,R=e=>Math.min(xe,Math.max(fe,e));function ft(){if(typeof window>"u")return B;try{const e=window.localStorage.getItem(ye),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?B:R(r)}catch{return B}}function xt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ve)==="1"}catch{return!1}}const yt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],vt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function gt(){const{logout:e}=V(),r=o.useRef(null),[s,a]=o.useState(ft),[n,l]=o.useState(xt),[m,c]=o.useState(!1);o.useEffect(()=>{const u=window.setTimeout(()=>{try{window.localStorage.setItem(ye,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(u)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(ve,n?"1":"0")}catch{}},[n]);const x=o.useCallback(u=>{u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),c(!0)},[]),y=o.useCallback(u=>{var A;if(!u.currentTarget.hasPointerCapture(u.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(R(u.clientX-j))},[]),p=o.useCallback(u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId),c(!1)},[]),g=o.useCallback(u=>{u.key==="ArrowLeft"?(u.preventDefault(),a(j=>R(j-ae))):u.key==="ArrowRight"&&(u.preventDefault(),a(j=>R(j+ae)))},[]),d=n?ht:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",m&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(mt,{}),t.jsx(Be,{}),t.jsx(ut,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:d},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!m&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(u=>!u),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:yt.map((u,j)=>{const A=vt.filter(k=>k.section===u.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&u.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:u.label}):null,j>0&&(n||!u.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(ie,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:pe})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",pe?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},u.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":fe,"aria-valuemax":xe,tabIndex:0,onPointerDown:x,onPointerMove:y,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",m?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Pe,{})})})]})]})}function pt(){const{login:e}=V(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,m]=o.useState(!1),c=async()=>{const x=r.trim();if(!(!x||l)){m(!0),n(null);try{await Oe(x)?e():n(new Error("Invalid master key."))}catch(y){n(y)}finally{m(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(L,{className:"w-full max-w-md",children:t.jsxs(L.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:x=>{x.preventDefault(),c()},children:[t.jsxs(Ae,{value:r,onChange:x=>{s(x),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(le,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(ot,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(Le,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const bt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-Dm6r6wPy.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),jt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-AOThQmDL.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-o3Sj5U5B.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-CbUCEimJ.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-WLlH9ed9.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-DXIwdDWG.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,3,4]))).OverviewIndex})),Et=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-Bz-mLWy0.js");return{ProvidersPage:e}},__vite__mapDeps([12,1,2,6,4,3]))).ProvidersPage})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-BzPdd2gR.js");return{SettingsPage:e}},__vite__mapDeps([13,1,2,4]))).SettingsPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-qp13etCg.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([14,1,2,4]))).ToolsGuardrailsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-DU8IagMv.js");return{UsagePage:e}},__vite__mapDeps([15,1,2,3,4]))).UsagePage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-DjQ_32XA.js");return{UsersPage:e}},__vite__mapDeps([16,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function At(){const{isAuthenticated:e}=V();return e?t.jsx(Ee,{children:t.jsx(Ne,{children:t.jsxs(b,{element:t.jsx(gt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(bt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"*",element:t.jsx(Ce,{to:"/",replace:!0})})]})})}):t.jsx(pt,{})}function Lt({children:e}){const[r]=o.useState(()=>new we({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Se,{client:r,children:t.jsx(Me,{children:e})})}const ge=document.getElementById("root");if(!ge)throw new Error("Root element #root not found");Ie.createRoot(ge).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(At,{})})}));export{Gt as $,_r as A,He as B,Fr as C,Cr as D,ot as E,Mr as F,ar as G,ir as H,lt as I,Mt as J,Ut as K,Ir as L,Ar as M,Or as N,Lr as O,Dr as P,at as Q,qr as R,Rr as S,$t as T,Vt as U,Wt as V,We as W,Qt as X,Bt as Y,Kt as Z,zt as _,kr as a,or as a0,lr as a1,cr as a2,er as a3,Ht as a4,tr as a5,rr as a6,sr as a7,Sr as a8,jr as a9,Pr as b,Er as c,Kr as d,Ft as e,Yt as f,Zt as g,it as h,Xt as i,xr as j,vr as k,gr as l,pr as m,wr as n,yr as o,ur as p,mr as q,hr as r,fr as s,dr as t,br as u,Dt as v,nr as w,Jt as x,Tr as y,Nr as z}; diff --git a/src/gateway/static/dashboard/assets/index-D6YDX-oj.js b/src/gateway/static/dashboard/assets/index-D6YDX-oj.js deleted file mode 100644 index 73fb376a..00000000 --- a/src/gateway/static/dashboard/assets/index-D6YDX-oj.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BS_KZH0z.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/Table-CLdjdyTx.js","assets/heroui-BX6JwHY-.js","assets/AliasesPage-O7ZGijD-.js","assets/Field-HzRk1KDP.js","assets/BudgetsPage-9zpV4nTH.js","assets/KeysPage-DAGeWeBS.js","assets/ModelScopeControl-CxWug9wa.js","assets/ModelsPage-DI7qj4qI.js","assets/OverviewPage-BHX_G4X9.js","assets/charts-Cr3Dij9t.js","assets/recharts-CR3TAEof.js","assets/ProvidersPage-BJkEklg1.js","assets/SettingsPage-CLdo7bKV.js","assets/ToolsGuardrailsPage-OKm-s8Wi.js","assets/UsagePage-DLrkG3qL.js","assets/UsersPage-CNthhRRV.js"])))=>i.map(i=>d[i]); -var we=Object.defineProperty;var Se=(e,r,s)=>r in e?we(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var re=(e,r,s)=>Se(e,typeof r!="symbol"?r+"":r,s);import{u as y,j as t,a as v,b as x,k as H,Q as ke,c as Pe}from"./tanstack-query-1t81HyiD.js";import{d as Ee,r as o,N as le,O as Ne,H as Ce,e as Te,f as b,h as _e}from"./react-dgEcD0HR.js";import{C as L,L as ce,I as ue,a as Ae,b as Ie,B as P,d as I,c as C,T as Le,e as qe}from"./heroui-BX6JwHY-.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Re=Ee();const Oe="modulepreload",De=function(e){return"/"+e},se={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let m=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=m(s.map(u=>{if(u=De(u),u in se)return;se[u]=!0;const p=u.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${g}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":Oe,p||(f.as="script"),f.crossOrigin="",f.href=u,h&&f.setAttribute("nonce",h),document.head.appendChild(f),p)return new Promise((d,j)=>{f.addEventListener("load",d),f.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return n.then(m=>{for(const c of m||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);re(this,"status");this.name="ApiError",this.status=s}}let R=null;function ne(e){R=e}let Q=null;function q(e){Q=e}async function V(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Fe(e){let r;try{r=await fetch("/v1/settings",{headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await V(r));return!0}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),Q&&s.set("Authorization",`Bearer ${Q}`);let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw R==null||R(),new E(a.status,await V(a));if(!a.ok)throw new E(a.status,await V(a));if(a.status!==204)return await a.json()}const O="otari.dashboard.masterKey",de=o.createContext(null);function Ke(){try{return window.sessionStorage.getItem(O)}catch{return null}}function Me({children:e}){const r=y(),[s,a]=o.useState(()=>{const h=Ke();return q(h),h}),n=o.useCallback(()=>{q(null),a(null),r.clear();try{window.sessionStorage.removeItem(O)}catch{}},[r]),l=o.useCallback(h=>{const u=h.trim();q(u),r.clear(),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[r]),m=o.useCallback(h=>{const u=h.trim();q(u),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[]);o.useEffect(()=>(ne(n),()=>ne(null)),[n]);const c=o.useMemo(()=>({masterKey:s,isAuthenticated:s!=null,login:l,replaceMasterKey:m,logout:n}),[s,l,m,n]);return t.jsx(de.Provider,{value:c,children:e})}function W(){const e=o.useContext(de);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ue(e){return e instanceof E&&e.status===0}function Be(){const e=y(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ue(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function $e(){return Be()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",F="pricing",me="settings",he="tool-settings",G="aliases",J="discoverable",Y="providers",X="provider-health",fe="stored-providers",ze="model-metadata",Qe="build",T="keys",_="budgets",xe="users",Z="usage",Ve=6e4,ae=60*6e4;function Ft(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function He(){return v({queryKey:[Qe],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Ve,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Kt(){return v({queryKey:[J],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[Y],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Ut(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Bt(){return v({queryKey:[X],queryFn:()=>i("/v1/providers/health"),staleTime:ae,refetchInterval:ae})}function $t(){const e=y();return x({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([X],r)})}function zt(){return v({queryKey:[fe],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function K(e){e.invalidateQueries({queryKey:[fe]}),e.invalidateQueries({queryKey:[Y]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]}),e.invalidateQueries({queryKey:[X]})}function Qt(){const e=y();return x({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>K(e)})}function Vt(){const e=y();return x({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>K(e)})}function Ht(){const e=y();return x({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>K(e)})}function Wt(){const e=y();return x({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>K(e)})}function Gt(){return x({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Jt(){return x({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Yt(){return v({queryKey:[ze],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Xt(){return v({queryKey:[G],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Zt(){const e=y();return x({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function er(){const e=y();return x({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function We(){return v({queryKey:[me],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function Ge(){const e=y();return x({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([me],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]})}})}function tr(){return x({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function rr(){return v({queryKey:[he],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function sr(){const e=y();return x({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([he],r)}})}function nr(){return x({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const M=1e3,Je=100;async function Ye(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function or(){const e=y();return x({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){return x({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function cr(){const e=y();return x({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[Y]})}})}function ur(){return x({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const U=1e3,Xe=100;async function Ze(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const B=1e3,et=100;async function tt(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function gr(){const e=y();return x({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=y();return x({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const $=1e3,rt=100;async function st(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>ee(e)})}function Sr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>ee(e)})}function kr(){const e=y();return x({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{ee(e),e.invalidateQueries({queryKey:[T]})}})}function te(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Pr(e,r,s){return v({queryKey:[Z,"list",e,r,s],queryFn:()=>{const a=te(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:H,staleTime:1e4})}function Er(e){return v({queryKey:[Z,"count",e],queryFn:()=>i(`/v1/usage/count?${te(e).toString()}`),placeholderData:H,staleTime:1e4})}function Nr(e,r,s=!0){return v({queryKey:[Z,"summary",e,r],queryFn:()=>{const a=te(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:H,staleTime:3e4})}function Cr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Tr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function _r(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ar(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${nt[s]} ${r[1]}`}const at=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Ir(e){return at.format(e)}function Lr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function it(e){return`${(e*100).toFixed(1)}%`}function qr(e,r){return r===void 0||r===0?null:(e-r)/r}function Rr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),m=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,h="second";for(const[p,g]of m){if(h=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",it(Math.abs(e))," vs prev"]})}function ot(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function lt({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:ot(e)}):null}function ct({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Fr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Kr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ut="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Mr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:m,disabled:c}){const h=o.useId(),u=e??(r?h:void 0),p=t.jsx("select",{id:u,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ut,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):m});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Ur({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:m=!1}){const c=f=>{var d;return((d=a.find(j=>j.value===f))==null?void 0:d.label)??f},[h,u]=o.useState(()=>c(r));o.useEffect(()=>{u(c(r))},[r]);const p=h.trim().toLowerCase(),g=a.filter(f=>!p||f.value.toLowerCase().includes(p)||f.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(L.Root,{allowsEmptyCollection:!0,allowsCustomValue:m,menuTrigger:"focus",inputValue:h,onInputChange:f=>{u(f),m?s(f.trim()):f.trim()===""&&s("")},onSelectionChange:f=>{f!=null&&s(String(f))},className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(L.InputGroup,{children:[t.jsx(ue,{placeholder:n,autoComplete:"off",onFocus:f=>f.currentTarget.select()}),t.jsx(L.Trigger,{})]}),t.jsx(L.Popover,{children:t.jsx(Ae,{items:g,className:"max-h-72 overflow-auto",children:f=>t.jsx(Ie,{id:f.value,textValue:f.label,children:f.label})})})]})}function dt(){var l;const e=We(),r=Ge(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(ct,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function mt(){const{data:e}=He(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function ht(){const e=mt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const ye=200,ve=480,z=240,ft=60,ge="otari.dashboard.sidebarWidth",pe="otari.dashboard.sidebarCollapsed",oe=16,D=e=>Math.min(ve,Math.max(ye,e));function xt(){if(typeof window>"u")return z;try{const e=window.localStorage.getItem(ge),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?z:D(r)}catch{return z}}function yt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pe)==="1"}catch{return!1}}const vt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],gt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function pt(){const{logout:e}=W(),r=o.useRef(null),[s,a]=o.useState(xt),[n,l]=o.useState(yt),[m,c]=o.useState(!1);o.useEffect(()=>{const d=window.setTimeout(()=>{try{window.localStorage.setItem(ge,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(d)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(pe,n?"1":"0")}catch{}},[n]);const h=o.useCallback(d=>{d.preventDefault(),d.currentTarget.setPointerCapture(d.pointerId),c(!0)},[]),u=o.useCallback(d=>{var A;if(!d.currentTarget.hasPointerCapture(d.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(D(d.clientX-j))},[]),p=o.useCallback(d=>{d.currentTarget.hasPointerCapture(d.pointerId)&&d.currentTarget.releasePointerCapture(d.pointerId),c(!1)},[]),g=o.useCallback(d=>{d.key==="ArrowLeft"?(d.preventDefault(),a(j=>D(j-oe))):d.key==="ArrowRight"&&(d.preventDefault(),a(j=>D(j+oe)))},[]),f=n?ft:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",m&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(ht,{}),t.jsx($e,{}),t.jsx(dt,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:f},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!m&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(d=>!d),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:vt.map((d,j)=>{const A=gt.filter(k=>k.section===d.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&d.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:d.label}):null,j>0&&(n||!d.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(le,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:je})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",je?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},d.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":ye,"aria-valuemax":ve,tabIndex:0,onPointerDown:h,onPointerMove:u,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",m?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Ne,{})})})]})]})}function bt(){const{login:e}=W(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,m]=o.useState(!1),c=async()=>{const h=r.trim();if(!(!h||l)){m(!0),n(null);try{await Fe(h)?e(h):n(new Error("Invalid master key."))}catch(u){n(u)}finally{m(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(I,{className:"w-full max-w-md",children:t.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:h=>{h.preventDefault(),c()},children:[t.jsxs(Le,{value:r,onChange:h=>{s(h),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(ue,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(lt,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is held only in this browser tab (session storage) and sent directly to this gateway."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(qe,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const jt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BS_KZH0z.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-O7ZGijD-.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-9zpV4nTH.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-DAGeWeBS.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DI7qj4qI.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Et=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BHX_G4X9.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,12,13,4,3]))).OverviewIndex})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-BJkEklg1.js");return{ProvidersPage:e}},__vite__mapDeps([14,1,2,6,4,3]))).ProvidersPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CLdo7bKV.js");return{SettingsPage:e}},__vite__mapDeps([15,1,2,4]))).SettingsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-OKm-s8Wi.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([16,1,2,4]))).ToolsGuardrailsPage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-DLrkG3qL.js");return{UsagePage:e}},__vite__mapDeps([17,1,2,12,13,4,3]))).UsagePage})),At=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-CNthhRRV.js");return{UsersPage:e}},__vite__mapDeps([18,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function It(){const{isAuthenticated:e}=W();return e?t.jsx(Ce,{children:t.jsx(Te,{children:t.jsxs(b,{element:t.jsx(pt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(At,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"*",element:t.jsx(_e,{to:"/",replace:!0})})]})})}):t.jsx(bt,{})}function Lt({children:e}){const[r]=o.useState(()=>new ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Pe,{client:r,children:t.jsx(Me,{children:e})})}const be=document.getElementById("root");if(!be)throw new Error("Root element #root not found");Re.createRoot(be).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(It,{})})}));export{lr as $,Ar as A,We as B,Kr as C,Tr as D,lt as E,Mr as F,ir as G,or as H,ct as I,Mt as J,Bt as K,qr as L,Ir as M,Dr as N,it as O,Fr as P,Rr as Q,zt as R,Or as S,Ht as T,Gt as U,Ge as V,Vt as W,$t as X,Ut as Y,Qt as Z,Jt as _,Pr as a,cr as a0,ur as a1,tr as a2,W as a3,Wt as a4,rr as a5,sr as a6,nr as a7,Lr as a8,kr as a9,wr as aa,Er as b,Nr as c,Ur as d,Kt as e,Xt as f,er as g,ot as h,Zt as i,yr as j,gr as k,pr as l,br as m,Sr as n,vr as o,dr as p,hr as q,fr as r,xr as s,mr as t,jr as u,Ft as v,ar as w,Yt as x,_r as y,Cr as z}; diff --git a/src/gateway/static/dashboard/assets/index-DFtD8NLS.css b/src/gateway/static/dashboard/assets/index-DFtD8NLS.css deleted file mode 100644 index 6a095ba3..00000000 --- a/src/gateway/static/dashboard/assets/index-DFtD8NLS.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\]{background-color:var(--otari-brand)}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-\[var\(--otari-brand\)\]{fill:var(--otari-brand)}.fill-\[var\(--otari-muted\)\]{fill:var(--otari-muted)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:w-0\.5:is(:where(.group):hover *){width:calc(var(--spacing) * .5)}.group-hover\:bg-\[var\(--otari-brand\)\]:is(:where(.group):hover *){background-color:var(--otari-brand)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover{background-color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:-2px}.focus-visible\:outline-\[var\(--otari-brand\)\]:focus-visible{outline-color:var(--otari-brand)}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/index-Dl_VAUga.css b/src/gateway/static/dashboard/assets/index-Dl_VAUga.css deleted file mode 100644 index 4eab1b93..00000000 --- a/src/gateway/static/dashboard/assets/index-Dl_VAUga.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\]{background-color:var(--otari-brand)}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-\[var\(--otari-brand\)\]{fill:var(--otari-brand)}.fill-\[var\(--otari-muted\)\]{fill:var(--otari-muted)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:w-0\.5:is(:where(.group):hover *){width:calc(var(--spacing) * .5)}.group-hover\:bg-\[var\(--otari-brand\)\]:is(:where(.group):hover *){background-color:var(--otari-brand)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover{background-color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:-2px}.focus-visible\:outline-\[var\(--otari-brand\)\]:focus-visible{outline-color:var(--otari-brand)}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/index-Dp4DdBFR.js b/src/gateway/static/dashboard/assets/index-Dp4DdBFR.js deleted file mode 100644 index 9d575bc2..00000000 --- a/src/gateway/static/dashboard/assets/index-Dp4DdBFR.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-D3mR-Vcr.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/Table-CLdjdyTx.js","assets/heroui-BX6JwHY-.js","assets/AliasesPage-DJtTC87k.js","assets/Field-HzRk1KDP.js","assets/BudgetsPage-BCAQ5J9W.js","assets/KeysPage-DIt3Gp89.js","assets/ModelScopeControl-D_p9BPKF.js","assets/ModelsPage-BR6bzhht.js","assets/OverviewPage-_Gja1ZBt.js","assets/charts-Cr3Dij9t.js","assets/recharts-CR3TAEof.js","assets/ProvidersPage-B6Y7usRU.js","assets/SettingsPage-CVx7wSlF.js","assets/ToolsGuardrailsPage-v1VWfWQq.js","assets/UsagePage-DtQni_qk.js","assets/UsersPage-BDaNeswz.js"])))=>i.map(i=>d[i]); -var we=Object.defineProperty;var Se=(e,r,s)=>r in e?we(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var re=(e,r,s)=>Se(e,typeof r!="symbol"?r+"":r,s);import{u as y,j as t,a as v,b as x,k as H,Q as ke,c as Pe}from"./tanstack-query-1t81HyiD.js";import{d as Ee,r as o,N as le,O as Ne,H as Ce,e as Te,f as b,h as _e}from"./react-dgEcD0HR.js";import{C as L,L as ce,I as ue,a as Ae,b as Ie,B as P,d as I,c as C,T as Le,e as qe}from"./heroui-BX6JwHY-.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Re=Ee();const Oe="modulepreload",De=function(e){return"/"+e},se={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let m=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=m(s.map(u=>{if(u=De(u),u in se)return;se[u]=!0;const p=u.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${g}`))return;const h=document.createElement("link");if(h.rel=p?"stylesheet":Oe,p||(h.as="script"),h.crossOrigin="",h.href=u,f&&h.setAttribute("nonce",f),document.head.appendChild(h),p)return new Promise((d,j)=>{h.addEventListener("load",d),h.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return n.then(m=>{for(const c of m||[])c.status==="rejected"&&l(c.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);re(this,"status");this.name="ApiError",this.status=s}}let R=null;function ne(e){R=e}let Q=null;function q(e){Q=e}async function V(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Fe(e){let r;try{r=await fetch("/v1/settings",{headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await V(r));return!0}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),Q&&s.set("Authorization",`Bearer ${Q}`);let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw R==null||R(),new E(a.status,await V(a));if(!a.ok)throw new E(a.status,await V(a));if(a.status!==204)return await a.json()}const O="otari.dashboard.masterKey",de=o.createContext(null);function Ke(){try{return window.sessionStorage.getItem(O)}catch{return null}}function Me({children:e}){const r=y(),[s,a]=o.useState(()=>{const f=Ke();return q(f),f}),n=o.useCallback(()=>{q(null),a(null),r.clear();try{window.sessionStorage.removeItem(O)}catch{}},[r]),l=o.useCallback(f=>{const u=f.trim();q(u),r.clear(),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[r]),m=o.useCallback(f=>{const u=f.trim();q(u),a(u);try{window.sessionStorage.setItem(O,u)}catch{}},[]);o.useEffect(()=>(ne(n),()=>ne(null)),[n]);const c=o.useMemo(()=>({masterKey:s,isAuthenticated:s!=null,login:l,replaceMasterKey:m,logout:n}),[s,l,m,n]);return t.jsx(de.Provider,{value:c,children:e})}function W(){const e=o.useContext(de);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ue(e){return e instanceof E&&e.status===0}function Be(){const e=y(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ue(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function $e(){return Be()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",F="pricing",me="settings",fe="tool-settings",G="aliases",J="discoverable",Y="providers",X="provider-health",he="stored-providers",ze="model-metadata",Qe="build",T="keys",_="budgets",xe="users",Z="usage",Ve=6e4,ae=60*6e4;function Ft(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function He(){return v({queryKey:[Qe],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Ve,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Kt(){return v({queryKey:[J],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[Y],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Ut(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Bt(e){return v({queryKey:["provider-catalog",e],queryFn:()=>i(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function $t(){return v({queryKey:[X],queryFn:()=>i("/v1/providers/health"),staleTime:ae,refetchInterval:ae})}function zt(){const e=y();return x({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([X],r)})}function Qt(){return v({queryKey:[he],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function K(e){e.invalidateQueries({queryKey:[he]}),e.invalidateQueries({queryKey:[Y]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]}),e.invalidateQueries({queryKey:[X]})}function Vt(){const e=y();return x({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>K(e)})}function Ht(){const e=y();return x({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>K(e)})}function Wt(){const e=y();return x({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>K(e)})}function Gt(){const e=y();return x({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>K(e)})}function Jt(){return x({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Yt(){return x({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Xt(){return v({queryKey:[ze],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Zt(){return v({queryKey:[G],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function er(){const e=y();return x({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function tr(){const e=y();return x({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]})}})}function We(){return v({queryKey:[me],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function Ge(){const e=y();return x({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([me],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[J]})}})}function rr(){return x({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function sr(){return v({queryKey:[fe],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function nr(){const e=y();return x({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([fe],r)}})}function ar(){return x({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const M=1e3,Je=100;async function Ye(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){const e=y();return x({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]})}})}function cr(){return x({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function ur(){const e=y();return x({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[F]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[Y]})}})}function dr(){return x({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const U=1e3,Xe=100;async function Ze(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function yr(){const e=y();return x({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const B=1e3,et=100;async function tt(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function pr(){const e=y();return x({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function jr(){const e=y();return x({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const $=1e3,rt=100;async function st(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>ee(e)})}function kr(){const e=y();return x({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>ee(e)})}function Pr(){const e=y();return x({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{ee(e),e.invalidateQueries({queryKey:[T]})}})}function te(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Er(e,r,s){return v({queryKey:[Z,"list",e,r,s],queryFn:()=>{const a=te(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:H,staleTime:1e4})}function Nr(e){return v({queryKey:[Z,"count",e],queryFn:()=>i(`/v1/usage/count?${te(e).toString()}`),placeholderData:H,staleTime:1e4})}function Cr(e,r,s=!0){return v({queryKey:[Z,"summary",e,r],queryFn:()=>{const a=te(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:H,staleTime:3e4})}function Tr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function _r(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function Ar(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ir(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${nt[s]} ${r[1]}`}const at=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Lr(e){return at.format(e)}function qr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function it(e){return`${(e*100).toFixed(1)}%`}function Rr(e,r){return r===void 0||r===0?null:(e-r)/r}function Or(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),m=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let c=l,f="second";for(const[p,g]of m){if(f=p,c0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",it(Math.abs(e))," vs prev"]})}function ot(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function lt({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:ot(e)}):null}function ct({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Kr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Mr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ut="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Ur({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:m,disabled:c}){const f=o.useId(),u=e??(r?f:void 0),p=t.jsx("select",{id:u,"aria-label":r?void 0:s,value:a,disabled:c,onChange:g=>n(g.target.value),className:ut,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):m});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Br({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:m=!1}){const c=h=>{var d;return((d=a.find(j=>j.value===h))==null?void 0:d.label)??h},[f,u]=o.useState(()=>c(r));o.useEffect(()=>{u(c(r))},[r]);const p=f.trim().toLowerCase(),g=a.filter(h=>!p||h.value.toLowerCase().includes(p)||h.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(L.Root,{allowsEmptyCollection:!0,allowsCustomValue:m,menuTrigger:"focus",inputValue:f,onInputChange:h=>{u(h),m?s(h.trim()):h.trim()===""&&s("")},onSelectionChange:h=>{h!=null&&s(String(h))},className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(L.InputGroup,{children:[t.jsx(ue,{placeholder:n,autoComplete:"off",onFocus:h=>h.currentTarget.select()}),t.jsx(L.Trigger,{})]}),t.jsx(L.Popover,{children:t.jsx(Ae,{items:g,className:"max-h-72 overflow-auto",children:h=>t.jsx(Ie,{id:h.value,textValue:h.label,children:h.label})})})]})}function dt(){var l;const e=We(),r=Ge(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(ct,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function mt(){const{data:e}=He(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function ft(){const e=mt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const ye=200,ve=480,z=240,ht=60,ge="otari.dashboard.sidebarWidth",pe="otari.dashboard.sidebarCollapsed",oe=16,D=e=>Math.min(ve,Math.max(ye,e));function xt(){if(typeof window>"u")return z;try{const e=window.localStorage.getItem(ge),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?z:D(r)}catch{return z}}function yt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pe)==="1"}catch{return!1}}const vt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],gt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function pt(){const{logout:e}=W(),r=o.useRef(null),[s,a]=o.useState(xt),[n,l]=o.useState(yt),[m,c]=o.useState(!1);o.useEffect(()=>{const d=window.setTimeout(()=>{try{window.localStorage.setItem(ge,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(d)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(pe,n?"1":"0")}catch{}},[n]);const f=o.useCallback(d=>{d.preventDefault(),d.currentTarget.setPointerCapture(d.pointerId),c(!0)},[]),u=o.useCallback(d=>{var A;if(!d.currentTarget.hasPointerCapture(d.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(D(d.clientX-j))},[]),p=o.useCallback(d=>{d.currentTarget.hasPointerCapture(d.pointerId)&&d.currentTarget.releasePointerCapture(d.pointerId),c(!1)},[]),g=o.useCallback(d=>{d.key==="ArrowLeft"?(d.preventDefault(),a(j=>D(j-oe))):d.key==="ArrowRight"&&(d.preventDefault(),a(j=>D(j+oe)))},[]),h=n?ht:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",m&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(ft,{}),t.jsx($e,{}),t.jsx(dt,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:h},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!m&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(d=>!d),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:vt.map((d,j)=>{const A=gt.filter(k=>k.section===d.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&d.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:d.label}):null,j>0&&(n||!d.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(le,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:je})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",je?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},d.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":ye,"aria-valuemax":ve,tabIndex:0,onPointerDown:f,onPointerMove:u,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",m?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Ne,{})})})]})]})}function bt(){const{login:e}=W(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,m]=o.useState(!1),c=async()=>{const f=r.trim();if(!(!f||l)){m(!0),n(null);try{await Fe(f)?e(f):n(new Error("Invalid master key."))}catch(u){n(u)}finally{m(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(I,{className:"w-full max-w-md",children:t.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),c()},children:[t.jsxs(Le,{value:r,onChange:f=>{s(f),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(ce,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(ue,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(lt,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is held only in this browser tab (session storage) and sent directly to this gateway."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(qe,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const jt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-D3mR-Vcr.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-DJtTC87k.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-BCAQ5J9W.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-DIt3Gp89.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-BR6bzhht.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Et=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-_Gja1ZBt.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,12,13,4,3]))).OverviewIndex})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-B6Y7usRU.js");return{ProvidersPage:e}},__vite__mapDeps([14,1,2,6,4,3]))).ProvidersPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CVx7wSlF.js");return{SettingsPage:e}},__vite__mapDeps([15,1,2,4]))).SettingsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-v1VWfWQq.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([16,1,2,4]))).ToolsGuardrailsPage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-DtQni_qk.js");return{UsagePage:e}},__vite__mapDeps([17,1,2,12,13,4,3]))).UsagePage})),At=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-BDaNeswz.js");return{UsersPage:e}},__vite__mapDeps([18,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function It(){const{isAuthenticated:e}=W();return e?t.jsx(Ce,{children:t.jsx(Te,{children:t.jsxs(b,{element:t.jsx(pt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(At,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"*",element:t.jsx(_e,{to:"/",replace:!0})})]})})}):t.jsx(bt,{})}function Lt({children:e}){const[r]=o.useState(()=>new ke({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Pe,{client:r,children:t.jsx(Me,{children:e})})}const be=document.getElementById("root");if(!be)throw new Error("Root element #root not found");Re.createRoot(be).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(It,{})})}));export{Yt as $,Ir as A,We as B,Mr as C,_r as D,lt as E,Ur as F,or as G,lr as H,ct as I,Mt as J,$t as K,Rr as L,Lr as M,Fr as N,it as O,Kr as P,Or as Q,Qt as R,Dr as S,Wt as T,Jt as U,Ge as V,Ht as W,zt as X,Vt as Y,Bt as Z,Ut as _,Er as a,cr as a0,ur as a1,dr as a2,rr as a3,W as a4,Gt as a5,sr as a6,nr as a7,ar as a8,qr as a9,Pr as aa,Sr as ab,Nr as b,Cr as c,Br as d,Kt as e,Zt as f,tr as g,ot as h,er as i,vr as j,pr as k,br as l,jr as m,kr as n,gr as o,mr as p,hr as q,xr as r,yr as s,fr as t,wr as u,Ft as v,ir as w,Xt as x,Ar as y,Tr as z}; diff --git a/src/gateway/static/dashboard/assets/index-hDVMDLdX.js b/src/gateway/static/dashboard/assets/index-hDVMDLdX.js new file mode 100644 index 00000000..8e5edfb3 --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-hDVMDLdX.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-Ixi7_M5Z.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/Table-CLdjdyTx.js","assets/heroui-BX6JwHY-.js","assets/AliasesPage-BZiGtRPE.js","assets/Field-HzRk1KDP.js","assets/BudgetsPage-D0M-Cd5s.js","assets/KeysPage-CQj72SEP.js","assets/ModelScopeControl-DX341Q9L.js","assets/ModelsPage-BIdxI_hW.js","assets/OverviewPage-CtvPFoWc.js","assets/charts-Cr3Dij9t.js","assets/recharts-CR3TAEof.js","assets/ProvidersPage-DimvEH7H.js","assets/SettingsPage-iRP-TsYX.js","assets/ToolsGuardrailsPage-B3QvV7KI.js","assets/UsagePage-CsWlUWCg.js","assets/UsersPage-ETfq5MXh.js"])))=>i.map(i=>d[i]); +var be=Object.defineProperty;var je=(e,r,s)=>r in e?be(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var ee=(e,r,s)=>je(e,typeof r!="symbol"?r+"":r,s);import{u as x,j as t,a as v,b as f,k as Q,Q as we,c as Se}from"./tanstack-query-1t81HyiD.js";import{d as ke,r as o,N as ie,O as Pe,H as Ee,e as Ne,f as b,h as Ce}from"./react-dgEcD0HR.js";import{C as I,L as oe,I as le,a as Te,b as _e,B as P,d as L,c as C,T as Ae,e as Le}from"./heroui-BX6JwHY-.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=s(n);fetch(n.href,l)}})();var Ie=ke();const qe="modulepreload",Re=function(e){return"/"+e},te={},S=function(r,s,a){let n=Promise.resolve();if(s&&s.length>0){let d=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),y=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));n=d(s.map(h=>{if(h=Re(h),h in te)return;te[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":qe,p||(m.as="script"),m.crossOrigin="",m.href=h,y&&m.setAttribute("nonce",y),document.head.appendChild(m),p)return new Promise((c,j)=>{m.addEventListener("load",c),m.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(d){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=d,window.dispatchEvent(u),!u.defaultPrevented)throw d}return n.then(d=>{for(const u of d||[])u.status==="rejected"&&l(u.reason);return r().catch(l)})};class E extends Error{constructor(s,a){super(a);ee(this,"status");this.name="ApiError",this.status=s}}let q=null;function re(e){q=e}async function $(e){try{const r=await e.json();if(typeof r.detail=="string")return r.detail;if(r.detail!=null)return JSON.stringify(r.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Oe(e){let r;try{r=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(r.status===401||r.status===403)return!1;if(!r.ok)throw new E(r.status,await $(r));return!0}async function De(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function i(e,r={}){const s=new Headers(r.headers);s.set("Accept","application/json"),r.body!=null&&!s.has("Content-Type")&&s.set("Content-Type","application/json");let a;try{a=await fetch(e,{...r,headers:s})}catch{throw new E(0,"Network error: could not reach the gateway.")}if(a.status===401||a.status===403)throw q==null||q(),new E(a.status,await $(a));if(!a.ok)throw new E(a.status,await $(a));if(a.status!==204)return await a.json()}const z="otari.dashboard.hasSession",ce=o.createContext(null);function Fe(){try{return window.localStorage.getItem(z)==="1"}catch{return!1}}function Me({children:e}){const r=x(),[s,a]=o.useState(Fe),n=o.useCallback(()=>{De(),a(!1),r.clear();try{window.localStorage.removeItem(z)}catch{}},[r]),l=o.useCallback(()=>{r.clear(),a(!0);try{window.localStorage.setItem(z,"1")}catch{}},[r]);o.useEffect(()=>(re(n),()=>re(null)),[n]);const d=o.useMemo(()=>({isAuthenticated:s,login:l,logout:n}),[s,l,n]);return t.jsx(ce.Provider,{value:d,children:e})}function V(){const e=o.useContext(ce);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Ke(e){return e instanceof E&&e.status===0}function Ue(){const e=x(),[r,s]=o.useState(!1);return o.useEffect(()=>{const a=e.getQueryCache(),n=()=>a.getAll().some(l=>l.state.status==="error"&&Ke(l.state.error));return s(n()),a.subscribe(()=>s(n()))},[e]),r}function Be(){return Ue()?t.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const N="models",O="pricing",ue="settings",de="tool-settings",H="aliases",W="discoverable",G="providers",J="provider-health",me="stored-providers",$e="model-metadata",ze="build",T="keys",_="budgets",fe="users",Y="usage",Qe=6e4,se=60*6e4;function Dt(){return v({queryKey:[N],queryFn:()=>i("/v1/models"),staleTime:6e4})}function Ve(){return v({queryKey:[ze],queryFn:()=>i("/dashboard-build.json"),refetchInterval:Qe,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function Ft(){return v({queryKey:[W],queryFn:()=>i("/v1/models/discoverable"),staleTime:5*6e4})}function Mt(){return v({queryKey:[G],queryFn:()=>i("/v1/providers"),staleTime:5*6e4})}function Kt(){return v({queryKey:["provider-catalog"],queryFn:()=>i("/v1/providers/catalog"),staleTime:1/0})}function Ut(e){return v({queryKey:["provider-catalog",e],queryFn:()=>i(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Bt(){return v({queryKey:[J],queryFn:()=>i("/v1/providers/health"),staleTime:se,refetchInterval:se})}function $t(){const e=x();return f({mutationFn:()=>i("/v1/providers/health?refresh=true"),onSuccess:r=>e.setQueryData([J],r)})}function zt(){return v({queryKey:[me],queryFn:()=>i("/v1/provider-credentials"),staleTime:6e4})}function D(e){e.invalidateQueries({queryKey:[me]}),e.invalidateQueries({queryKey:[G]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]}),e.invalidateQueries({queryKey:[J]})}function Qt(){const e=x();return f({mutationFn:r=>i("/v1/provider-credentials",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>D(e)})}function Vt(){const e=x();return f({mutationFn:({instance:r,body:s})=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>D(e)})}function Ht(){const e=x();return f({mutationFn:r=>i(`/v1/provider-credentials/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>D(e)})}function Wt(){const e=x();return f({mutationFn:()=>i("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>D(e)})}function Gt(){return f({mutationFn:e=>i(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function Jt(){return f({mutationFn:e=>i("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function Yt(){return v({queryKey:[$e],queryFn:()=>i("/v1/models/metadata"),staleTime:10*6e4})}function Xt(){return v({queryKey:[H],queryFn:()=>i("/v1/aliases"),staleTime:6e4})}function Zt(){const e=x();return f({mutationFn:r=>i("/v1/aliases",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function er(){const e=x();return f({mutationFn:r=>i(`/v1/aliases/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[H]}),e.invalidateQueries({queryKey:[N]})}})}function He(){return v({queryKey:[ue],queryFn:()=>i("/v1/settings"),staleTime:6e4})}function We(){const e=x();return f({mutationFn:r=>i("/v1/settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([ue],r),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[W]})}})}function tr(){return f({mutationFn:()=>i("/v1/settings/master-key/rotate",{method:"POST"})})}function rr(){return v({queryKey:[de],queryFn:()=>i("/v1/tool-settings"),staleTime:6e4})}function sr(){const e=x();return f({mutationFn:r=>i("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(r)}),onSuccess:r=>{e.setQueryData([de],r)}})}function nr(){return f({mutationFn:({service:e,url:r})=>i(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:r})})})}const F=1e3,Ge=100;async function Je(){const e=[];for(let r=0;ri("/v1/pricing",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function or(){const e=x();return f({mutationFn:r=>i(`/v1/pricing/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]})}})}function lr(){return f({mutationFn:()=>i("/v1/pricing/refresh",{method:"POST"})})}function cr(){const e=x();return f({mutationFn:()=>i("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]}),e.invalidateQueries({queryKey:[N]}),e.invalidateQueries({queryKey:[G]})}})}function ur(){return f({mutationFn:()=>i("/v1/pricing/refresh/reject",{method:"POST"})})}const M=1e3,Ye=100;async function Xe(){const e=[];for(let r=0;ri("/v1/keys",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function fr(){const e=x();return f({mutationFn:({id:r,body:s})=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function hr(){const e=x();return f({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}function xr(){const e=x();return f({mutationFn:r=>i(`/v1/keys/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[T]})})}const K=1e3,Ze=100;async function et(){const e=[];for(let r=0;ri(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function gr(){const e=x();return f({mutationFn:r=>i("/v1/budgets",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function pr(){const e=x();return f({mutationFn:({id:r,body:s})=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}function br(){const e=x();return f({mutationFn:r=>i(`/v1/budgets/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[_]})})}const U=1e3,tt=100;async function rt(){const e=[];for(let r=0;ri("/v1/users",{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>X(e)})}function Sr(){const e=x();return f({mutationFn:({id:r,body:s})=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(s)}),onSuccess:()=>X(e)})}function kr(){const e=x();return f({mutationFn:r=>i(`/v1/users/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:[T]})}})}function Z(e){const r=new URLSearchParams;return e.start_date&&r.set("start_date",e.start_date),e.end_date&&r.set("end_date",e.end_date),e.status&&r.set("status",e.status),e.model&&r.set("model",e.model),e.endpoint&&r.set("endpoint",e.endpoint),e.user_id&&r.set("user_id",e.user_id),r}function Pr(e,r,s){return v({queryKey:[Y,"list",e,r,s],queryFn:()=>{const a=Z(e);return a.set("skip",String(r*s)),a.set("limit",String(s)),i(`/v1/usage?${a.toString()}`)},placeholderData:Q,staleTime:1e4})}function Er(e){return v({queryKey:[Y,"count",e],queryFn:()=>i(`/v1/usage/count?${Z(e).toString()}`),placeholderData:Q,staleTime:1e4})}function Nr(e,r,s=!0){return v({queryKey:[Y,"summary",e,r],queryFn:()=>{const a=Z(e);return a.set("bucket",r),i(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:Q,staleTime:3e4})}function Cr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function Tr(e){if(e==null)return"$0.00";const r=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:r}).format(e)}function _r(e){if(e==null)return"—";if(e>=1e6){const r=e/1e6;return`${Number.isInteger(r)?r:r.toFixed(1)}M`}if(e>=1e3){const r=Math.round(e/1e3);return r>=1e3?"1M":`${r}K`}return String(e)}const st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ar(e){if(!e)return"—";const r=/^(\d{4})-(\d{2})/.exec(e);if(!r)return e;const s=Number(r[2])-1;return s<0||s>11?r[1]:`${st[s]} ${r[1]}`}const nt=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function Lr(e){return nt.format(e)}function Ir(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function at(e){return`${(e*100).toFixed(1)}%`}function qr(e,r){return r===void 0||r===0?null:(e-r)/r}function Rr(e,r=Date.now()){if(!e)return"never";const s=new Date(e);if(Number.isNaN(s.getTime()))return e;const a=Math.round((r-s.getTime())/1e3),n=a<0,l=Math.abs(a),d=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let u=l,y="second";for(const[p,g]of d){if(y=p,u0?"▲":e<0?"▼":"•";return t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r," ",at(Math.abs(e))," vs prev"]})}function it(e){return e instanceof E||e instanceof Error?e.message:"Something went wrong."}function ot({error:e}){return e?t.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:it(e)}):null}function lt({tone:e="info",children:r}){const s=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return t.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${s}`,children:r})}function Fr({title:e,description:r,action:s}){return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),r?t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:r}):null]}),s?t.jsx("div",{className:"flex flex-wrap gap-2",children:s}):null]})}function Mr({children:e,confirmLabel:r,onConfirm:s,isPending:a}){const[n,l]=o.useState(!1);return n?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(P,{size:"sm",variant:"danger",isDisabled:a,onPress:s,children:r}),t.jsx(P,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>l(!1),children:"Cancel"})]}):t.jsx(P,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:e})}const ct="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Kr({id:e,label:r,ariaLabel:s,value:a,onChange:n,options:l,children:d,disabled:u}){const y=o.useId(),h=e??(r?y:void 0),p=t.jsx("select",{id:h,"aria-label":r?void 0:s,value:a,disabled:u,onChange:g=>n(g.target.value),className:ct,children:l?l.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)):d});return r?t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{htmlFor:h,className:"text-xs font-medium text-[var(--otari-muted)]",children:r}),p]}):p}function Ur({label:e,value:r,onChange:s,options:a,placeholder:n,maxVisible:l=50,allowsCustom:d=!1}){const u=m=>{var c;return((c=a.find(j=>j.value===m))==null?void 0:c.label)??m},[y,h]=o.useState(()=>u(r));o.useEffect(()=>{h(u(r))},[r]);const p=y.trim().toLowerCase(),g=a.filter(m=>!p||m.value.toLowerCase().includes(p)||m.label.toLowerCase().includes(p)).slice(0,l);return t.jsxs(I.Root,{allowsEmptyCollection:!0,allowsCustomValue:d,menuTrigger:"focus",inputValue:y,onInputChange:m=>{h(m),d?s(m.trim()):m.trim()===""&&s("")},onSelectionChange:m=>{m!=null&&s(String(m))},className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),t.jsxs(I.InputGroup,{children:[t.jsx(le,{placeholder:n,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),t.jsx(I.Trigger,{})]}),t.jsx(I.Popover,{children:t.jsx(Te,{items:g,className:"max-h-72 overflow-auto",children:m=>t.jsx(_e,{id:m.value,textValue:m.label,children:m.label})})})]})}function ut(){var l;const e=He(),r=We(),[s,a]=o.useState(!1);return!(((l=e.data)==null?void 0:l.require_pricing)===!0&&e.data.default_pricing===!1)||s?null:t.jsx("div",{className:"shrink-0 px-6 pt-3",children:t.jsx(lt,{tone:"warning",children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("span",{children:["Requests are rejected until pricing is set (",t.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away."]}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(P,{size:"sm",variant:"primary",isDisabled:r.isPending,onPress:()=>r.mutate({default_pricing:!0}),children:r.isPending?"Enabling…":"Enable default pricing"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>a(!0),children:"Dismiss"})]})]})})})}function dt(){const{data:e}=Ve(),r=o.useRef(null);return e&&r.current===null&&(r.current=e.build),e!=null&&r.current!=null&&e.build!==r.current}function mt(){const e=dt(),[r,s]=o.useState(!1);return!e||r?null:t.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:t.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[t.jsxs("span",{children:[t.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),t.jsx(P,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),t.jsx(P,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Later"})]})})}const he=200,xe=480,B=240,ft=60,ye="otari.dashboard.sidebarWidth",ve="otari.dashboard.sidebarCollapsed",ae=16,R=e=>Math.min(xe,Math.max(he,e));function ht(){if(typeof window>"u")return B;try{const e=window.localStorage.getItem(ye),r=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(r)?B:R(r)}catch{return B}}function xt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ve)==="1"}catch{return!1}}const yt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],vt=[{to:"/",section:"home",label:"Overview",end:!0,icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:t.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),t.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),t.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),t.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function gt(){const{logout:e}=V(),r=o.useRef(null),[s,a]=o.useState(ht),[n,l]=o.useState(xt),[d,u]=o.useState(!1);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ye,String(Math.round(s)))}catch{}},200);return()=>window.clearTimeout(c)},[s]),o.useEffect(()=>{try{window.localStorage.setItem(ve,n?"1":"0")}catch{}},[n]);const y=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),u(!0)},[]),h=o.useCallback(c=>{var A;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const j=((A=r.current)==null?void 0:A.getBoundingClientRect().left)??0;a(R(c.clientX-j))},[]),p=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),u(!1)},[]),g=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),a(j=>R(j-ae))):c.key==="ArrowRight"&&(c.preventDefault(),a(j=>R(j+ae)))},[]),m=n?ft:s;return t.jsxs("div",{className:C("relative flex h-full flex-col overflow-hidden",d&&"cursor-col-resize select-none"),children:[t.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),t.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),t.jsx(P,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),t.jsx(mt,{}),t.jsx(Be,{}),t.jsx(ut,{}),t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("aside",{ref:r,style:{width:m},className:C("relative flex shrink-0 flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)]",!d&&"transition-[width] duration-150"),children:[t.jsx("button",{type:"button",onClick:()=>l(c=>!c),"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-pressed":n,title:n?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:C("h-3.5 w-3.5 transition-transform",n&&"rotate-180"),children:t.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("nav",{className:C("flex flex-col py-4",n?"px-2":"px-3"),children:yt.map((c,j)=>{const A=vt.filter(k=>k.section===c.key);return A.length===0?null:t.jsxs("div",{className:j>0?"mt-4":void 0,children:[!n&&c.label?t.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,j>0&&(n||!c.label)?t.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,t.jsx("div",{className:"flex flex-col gap-1",children:A.map(k=>t.jsxs(ie,{to:k.to,end:k.end,"aria-label":n?k.label:void 0,title:n?k.label:void 0,className:({isActive:pe})=>C("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",n?"justify-center px-0":"gap-3 px-3",pe?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,n?null:k.label]},k.to))})]},c.key)})}),t.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai — the hosted Otari gateway",className:C("mt-auto mb-3 flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",n?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:t.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),n?null:t.jsxs("span",{className:"flex-1",children:["otari.ai ",t.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}),n?null:t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(s),"aria-valuemin":he,"aria-valuemax":xe,tabIndex:0,onPointerDown:y,onPointerMove:h,onPointerUp:p,onKeyDown:g,className:C("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",d?"bg-[var(--otari-brand)]":"bg-transparent")})]}),t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-6 py-6",children:t.jsx(Pe,{})})})]})]})}function pt(){const{login:e}=V(),[r,s]=o.useState(""),[a,n]=o.useState(null),[l,d]=o.useState(!1),u=async()=>{const y=r.trim();if(!(!y||l)){d(!0),n(null);try{await Oe(y)?e():n(new Error("Invalid master key."))}catch(h){n(h)}finally{d(!1)}}};return t.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:t.jsx(L,{className:"w-full max-w-md",children:t.jsxs(L.Content,{className:"flex flex-col gap-5 p-7",children:[t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[t.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:y=>{y.preventDefault(),u()},children:[t.jsxs(Ae,{value:r,onChange:y=>{s(y),a&&n(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[t.jsx(oe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),t.jsx(le,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),t.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[t.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),t.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",t.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",t.jsx("code",{children:"Your master key:"})," (for example, run"," ",t.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),t.jsx(ot,{error:a}),t.jsx(P,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!r.trim()||l,children:l?"Signing in…":"Sign in"})]}),t.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),t.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:t.jsx(Le,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const bt=o.lazy(async()=>({default:(await S(async()=>{const{ActivityPage:e}=await import("./ActivityPage-Ixi7_M5Z.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4]))).ActivityPage})),jt=o.lazy(async()=>({default:(await S(async()=>{const{AliasesPage:e}=await import("./AliasesPage-BZiGtRPE.js");return{AliasesPage:e}},__vite__mapDeps([5,1,2,6,4,3]))).AliasesPage})),wt=o.lazy(async()=>({default:(await S(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-D0M-Cd5s.js");return{BudgetsPage:e}},__vite__mapDeps([7,1,2,6,4,3]))).BudgetsPage})),St=o.lazy(async()=>({default:(await S(async()=>{const{KeysPage:e}=await import("./KeysPage-CQj72SEP.js");return{KeysPage:e}},__vite__mapDeps([8,1,2,6,4,9,3]))).KeysPage})),kt=o.lazy(async()=>({default:(await S(async()=>{const{ModelsPage:e}=await import("./ModelsPage-BIdxI_hW.js");return{ModelsPage:e}},__vite__mapDeps([10,1,2,3,4]))).ModelsPage})),Pt=o.lazy(async()=>({default:(await S(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-CtvPFoWc.js");return{OverviewIndex:e}},__vite__mapDeps([11,1,2,12,13,4,3]))).OverviewIndex})),Et=o.lazy(async()=>({default:(await S(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-DimvEH7H.js");return{ProvidersPage:e}},__vite__mapDeps([14,1,2,6,4,3]))).ProvidersPage})),Nt=o.lazy(async()=>({default:(await S(async()=>{const{SettingsPage:e}=await import("./SettingsPage-iRP-TsYX.js");return{SettingsPage:e}},__vite__mapDeps([15,1,2,4]))).SettingsPage})),Ct=o.lazy(async()=>({default:(await S(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-B3QvV7KI.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([16,1,2,4]))).ToolsGuardrailsPage})),Tt=o.lazy(async()=>({default:(await S(async()=>{const{UsagePage:e}=await import("./UsagePage-CsWlUWCg.js");return{UsagePage:e}},__vite__mapDeps([17,1,2,12,13,4,3]))).UsagePage})),_t=o.lazy(async()=>({default:(await S(async()=>{const{UsersPage:e}=await import("./UsersPage-ETfq5MXh.js");return{UsersPage:e}},__vite__mapDeps([18,1,2,6,4,9,3]))).UsersPage}));function w(e){return t.jsx(o.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function At(){const{isAuthenticated:e}=V();return e?t.jsx(Ee,{children:t.jsx(Ne,{children:t.jsxs(b,{element:t.jsx(gt,{}),children:[t.jsx(b,{index:!0,element:w(t.jsx(Pt,{}))}),t.jsx(b,{path:"providers",element:w(t.jsx(Et,{}))}),t.jsx(b,{path:"keys",element:w(t.jsx(St,{}))}),t.jsx(b,{path:"users",element:w(t.jsx(_t,{}))}),t.jsx(b,{path:"budgets",element:w(t.jsx(wt,{}))}),t.jsx(b,{path:"activity",element:w(t.jsx(bt,{}))}),t.jsx(b,{path:"usage",element:w(t.jsx(Tt,{}))}),t.jsx(b,{path:"models",element:w(t.jsx(kt,{}))}),t.jsx(b,{path:"aliases",element:w(t.jsx(jt,{}))}),t.jsx(b,{path:"tools",element:w(t.jsx(Ct,{}))}),t.jsx(b,{path:"settings",element:w(t.jsx(Nt,{}))}),t.jsx(b,{path:"*",element:t.jsx(Ce,{to:"/",replace:!0})})]})})}):t.jsx(pt,{})}function Lt({children:e}){const[r]=o.useState(()=>new we({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(s,a)=>a instanceof E&&(a.status===401||a.status===403)?!1:s<2}}}));return t.jsx(Se,{client:r,children:t.jsx(Me,{children:e})})}const ge=document.getElementById("root");if(!ge)throw new Error("Root element #root not found");Ie.createRoot(ge).render(t.jsx(o.StrictMode,{children:t.jsx(Lt,{children:t.jsx(At,{})})}));export{Jt as $,Ar as A,He as B,Mr as C,Tr as D,ot as E,Kr as F,ir as G,or as H,lt as I,Mt as J,Bt as K,qr as L,Lr as M,Dr as N,at as O,Fr as P,Rr as Q,zt as R,Or as S,Ht as T,Gt as U,We as V,Vt as W,$t as X,Qt as Y,Ut as Z,Kt as _,Pr as a,lr as a0,cr as a1,ur as a2,tr as a3,Wt as a4,rr as a5,sr as a6,nr as a7,Ir as a8,kr as a9,wr as aa,Er as b,Nr as c,Ur as d,Ft as e,Xt as f,er as g,it as h,Zt as i,yr as j,gr as k,pr as l,br as m,Sr as n,vr as o,dr as p,fr as q,hr as r,xr as s,mr as t,jr as u,Dt as v,ar as w,Yt as x,_r as y,Cr as z}; diff --git a/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js b/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js deleted file mode 100644 index efce07b7..00000000 --- a/src/gateway/static/dashboard/assets/react-q-ooZ0ti.js +++ /dev/null @@ -1,52 +0,0 @@ -function od(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var _c={exports:{}},k={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Wh;function ev(){if(Wh)return k;Wh=1;var f=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.iterator;function Z(g){return g===null||typeof g!="object"?null:(g=B&&g[B]||g["@@iterator"],typeof g=="function"?g:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,L={};function q(g,H,Y){this.props=g,this.context=H,this.refs=L,this.updater=Y||V}q.prototype.isReactComponent={},q.prototype.setState=function(g,H){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,H,"setState")},q.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function W(){}W.prototype=q.prototype;function w(g,H,Y){this.props=g,this.context=H,this.refs=L,this.updater=Y||V}var mt=w.prototype=new W;mt.constructor=w,G(mt,q.prototype),mt.isPureReactComponent=!0;var st=Array.isArray;function Et(){}var F={H:null,A:null,T:null,S:null},Mt=Object.prototype.hasOwnProperty;function Kt(g,H,Y){var X=Y.ref;return{$$typeof:f,type:g,key:H,ref:X!==void 0?X:null,props:Y}}function Hl(g,H){return Kt(g.type,H,g.props)}function yl(g){return typeof g=="object"&&g!==null&&g.$$typeof===f}function Jt(g){var H={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(Y){return H[Y]})}var Bl=/\/+/g;function vl(g,H){return typeof g=="object"&&g!==null&&g.key!=null?Jt(""+g.key):H.toString(36)}function Nt(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(Et,Et):(g.status="pending",g.then(function(H){g.status==="pending"&&(g.status="fulfilled",g.value=H)},function(H){g.status==="pending"&&(g.status="rejected",g.reason=H)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function U(g,H,Y,X,I){var lt=typeof g;(lt==="undefined"||lt==="boolean")&&(g=null);var ot=!1;if(g===null)ot=!0;else switch(lt){case"bigint":case"string":case"number":ot=!0;break;case"object":switch(g.$$typeof){case f:case o:ot=!0;break;case D:return ot=g._init,U(ot(g._payload),H,Y,X,I)}}if(ot)return I=I(g),ot=X===""?"."+vl(g,0):X,st(I)?(Y="",ot!=null&&(Y=ot.replace(Bl,"$&/")+"/"),U(I,H,Y,"",function(xa){return xa})):I!=null&&(yl(I)&&(I=Hl(I,Y+(I.key==null||g&&g.key===I.key?"":(""+I.key).replace(Bl,"$&/")+"/")+ot)),H.push(I)),1;ot=0;var $t=X===""?".":X+":";if(st(g))for(var Dt=0;Dt>>1,pt=U[yt];if(0>>1;ytd(Y,$))Xd(I,Y)?(U[yt]=I,U[X]=$,yt=X):(U[yt]=Y,U[H]=$,yt=H);else if(Xd(I,$))U[yt]=I,U[X]=$,yt=X;else break t}}return x}function d(U,x){var $=U.sortIndex-x.sortIndex;return $!==0?$:U.id-x.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;f.unstable_now=function(){return v.now()}}else{var b=Date,O=b.now();f.unstable_now=function(){return b.now()-O}}var p=[],y=[],D=1,R=null,B=3,Z=!1,V=!1,G=!1,L=!1,q=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function mt(U){for(var x=s(y);x!==null;){if(x.callback===null)c(y);else if(x.startTime<=U)c(y),x.sortIndex=x.expirationTime,o(p,x);else break;x=s(y)}}function st(U){if(G=!1,mt(U),!V)if(s(p)!==null)V=!0,Et||(Et=!0,Jt());else{var x=s(y);x!==null&&Nt(st,x.startTime-U)}}var Et=!1,F=-1,Mt=5,Kt=-1;function Hl(){return L?!0:!(f.unstable_now()-KtU&&Hl());){var yt=R.callback;if(typeof yt=="function"){R.callback=null,B=R.priorityLevel;var pt=yt(R.expirationTime<=U);if(U=f.unstable_now(),typeof pt=="function"){R.callback=pt,mt(U),x=!0;break l}R===s(p)&&c(p),mt(U)}else c(p);R=s(p)}if(R!==null)x=!0;else{var g=s(y);g!==null&&Nt(st,g.startTime-U),x=!1}}break t}finally{R=null,B=$,Z=!1}x=void 0}}finally{x?Jt():Et=!1}}}var Jt;if(typeof w=="function")Jt=function(){w(yl)};else if(typeof MessageChannel<"u"){var Bl=new MessageChannel,vl=Bl.port2;Bl.port1.onmessage=yl,Jt=function(){vl.postMessage(null)}}else Jt=function(){q(yl,0)};function Nt(U,x){F=q(function(){U(f.unstable_now())},x)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(U){U.callback=null},f.unstable_forceFrameRate=function(U){0>U||125yt?(U.sortIndex=$,o(y,U),s(p)===null&&U===s(y)&&(G?(W(F),F=-1):G=!0,Nt(st,$-yt))):(U.sortIndex=pt,o(p,U),V||Z||(V=!0,Et||(Et=!0,Jt()))),U},f.unstable_shouldYield=Hl,f.unstable_wrapCallback=function(U){var x=B;return function(){var $=B;B=x;try{return U.apply(this,arguments)}finally{B=$}}}})(Dc)),Dc}var Ih;function uv(){return Ih||(Ih=1,Mc.exports=av()),Mc.exports}var Uc={exports:{}},wt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ph;function nv(){if(Ph)return wt;Ph=1;var f=Yc();function o(p){var y="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(o){console.error(o)}}return f(),Uc.exports=nv(),Uc.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ld;function iv(){if(ld)return Mu;ld=1;var f=uv(),o=Yc(),s=sd();function c(t){var l="https://react.dev/errors/"+t;if(1pt||(t.current=yt[pt],yt[pt]=null,pt--)}function Y(t,l){pt++,yt[pt]=t.current,t.current=l}var X=g(null),I=g(null),lt=g(null),ot=g(null);function $t(t,l){switch(Y(lt,l),Y(I,t),Y(X,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?Sh(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=Sh(l),t=ph(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(X),Y(X,t)}function Dt(){H(X),H(I),H(lt)}function xa(t){t.memoizedState!==null&&Y(ot,t);var l=X.current,e=ph(l,t.type);l!==e&&(Y(I,t),Y(X,e))}function Hu(t){I.current===t&&(H(X),H(I)),ot.current===t&&(H(ot),Au._currentValue=$)}var fi,wc;function De(t){if(fi===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);fi=l&&l[1]||"",wc=-1)":-1u||h[a]!==T[u]){var M=` -`+h[a].replace(" at new "," at ");return t.displayName&&M.includes("")&&(M=M.replace("",t.displayName)),M}while(1<=a&&0<=u);break}}}finally{ci=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?De(e):""}function Hd(t,l){switch(t.tag){case 26:case 27:case 5:return De(t.type);case 16:return De("Lazy");case 13:return t.child!==l&&l!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return ri(t.type,!1);case 11:return ri(t.type.render,!1);case 1:return ri(t.type,!0);case 31:return De("Activity");default:return""}}function $c(t){try{var l="",e=null;do l+=Hd(t,e),e=t,t=t.return;while(t);return l}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var oi=Object.prototype.hasOwnProperty,si=f.unstable_scheduleCallback,hi=f.unstable_cancelCallback,Bd=f.unstable_shouldYield,xd=f.unstable_requestPaint,al=f.unstable_now,qd=f.unstable_getCurrentPriorityLevel,Wc=f.unstable_ImmediatePriority,Fc=f.unstable_UserBlockingPriority,Bu=f.unstable_NormalPriority,Yd=f.unstable_LowPriority,kc=f.unstable_IdlePriority,Ld=f.log,Gd=f.unstable_setDisableYieldValue,qa=null,ul=null;function ue(t){if(typeof Ld=="function"&&Gd(t),ul&&typeof ul.setStrictMode=="function")try{ul.setStrictMode(qa,t)}catch{}}var nl=Math.clz32?Math.clz32:Qd,jd=Math.log,Xd=Math.LN2;function Qd(t){return t>>>=0,t===0?32:31-(jd(t)/Xd|0)|0}var xu=256,qu=262144,Yu=4194304;function Ue(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Lu(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var u=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var r=a&134217727;return r!==0?(a=r&~n,a!==0?u=Ue(a):(i&=r,i!==0?u=Ue(i):e||(e=r&~t,e!==0&&(u=Ue(e))))):(r=a&~n,r!==0?u=Ue(r):i!==0?u=Ue(i):e||(e=a&~t,e!==0&&(u=Ue(e)))),u===0?0:l!==0&&l!==u&&(l&n)===0&&(n=u&-u,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:u}function Ya(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function Zd(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ic(){var t=Yu;return Yu<<=1,(Yu&62914560)===0&&(Yu=4194304),t}function di(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function La(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Vd(t,l,e,a,u,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var r=t.entanglements,h=t.expirationTimes,T=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Fd=/[\n"\\]/g;function Sl(t){return t.replace(Fd,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pi(t,l,e,a,u,n,i,r){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+gl(l)):t.value!==""+gl(l)&&(t.value=""+gl(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?bi(t,i,gl(l)):e!=null?bi(t,i,gl(e)):a!=null&&t.removeAttribute("value"),u==null&&n!=null&&(t.defaultChecked=!!n),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.name=""+gl(r):t.removeAttribute("name")}function sr(t,l,e,a,u,n,i,r){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){Si(t);return}e=e!=null?""+gl(e):"",l=l!=null?""+gl(l):e,r||l===t.value||(t.value=l),t.defaultValue=l}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=r?t.checked:!!a,t.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Si(t)}function bi(t,l,e){l==="number"&&Xu(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function ta(t,l,e,a){if(t=t.options,l){l={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ri=!1;if(Xl)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Ri=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Ri=!1}var ie=null,_i=null,Zu=null;function Sr(){if(Zu)return Zu;var t,l=_i,e=l.length,a,u="value"in ie?ie.value:ie.textContent,n=u.length;for(t=0;t=Ka),Ar=" ",Rr=!1;function _r(t,l){switch(t){case"keyup":return Am.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Or(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ua=!1;function _m(t,l){switch(t){case"compositionend":return Or(l);case"keypress":return l.which!==32?null:(Rr=!0,Ar);case"textInput":return t=l.data,t===Ar&&Rr?null:t;default:return null}}function Om(t,l){if(ua)return t==="compositionend"||!Ci&&_r(t,l)?(t=Sr(),Zu=_i=ie=null,ua=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=xr(e)}}function Yr(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?Yr(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function Lr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Xu(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Xu(t.document)}return l}function Bi(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var xm=Xl&&"documentMode"in document&&11>=document.documentMode,na=null,xi=null,Wa=null,qi=!1;function Gr(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;qi||na==null||na!==Xu(a)||(a=na,"selectionStart"in a&&Bi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Wa&&$a(Wa,a)||(Wa=a,a=Yn(xi,"onSelect"),0>=i,u-=i,xl=1<<32-nl(l)+u|e<tt?(nt=Q,Q=null):nt=Q.sibling;var ct=z(S,Q,E[tt],C);if(ct===null){Q===null&&(Q=nt);break}t&&Q&&ct.alternate===null&&l(S,Q),m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct,Q=nt}if(tt===E.length)return e(S,Q),it&&Zl(S,tt),K;if(Q===null){for(;tttt?(nt=Q,Q=null):nt=Q.sibling;var Me=z(S,Q,ct.value,C);if(Me===null){Q===null&&(Q=nt);break}t&&Q&&Me.alternate===null&&l(S,Q),m=n(Me,m,tt),ft===null?K=Me:ft.sibling=Me,ft=Me,Q=nt}if(ct.done)return e(S,Q),it&&Zl(S,tt),K;if(Q===null){for(;!ct.done;tt++,ct=E.next())ct=N(S,ct.value,C),ct!==null&&(m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct);return it&&Zl(S,tt),K}for(Q=a(Q);!ct.done;tt++,ct=E.next())ct=A(Q,S,tt,ct.value,C),ct!==null&&(t&&ct.alternate!==null&&Q.delete(ct.key===null?tt:ct.key),m=n(ct,m,tt),ft===null?K=ct:ft.sibling=ct,ft=ct);return t&&Q.forEach(function(lv){return l(S,lv)}),it&&Zl(S,tt),K}function St(S,m,E,C){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Z:t:{for(var K=E.key;m!==null;){if(m.key===K){if(K=E.type,K===G){if(m.tag===7){e(S,m.sibling),C=u(m,E.props.children),C.return=S,S=C;break t}}else if(m.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Mt&&Xe(K)===m.type){e(S,m.sibling),C=u(m,E.props),lu(C,E),C.return=S,S=C;break t}e(S,m);break}else l(S,m);m=m.sibling}E.type===G?(C=qe(E.props.children,S.mode,C,E.key),C.return=S,S=C):(C=Pu(E.type,E.key,E.props,null,S.mode,C),lu(C,E),C.return=S,S=C)}return i(S);case V:t:{for(K=E.key;m!==null;){if(m.key===K)if(m.tag===4&&m.stateNode.containerInfo===E.containerInfo&&m.stateNode.implementation===E.implementation){e(S,m.sibling),C=u(m,E.children||[]),C.return=S,S=C;break t}else{e(S,m);break}else l(S,m);m=m.sibling}C=Zi(E,S.mode,C),C.return=S,S=C}return i(S);case Mt:return E=Xe(E),St(S,m,E,C)}if(Nt(E))return j(S,m,E,C);if(Jt(E)){if(K=Jt(E),typeof K!="function")throw Error(c(150));return E=K.call(E),J(S,m,E,C)}if(typeof E.then=="function")return St(S,m,fn(E),C);if(E.$$typeof===w)return St(S,m,en(S,E),C);cn(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,m!==null&&m.tag===6?(e(S,m.sibling),C=u(m,E),C.return=S,S=C):(e(S,m),C=Qi(E,S.mode,C),C.return=S,S=C),i(S)):e(S,m)}return function(S,m,E,C){try{tu=0;var K=St(S,m,E,C);return va=null,K}catch(Q){if(Q===ya||Q===un)throw Q;var ft=fl(29,Q,null,S.mode);return ft.lanes=C,ft.return=S,ft}finally{}}}var Ze=co(!0),ro=co(!1),se=!1;function lf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ef(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function he(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function de(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(rt&2)!==0){var u=a.pending;return u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l,l=Iu(t),Jr(t,null,e),l}return ku(t,a,l,e),Iu(t)}function eu(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,tr(t,e)}}function af(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var u=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?u=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?u=n=l:n=n.next=l}else u=n=l;e={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var uf=!1;function au(){if(uf){var t=ma;if(t!==null)throw t}}function uu(t,l,e,a){uf=!1;var u=t.updateQueue;se=!1;var n=u.firstBaseUpdate,i=u.lastBaseUpdate,r=u.shared.pending;if(r!==null){u.shared.pending=null;var h=r,T=h.next;h.next=null,i===null?n=T:i.next=T,i=h;var M=t.alternate;M!==null&&(M=M.updateQueue,r=M.lastBaseUpdate,r!==i&&(r===null?M.firstBaseUpdate=T:r.next=T,M.lastBaseUpdate=h))}if(n!==null){var N=u.baseState;i=0,M=T=h=null,r=n;do{var z=r.lane&-536870913,A=z!==r.lane;if(A?(ut&z)===z:(a&z)===z){z!==0&&z===da&&(uf=!0),M!==null&&(M=M.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});t:{var j=t,J=r;z=l;var St=e;switch(J.tag){case 1:if(j=J.payload,typeof j=="function"){N=j.call(St,N,z);break t}N=j;break t;case 3:j.flags=j.flags&-65537|128;case 0:if(j=J.payload,z=typeof j=="function"?j.call(St,N,z):j,z==null)break t;N=R({},N,z);break t;case 2:se=!0}}z=r.callback,z!==null&&(t.flags|=64,A&&(t.flags|=8192),A=u.callbacks,A===null?u.callbacks=[z]:A.push(z))}else A={lane:z,tag:r.tag,payload:r.payload,callback:r.callback,next:null},M===null?(T=M=A,h=N):M=M.next=A,i|=z;if(r=r.next,r===null){if(r=u.shared.pending,r===null)break;A=r,r=A.next,A.next=null,u.lastBaseUpdate=A,u.shared.pending=null}}while(!0);M===null&&(h=N),u.baseState=h,u.firstBaseUpdate=T,u.lastBaseUpdate=M,n===null&&(u.shared.lanes=0),Se|=i,t.lanes=i,t.memoizedState=N}}function oo(t,l){if(typeof t!="function")throw Error(c(191,t));t.call(l)}function so(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=U.T,r={};U.T=r,Af(t,!1,l,e);try{var h=u(),T=U.S;if(T!==null&&T(r,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var M=Vm(h,a);fu(t,l,M,hl(t))}else fu(t,l,a,hl(t))}catch(N){fu(t,l,{then:function(){},status:"rejected",reason:N},hl())}finally{x.p=n,i!==null&&r.types!==null&&(i.types=r.types),U.T=i}}function Fm(){}function Tf(t,l,e,a){if(t.tag!==5)throw Error(c(476));var u=Vo(t).queue;Zo(t,u,l,$,e===null?Fm:function(){return Ko(t),e(a)})}function Vo(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wl,lastRenderedState:$},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function Ko(t){var l=Vo(t);l.next===null&&(l=t.alternate.memoizedState),fu(t,l.next.queue,{},hl())}function zf(){return Qt(Au)}function Jo(){return Ct().memoizedState}function wo(){return Ct().memoizedState}function km(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=hl();t=he(e);var a=de(l,t,e);a!==null&&(el(a,l,e),eu(a,l,e)),l={cache:ki()},t.payload=l;return}l=l.return}}function Im(t,l,e){var a=hl();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},Sn(t)?Wo(l,e):(e=ji(t,l,e,a),e!==null&&(el(e,t,a),Fo(e,l,a)))}function $o(t,l,e){var a=hl();fu(t,l,e,a)}function fu(t,l,e,a){var u={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(Sn(t))Wo(l,u);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,r=n(i,e);if(u.hasEagerState=!0,u.eagerState=r,il(r,i))return ku(t,l,u,0),bt===null&&Fu(),!1}catch{}finally{}if(e=ji(t,l,u,a),e!==null)return el(e,t,a),Fo(e,l,a),!0}return!1}function Af(t,l,e,a){if(a={lane:2,revertLane:ec(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Sn(t)){if(l)throw Error(c(479))}else l=ji(t,e,a,2),l!==null&&el(l,t,2)}function Sn(t){var l=t.alternate;return t===P||l!==null&&l===P}function Wo(t,l){Sa=sn=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function Fo(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,tr(t,e)}}var cu={readContext:Qt,use:mn,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};cu.useEffectEvent=_t;var ko={readContext:Qt,use:mn,useCallback:function(t,l){return Wt().memoizedState=[t,l===void 0?null:l],t},useContext:Qt,useEffect:Bo,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,vn(4194308,4,Lo.bind(null,l,t),e)},useLayoutEffect:function(t,l){return vn(4194308,4,t,l)},useInsertionEffect:function(t,l){vn(4,2,t,l)},useMemo:function(t,l){var e=Wt();l=l===void 0?null:l;var a=t();if(Ve){ue(!0);try{t()}finally{ue(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=Wt();if(e!==void 0){var u=e(l);if(Ve){ue(!0);try{e(l)}finally{ue(!1)}}}else u=l;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=Im.bind(null,P,t),[a.memoizedState,t]},useRef:function(t){var l=Wt();return t={current:t},l.memoizedState=t},useState:function(t){t=gf(t);var l=t.queue,e=$o.bind(null,P,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:bf,useDeferredValue:function(t,l){var e=Wt();return Ef(e,t,l)},useTransition:function(){var t=gf(!1);return t=Zo.bind(null,P,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=P,u=Wt();if(it){if(e===void 0)throw Error(c(407));e=e()}else{if(e=l(),bt===null)throw Error(c(349));(ut&127)!==0||So(a,l,e)}u.memoizedState=e;var n={value:e,getSnapshot:l};return u.queue=n,Bo(bo.bind(null,a,n,t),[t]),a.flags|=2048,ba(9,{destroy:void 0},po.bind(null,a,n,e,l),null),e},useId:function(){var t=Wt(),l=bt.identifierPrefix;if(it){var e=ql,a=xl;e=(a&~(1<<32-nl(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=hn++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?i.createElement(u,{is:a.is}):i.createElement(u)}}n[jt]=l,n[Ft]=a;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Vt(n,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&Wl(l)}}return zt(l),Lf(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&Wl(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(c(166));if(t=lt.current,sa(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,u=Xt,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}t[jt]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||vh(t.nodeValue,e)),t||re(l,!0)}else t=Ln(t).createTextNode(a),t[jt]=l,l.stateNode=t}return zt(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=sa(l),e!==null){if(t===null){if(!a)throw Error(c(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[jt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;zt(l),t=!1}else e=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(rl(l),l):(rl(l),null);if((l.flags&128)!==0)throw Error(c(558))}return zt(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=sa(l),a!==null&&a.dehydrated!==null){if(t===null){if(!u)throw Error(c(318));if(u=l.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[jt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;zt(l),u=!1}else u=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return l.flags&256?(rl(l),l):(rl(l),null)}return rl(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==u&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),zn(l,l.updateQueue),zt(l),null);case 4:return Dt(),t===null&&ic(l.stateNode.containerInfo),zt(l),null;case 10:return Kl(l.type),zt(l),null;case 19:if(H(Ut),a=l.memoizedState,a===null)return zt(l),null;if(u=(l.flags&128)!==0,n=a.rendering,n===null)if(u)ou(a,!1);else{if(Ot!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(n=on(t),n!==null){for(l.flags|=128,ou(a,!1),t=n.updateQueue,l.updateQueue=t,zn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)wr(e,t),e=e.sibling;return Y(Ut,Ut.current&1|2),it&&Zl(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&al()>Mn&&(l.flags|=128,u=!0,ou(a,!1),l.lanes=4194304)}else{if(!u)if(t=on(n),t!==null){if(l.flags|=128,u=!0,t=t.updateQueue,l.updateQueue=t,zn(l,t),ou(a,!0),a.tail===null&&a.tailMode==="hidden"&&!n.alternate&&!it)return zt(l),null}else 2*al()-a.renderingStartTime>Mn&&e!==536870912&&(l.flags|=128,u=!0,ou(a,!1),l.lanes=4194304);a.isBackwards?(n.sibling=l.child,l.child=n):(t=a.last,t!==null?t.sibling=n:l.child=n,a.last=n)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=al(),t.sibling=null,e=Ut.current,Y(Ut,u?e&1|2:e&1),it&&Zl(l,a.treeForkCount),t):(zt(l),null);case 22:case 23:return rl(l),ff(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(zt(l),l.subtreeFlags&6&&(l.flags|=8192)):zt(l),e=l.updateQueue,e!==null&&zn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&H(je),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),Kl(Ht),zt(l),null;case 25:return null;case 30:return null}throw Error(c(156,l.tag))}function ay(t,l){switch(Ki(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return Kl(Ht),Dt(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Hu(l),null;case 31:if(l.memoizedState!==null){if(rl(l),l.alternate===null)throw Error(c(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(rl(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(c(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return H(Ut),null;case 4:return Dt(),null;case 10:return Kl(l.type),null;case 22:case 23:return rl(l),ff(),t!==null&&H(je),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return Kl(Ht),null;case 25:return null;default:return null}}function Es(t,l){switch(Ki(l),l.tag){case 3:Kl(Ht),Dt();break;case 26:case 27:case 5:Hu(l);break;case 4:Dt();break;case 31:l.memoizedState!==null&&rl(l);break;case 13:rl(l);break;case 19:H(Ut);break;case 10:Kl(l.type);break;case 22:case 23:rl(l),ff(),t!==null&&H(je);break;case 24:Kl(Ht)}}function su(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var u=a.next;e=u;do{if((e.tag&t)===t){a=void 0;var n=e.create,i=e.inst;a=n(),i.destroy=a}e=e.next}while(e!==u)}}catch(r){dt(l,l.return,r)}}function ve(t,l,e){try{var a=l.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var n=u.next;a=n;do{if((a.tag&t)===t){var i=a.inst,r=i.destroy;if(r!==void 0){i.destroy=void 0,u=l;var h=e,T=r;try{T()}catch(M){dt(u,h,M)}}}a=a.next}while(a!==n)}}catch(M){dt(l,l.return,M)}}function Ts(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{so(l,e)}catch(a){dt(t,t.return,a)}}}function zs(t,l,e){e.props=Ke(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){dt(t,l,a)}}function hu(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(u){dt(t,l,u)}}function Yl(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(u){dt(t,l,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(u){dt(t,l,u)}else e.current=null}function As(t){var l=t.type,e=t.memoizedProps,a=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break t;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(u){dt(t,t.return,u)}}function Gf(t,l,e){try{var a=t.stateNode;Ry(a,t.type,e,l),a[Ft]=l}catch(u){dt(t,t.return,u)}}function Rs(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ze(t.type)||t.tag===4}function jf(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Rs(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ze(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xf(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=jl));else if(a!==4&&(a===27&&ze(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Xf(t,l,e),t=t.sibling;t!==null;)Xf(t,l,e),t=t.sibling}function An(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(a!==4&&(a===27&&ze(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(An(t,l,e),t=t.sibling;t!==null;)An(t,l,e),t=t.sibling}function _s(t){var l=t.stateNode,e=t.memoizedProps;try{for(var a=t.type,u=l.attributes;u.length;)l.removeAttributeNode(u[0]);Vt(l,a,e),l[jt]=t,l[Ft]=e}catch(n){dt(t,t.return,n)}}var Fl=!1,qt=!1,Qf=!1,Os=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function uy(t,l){if(t=t.containerInfo,rc=Kn,t=Lr(t),Bi(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var u=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,r=-1,h=-1,T=0,M=0,N=t,z=null;l:for(;;){for(var A;N!==e||u!==0&&N.nodeType!==3||(r=i+u),N!==n||a!==0&&N.nodeType!==3||(h=i+a),N.nodeType===3&&(i+=N.nodeValue.length),(A=N.firstChild)!==null;)z=N,N=A;for(;;){if(N===t)break l;if(z===e&&++T===u&&(r=i),z===n&&++M===a&&(h=i),(A=N.nextSibling)!==null)break;N=z,z=N.parentNode}N=A}e=r===-1||h===-1?null:{start:r,end:h}}else e=null}e=e||{start:0,end:0}}else e=null;for(oc={focusedElem:t,selectionRange:e},Kn=!1,Gt=l;Gt!==null;)if(l=Gt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,Gt=t;else for(;Gt!==null;){switch(l=Gt,n=l.alternate,t=l.flags,l.tag){case 0:if((t&4)!==0&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Vt(n,a,e),n[jt]=t,Lt(n),a=n;break t;case"link":var i=Hh("link","href",u).get(a+(e.href||""));if(i){for(var r=0;rSt&&(i=St,St=J,J=i);var S=qr(r,J),m=qr(r,St);if(S&&m&&(A.rangeCount!==1||A.anchorNode!==S.node||A.anchorOffset!==S.offset||A.focusNode!==m.node||A.focusOffset!==m.offset)){var E=N.createRange();E.setStart(S.node,S.offset),A.removeAllRanges(),J>St?(A.addRange(E),A.extend(m.node,m.offset)):(E.setEnd(m.node,m.offset),A.addRange(E))}}}}for(N=[],A=r;A=A.parentNode;)A.nodeType===1&&N.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;re?32:e,U.T=null,e=Wf,Wf=null;var n=be,i=le;if(Yt=0,Ra=be=null,le=0,(rt&6)!==0)throw Error(c(331));var r=rt;if(rt|=4,Ls(n.current),xs(n,n.current,i,e),rt=r,Su(0,!1),ul&&typeof ul.onPostCommitFiberRoot=="function")try{ul.onPostCommitFiberRoot(qa,n)}catch{}return!0}finally{x.p=u,U.T=a,eh(t,l)}}function uh(t,l,e){l=bl(e,l),l=Mf(t.stateNode,l,2),t=de(t,l,2),t!==null&&(La(t,2),Ll(t))}function dt(t,l,e){if(t.tag===3)uh(t,t,e);else for(;l!==null;){if(l.tag===3){uh(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(pe===null||!pe.has(a))){t=bl(e,t),e=ns(2),a=de(l,e,2),a!==null&&(is(e,a,l,t),La(a,2),Ll(a));break}}l=l.return}}function Pf(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new fy;var u=new Set;a.set(l,u)}else u=a.get(l),u===void 0&&(u=new Set,a.set(l,u));u.has(e)||(Kf=!0,u.add(e),t=hy.bind(null,t,l,e),l.then(t,t))}function hy(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,bt===t&&(ut&e)===e&&(Ot===4||Ot===3&&(ut&62914560)===ut&&300>al()-On?(rt&2)===0&&_a(t,0):Jf|=e,Aa===ut&&(Aa=0)),Ll(t)}function nh(t,l){l===0&&(l=Ic()),t=xe(t,l),t!==null&&(La(t,l),Ll(t))}function dy(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),nh(t,e)}function my(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,u=t.memoizedState;u!==null&&(e=u.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(l),nh(t,e)}function yy(t,l){return si(t,l)}var Bn=null,Ma=null,tc=!1,xn=!1,lc=!1,Te=0;function Ll(t){t!==Ma&&t.next===null&&(Ma===null?Bn=Ma=t:Ma=Ma.next=t),xn=!0,tc||(tc=!0,gy())}function Su(t,l){if(!lc&&xn){lc=!0;do for(var e=!1,a=Bn;a!==null;){if(t!==0){var u=a.pendingLanes;if(u===0)var n=0;else{var i=a.suspendedLanes,r=a.pingedLanes;n=(1<<31-nl(42|t)+1)-1,n&=u&~(i&~r),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,rh(a,n))}else n=ut,n=Lu(a,a===bt?n:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(n&3)===0||Ya(a,n)||(e=!0,rh(a,n));a=a.next}while(e);lc=!1}}function vy(){ih()}function ih(){xn=tc=!1;var t=0;Te!==0&&Oy()&&(t=Te);for(var l=al(),e=null,a=Bn;a!==null;){var u=a.next,n=fh(a,l);n===0?(a.next=null,e===null?Bn=u:e.next=u,u===null&&(Ma=e)):(e=a,(t!==0||(n&3)!==0)&&(xn=!0)),a=u}Yt!==0&&Yt!==5||Su(t),Te!==0&&(Te=0)}function fh(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,u=t.expirationTimes,n=t.pendingLanes&-62914561;0r)break;var M=h.transferSize,N=h.initiatorType;M&&gh(N)&&(h=h.responseEnd,i+=M*(h"u"?null:document;function Dh(t,l,e){var a=Da;if(a&&typeof l=="string"&&l){var u=Sl(l);u='link[rel="'+t+'"][href="'+u+'"]',typeof e=="string"&&(u+='[crossorigin="'+e+'"]'),Mh.has(u)||(Mh.add(u),t={rel:t,crossOrigin:e,href:l},a.querySelector(u)===null&&(l=a.createElement("link"),Vt(l,"link",t),Lt(l),a.head.appendChild(l)))}}function qy(t){ee.D(t),Dh("dns-prefetch",t,null)}function Yy(t,l){ee.C(t,l),Dh("preconnect",t,l)}function Ly(t,l,e){ee.L(t,l,e);var a=Da;if(a&&t&&l){var u='link[rel="preload"][as="'+Sl(l)+'"]';l==="image"&&e&&e.imageSrcSet?(u+='[imagesrcset="'+Sl(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(u+='[imagesizes="'+Sl(e.imageSizes)+'"]')):u+='[href="'+Sl(t)+'"]';var n=u;switch(l){case"style":n=Ua(t);break;case"script":n=Ca(t)}_l.has(n)||(t=R({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),_l.set(n,t),a.querySelector(u)!==null||l==="style"&&a.querySelector(Tu(n))||l==="script"&&a.querySelector(zu(n))||(l=a.createElement("link"),Vt(l,"link",t),Lt(l),a.head.appendChild(l)))}}function Gy(t,l){ee.m(t,l);var e=Da;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",u='link[rel="modulepreload"][as="'+Sl(a)+'"][href="'+Sl(t)+'"]',n=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ca(t)}if(!_l.has(n)&&(t=R({rel:"modulepreload",href:t},l),_l.set(n,t),e.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(zu(n)))return}a=e.createElement("link"),Vt(a,"link",t),Lt(a),e.head.appendChild(a)}}}function jy(t,l,e){ee.S(t,l,e);var a=Da;if(a&&t){var u=Ie(a).hoistableStyles,n=Ua(t);l=l||"default";var i=u.get(n);if(!i){var r={loading:0,preload:null};if(i=a.querySelector(Tu(n)))r.loading=5;else{t=R({rel:"stylesheet",href:t,"data-precedence":l},e),(e=_l.get(n))&&gc(t,e);var h=i=a.createElement("link");Lt(h),Vt(h,"link",t),h._p=new Promise(function(T,M){h.onload=T,h.onerror=M}),h.addEventListener("load",function(){r.loading|=1}),h.addEventListener("error",function(){r.loading|=2}),r.loading|=4,jn(i,l,a)}i={type:"stylesheet",instance:i,count:1,state:r},u.set(n,i)}}}function Xy(t,l){ee.X(t,l);var e=Da;if(e&&t){var a=Ie(e).hoistableScripts,u=Ca(t),n=a.get(u);n||(n=e.querySelector(zu(u)),n||(t=R({src:t,async:!0},l),(l=_l.get(u))&&Sc(t,l),n=e.createElement("script"),Lt(n),Vt(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function Qy(t,l){ee.M(t,l);var e=Da;if(e&&t){var a=Ie(e).hoistableScripts,u=Ca(t),n=a.get(u);n||(n=e.querySelector(zu(u)),n||(t=R({src:t,async:!0,type:"module"},l),(l=_l.get(u))&&Sc(t,l),n=e.createElement("script"),Lt(n),Vt(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function Uh(t,l,e,a){var u=(u=lt.current)?Gn(u):null;if(!u)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Ua(e.href),e=Ie(u).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Ua(e.href);var n=Ie(u).hoistableStyles,i=n.get(t);if(i||(u=u.ownerDocument||u,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=u.querySelector(Tu(t)))&&!n._p&&(i.instance=n,i.state.loading=5),_l.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},_l.set(t,e),n||Zy(u,t,e,i.state))),l&&a===null)throw Error(c(528,""));return i}if(l&&a!==null)throw Error(c(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ca(e),e=Ie(u).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function Ua(t){return'href="'+Sl(t)+'"'}function Tu(t){return'link[rel="stylesheet"]['+t+"]"}function Ch(t){return R({},t,{"data-precedence":t.precedence,precedence:null})}function Zy(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),Vt(l,"link",e),Lt(l),t.head.appendChild(l))}function Ca(t){return'[src="'+Sl(t)+'"]'}function zu(t){return"script[async]"+t}function Nh(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Sl(e.href)+'"]');if(a)return l.instance=a,Lt(a),a;var u=R({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Lt(a),Vt(a,"style",u),jn(a,e.precedence,t),l.instance=a;case"stylesheet":u=Ua(e.href);var n=t.querySelector(Tu(u));if(n)return l.state.loading|=4,l.instance=n,Lt(n),n;a=Ch(e),(u=_l.get(u))&&gc(a,u),n=(t.ownerDocument||t).createElement("link"),Lt(n);var i=n;return i._p=new Promise(function(r,h){i.onload=r,i.onerror=h}),Vt(n,"link",a),l.state.loading|=4,jn(n,e.precedence,t),l.instance=n;case"script":return n=Ca(e.src),(u=t.querySelector(zu(n)))?(l.instance=u,Lt(u),u):(a=e,(u=_l.get(n))&&(a=R({},e),Sc(a,u)),t=t.ownerDocument||t,u=t.createElement("script"),Lt(u),Vt(u,"link",a),t.head.appendChild(u),l.instance=u);case"void":return null;default:throw Error(c(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,jn(a,e.precedence,t));return l.instance}function jn(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,n=u,i=0;i title"):null)}function Vy(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function xh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ky(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var u=Ua(a.href),n=l.querySelector(Tu(u));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Qn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,Lt(n);return}n=l.ownerDocument||l,a=Ch(a),(u=_l.get(u))&&gc(a,u),n=n.createElement("link"),Lt(n);var i=n;i._p=new Promise(function(r,h){i.onload=r,i.onerror=h}),Vt(n,"link",a),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=Qn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var pc=0;function Jy(t,l){return t.stylesheets&&t.count===0&&Vn(t,t.stylesheets),0pc?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Qn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Zn=null;function Vn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Zn=new Map,l.forEach(wy,t),Zn=null,Qn.call(t))}function wy(t,l){if(!(l.state.loading&4)){var e=Zn.get(t);if(e)var a=e.get(null);else{e=new Map,Zn.set(t,e);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(o){console.error(o)}}return f(),Oc.exports=iv(),Oc.exports}/** - * react-router v7.18.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var Lc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,hd=/^[\\/]{2}/;function fv(f,o){return o+f.replace(/\\/g,"/")}var ad="popstate";function ud(f){return typeof f=="object"&&f!=null&&"pathname"in f&&"search"in f&&"hash"in f&&"state"in f&&"key"in f}function cv(f={}){function o(d,v){let{pathname:b="/",search:O="",hash:p=""}=$e(d.location.hash.substring(1));return!b.startsWith("/")&&!b.startsWith(".")&&(b="/"+b),Bc("",{pathname:b,search:O,hash:p},v.state&&v.state.usr||null,v.state&&v.state.key||"default")}function s(d,v){let b=d.document.querySelector("base"),O="";if(b&&b.getAttribute("href")){let p=d.location.href,y=p.indexOf("#");O=y===-1?p:p.slice(0,y)}return O+"#"+(typeof v=="string"?v:Uu(v))}function c(d,v){dl(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(v)})`)}return ov(o,s,c,f)}function Rt(f,o){if(f===!1||f===null||typeof f>"u")throw new Error(o)}function dl(f,o){if(!f){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function rv(){return Math.random().toString(36).substring(2,10)}function nd(f,o){return{usr:f.state,key:f.key,idx:o,masked:f.mask?{pathname:f.pathname,search:f.search,hash:f.hash}:void 0}}function Bc(f,o,s=null,c,d){return{pathname:typeof f=="string"?f:f.pathname,search:"",hash:"",...typeof o=="string"?$e(o):o,state:s,key:o&&o.key||c||rv(),mask:d}}function Uu({pathname:f="/",search:o="",hash:s=""}){return o&&o!=="?"&&(f+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(f+=s.charAt(0)==="#"?s:"#"+s),f}function $e(f){let o={};if(f){let s=f.indexOf("#");s>=0&&(o.hash=f.substring(s),f=f.substring(0,s));let c=f.indexOf("?");c>=0&&(o.search=f.substring(c),f=f.substring(0,c)),f&&(o.pathname=f)}return o}function ov(f,o,s,c={}){let{window:d=document.defaultView,v5Compat:v=!1}=c,b=d.history,O="POP",p=null,y=D();y==null&&(y=0,b.replaceState({...b.state,idx:y},""));function D(){return(b.state||{idx:null}).idx}function R(){O="POP";let L=D(),q=L==null?null:L-y;y=L,p&&p({action:O,location:G.location,delta:q})}function B(L,q){O="PUSH";let W=ud(L)?L:Bc(G.location,L,q);s&&s(W,L),y=D()+1;let w=nd(W,y),mt=G.createHref(W.mask||W);try{b.pushState(w,"",mt)}catch(st){if(st instanceof DOMException&&st.name==="DataCloneError")throw st;d.location.assign(mt)}v&&p&&p({action:O,location:G.location,delta:1})}function Z(L,q){O="REPLACE";let W=ud(L)?L:Bc(G.location,L,q);s&&s(W,L),y=D();let w=nd(W,y),mt=G.createHref(W.mask||W);b.replaceState(w,"",mt),v&&p&&p({action:O,location:G.location,delta:0})}function V(L){return sv(d,L)}let G={get action(){return O},get location(){return f(d,b)},listen(L){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(ad,R),p=L,()=>{d.removeEventListener(ad,R),p=null}},createHref(L){return o(d,L)},createURL:V,encodeLocation(L){let q=V(L);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:B,replace:Z,go(L){return b.go(L)}};return G}function sv(f,o,s=!1){let c="http://localhost";f&&(c=f.location.origin!=="null"?f.location.origin:f.location.href),Rt(c,"No window.location.(origin|href) available to create URL");let d=typeof o=="string"?o:Uu(o);return d=d.replace(/ $/,"%20"),!s&&hd.test(d)&&(d=c+d),new URL(d,c)}function dd(f,o,s="/"){return hv(f,o,s,!1)}function hv(f,o,s,c,d){let v=typeof o=="string"?$e(o):o,b=ae(v.pathname||"/",s);if(b==null)return null;let O=dv(f),p=null,y=Av(b);for(let D=0;p==null&&D{let D={relativePath:y===void 0?b.path||"":y,caseSensitive:b.caseSensitive===!0,childrenIndex:O,route:b};if(D.relativePath.startsWith("/")){if(!D.relativePath.startsWith(c)&&p)return;Rt(D.relativePath.startsWith(c),`Absolute route path "${D.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),D.relativePath=D.relativePath.slice(c.length)}let R=Ul([c,D.relativePath]),B=s.concat(D);b.children&&b.children.length>0&&(Rt(b.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${R}".`),md(b.children,o,B,R,p)),!(b.path==null&&!b.index)&&o.push({path:R,score:Ev(R,b.index),routesMeta:B.map((Z,V)=>{let[G,L]=gd(Z.relativePath,Z.caseSensitive,V===B.length-1);return{...Z,matcher:G,compiledParams:L}})})};return f.forEach((b,O)=>{var p;if(b.path===""||!((p=b.path)!=null&&p.includes("?")))v(b,O);else for(let y of yd(b.path))v(b,O,!0,y)}),o}function yd(f){let o=f.split("/");if(o.length===0)return[];let[s,...c]=o,d=s.endsWith("?"),v=s.replace(/\?$/,"");if(c.length===0)return d?[v,""]:[v];let b=yd(c.join("/")),O=[];return O.push(...b.map(p=>p===""?v:[v,p].join("/"))),d&&O.push(...b),O.map(p=>f.startsWith("/")&&p===""?"/":p)}function mv(f){f.sort((o,s)=>o.score!==s.score?s.score-o.score:Tv(o.routesMeta.map(c=>c.childrenIndex),s.routesMeta.map(c=>c.childrenIndex)))}var yv=/^:[\w-]+$/,vv=3,gv=2,Sv=1,pv=10,bv=-2,id=f=>f==="*";function Ev(f,o){let s=f.split("/"),c=s.length;return s.some(id)&&(c+=bv),o&&(c+=gv),s.filter(d=>!id(d)).reduce((d,v)=>d+(yv.test(v)?vv:v===""?Sv:pv),c)}function Tv(f,o){return f.length===o.length&&f.slice(0,-1).every((c,d)=>c===o[d])?f[f.length-1]-o[o.length-1]:0}function zv(f,o,s=!1){let{routesMeta:c}=f,d={},v="/",b=[];for(let O=0;O{if(D==="*"){let V=O[B]||"";b=v.slice(0,v.length-V.length).replace(/(.)\/+$/,"$1")}const Z=O[B];return R&&!Z?y[D]=void 0:y[D]=(Z||"").replace(/%2F/g,"/"),y},{}),pathname:v,pathnameBase:b,pattern:f}}function gd(f,o=!1,s=!0){dl(f==="*"||!f.endsWith("*")||f.endsWith("/*"),`Route path "${f}" will be treated as if it were "${f.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${f.replace(/\*$/,"/*")}".`);let c=[],d="^"+f.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(b,O,p,y,D)=>{if(c.push({paramName:O,isOptional:p!=null}),p){let R=D.charAt(y+b.length);return R&&R!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return f.endsWith("*")?(c.push({paramName:"*"}),d+=f==="*"||f==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":f!==""&&f!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function Av(f){try{return f.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return dl(!1,`The URL path "${f}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),f}}function ae(f,o){if(o==="/")return f;if(!f.toLowerCase().startsWith(o.toLowerCase()))return null;let s=o.endsWith("/")?o.length-1:o.length,c=f.charAt(s);return c&&c!=="/"?null:f.slice(s)||"/"}function Rv(f,o="/"){let{pathname:s,search:c="",hash:d=""}=typeof f=="string"?$e(f):f,v;return s?(s=Sd(s),s.startsWith("/")?v=fd(s.substring(1),"/"):v=fd(s,o)):v=o,{pathname:v,search:Mv(c),hash:Dv(d)}}function fd(f,o){let s=ei(o).split("/");return f.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Cc(f,o,s,c){return`Cannot include a '${f}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function _v(f){return f.filter((o,s)=>s===0||o.route.path&&o.route.path.length>0)}function Gc(f){let o=_v(f);return o.map((s,c)=>c===o.length-1?s.pathname:s.pathnameBase)}function ai(f,o,s,c=!1){let d;typeof f=="string"?d=$e(f):(d={...f},Rt(!d.pathname||!d.pathname.includes("?"),Cc("?","pathname","search",d)),Rt(!d.pathname||!d.pathname.includes("#"),Cc("#","pathname","hash",d)),Rt(!d.search||!d.search.includes("#"),Cc("#","search","hash",d)));let v=f===""||d.pathname==="",b=v?"/":d.pathname,O;if(b==null)O=s;else{let R=o.length-1;if(!c&&b.startsWith("..")){let B=b.split("/");for(;B[0]==="..";)B.shift(),R-=1;d.pathname=B.join("/")}O=R>=0?o[R]:"/"}let p=Rv(d,O),y=b&&b!=="/"&&b.endsWith("/"),D=(v||b===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(y||D)&&(p.pathname+="/"),p}var Sd=f=>f.replace(/[\\/]{2,}/g,"/"),Ul=f=>Sd(f.join("/")),ei=f=>f.replace(/\/+$/,""),Ov=f=>ei(f).replace(/^\/*/,"/"),Mv=f=>!f||f==="?"?"":f.startsWith("?")?f:"?"+f,Dv=f=>!f||f==="#"?"":f.startsWith("#")?f:"#"+f,Uv=class{constructor(f,o,s,c=!1){this.status=f,this.statusText=o||"",this.internal=c,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Cv(f){return f!=null&&typeof f.status=="number"&&typeof f.statusText=="string"&&typeof f.internal=="boolean"&&"data"in f}function Nv(f){let o=f.map(s=>s.route.path).filter(Boolean);return Ul(o)||"/"}var pd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bd(f,o){let s=f;if(typeof s!="string"||!Lc.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let c=s,d=!1;if(pd)try{let v=new URL(window.location.href),b=hd.test(s)?new URL(fv(s,v.protocol)):new URL(s),O=ae(b.pathname,o);b.origin===v.origin&&O!=null?s=O+b.search+b.hash:d=!0}catch{dl(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ed=["POST","PUT","PATCH","DELETE"];new Set(Ed);var Hv=["GET",...Ed];new Set(Hv);var Bv=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function xv(f){try{return Bv.includes(new URL(f).protocol)}catch{return!1}}var Ha=_.createContext(null);Ha.displayName="DataRouter";var ui=_.createContext(null);ui.displayName="DataRouterState";var Td=_.createContext(!1);function qv(){return _.useContext(Td)}var zd=_.createContext({isTransitioning:!1});zd.displayName="ViewTransition";var Yv=_.createContext(new Map);Yv.displayName="Fetchers";var Lv=_.createContext(null);Lv.displayName="Await";var ml=_.createContext(null);ml.displayName="Navigation";var Cu=_.createContext(null);Cu.displayName="Location";var Cl=_.createContext({outlet:null,matches:[],isDataRoute:!1});Cl.displayName="Route";var jc=_.createContext(null);jc.displayName="RouteError";var Ad="REACT_ROUTER_ERROR",Gv="REDIRECT",jv="ROUTE_ERROR_RESPONSE";function Xv(f){if(f.startsWith(`${Ad}:${Gv}:{`))try{let o=JSON.parse(f.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function Qv(f){if(f.startsWith(`${Ad}:${jv}:{`))try{let o=JSON.parse(f.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Uv(o.status,o.statusText,o.data)}catch{}}function Zv(f,{relative:o}={}){Rt(Ba(),"useHref() may be used only in the context of a component.");let{basename:s,navigator:c}=_.useContext(ml),{hash:d,pathname:v,search:b}=Nu(f,{relative:o}),O=v;return s!=="/"&&(O=v==="/"?s:Ul([s,v])),c.createHref({pathname:O,search:b,hash:d})}function Ba(){return _.useContext(Cu)!=null}function Nl(){return Rt(Ba(),"useLocation() may be used only in the context of a component."),_.useContext(Cu).location}var Rd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _d(f){_.useContext(ml).static||_.useLayoutEffect(f)}function Xc(){let{isDataRoute:f}=_.useContext(Cl);return f?u0():Vv()}function Vv(){Rt(Ba(),"useNavigate() may be used only in the context of a component.");let f=_.useContext(Ha),{basename:o,navigator:s}=_.useContext(ml),{matches:c}=_.useContext(Cl),{pathname:d}=Nl(),v=JSON.stringify(Gc(c)),b=_.useRef(!1);return _d(()=>{b.current=!0}),_.useCallback((p,y={})=>{if(dl(b.current,Rd),!b.current)return;if(typeof p=="number"){s.go(p);return}let D=ai(p,JSON.parse(v),d,y.relative==="path");f==null&&o!=="/"&&(D.pathname=D.pathname==="/"?o:Ul([o,D.pathname])),(y.replace?s.replace:s.push)(D,y.state,y)},[o,s,v,d,f])}var Kv=_.createContext(null);function Jv(f){let o=_.useContext(Cl).outlet;return _.useMemo(()=>o&&_.createElement(Kv.Provider,{value:f},o),[o,f])}function Nu(f,{relative:o}={}){let{matches:s}=_.useContext(Cl),{pathname:c}=Nl(),d=JSON.stringify(Gc(s));return _.useMemo(()=>ai(f,JSON.parse(d),c,o==="path"),[f,d,c,o])}function wv(f,o){return Od(f,o)}function Od(f,o,s){var L;Rt(Ba(),"useRoutes() may be used only in the context of a component.");let{navigator:c}=_.useContext(ml),{matches:d}=_.useContext(Cl),v=d[d.length-1],b=v?v.params:{},O=v?v.pathname:"/",p=v?v.pathnameBase:"/",y=v&&v.route;{let q=y&&y.path||"";Dd(O,!y||q.endsWith("*")||q.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${O}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let D=Nl(),R;if(o){let q=typeof o=="string"?$e(o):o;Rt(p==="/"||((L=q.pathname)==null?void 0:L.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${q.pathname}" was given in the \`location\` prop.`),R=q}else R=D;let B=R.pathname||"/",Z=B;if(p!=="/"){let q=p.replace(/^\//,"").split("/");Z="/"+B.replace(/^\//,"").split("/").slice(q.length).join("/")}let V=s&&s.state.matches.length?s.state.matches.map(q=>Object.assign(q,{route:s.manifest[q.route.id]||q.route})):dd(f,{pathname:Z});dl(y||V!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),dl(V==null||V[V.length-1].route.element!==void 0||V[V.length-1].route.Component!==void 0||V[V.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let G=Iv(V&&V.map(q=>Object.assign({},q,{params:Object.assign({},b,q.params),pathname:Ul([p,c.encodeLocation?c.encodeLocation(q.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathname]),pathnameBase:q.pathnameBase==="/"?p:Ul([p,c.encodeLocation?c.encodeLocation(q.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathnameBase])})),d,s);return o&&G?_.createElement(Cu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...R},navigationType:"POP"}},G):G}function $v(){let f=a0(),o=Cv(f)?`${f.status} ${f.statusText}`:f instanceof Error?f.message:JSON.stringify(f),s=f instanceof Error?f.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},v={padding:"2px 4px",backgroundColor:c},b=null;return console.error("Error handled by React Router default ErrorBoundary:",f),b=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:v},"ErrorBoundary")," or"," ",_.createElement("code",{style:v},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},o),s?_.createElement("pre",{style:d},s):null,b)}var Wv=_.createElement($v,null),Md=class extends _.Component{constructor(f){super(f),this.state={location:f.location,revalidation:f.revalidation,error:f.error}}static getDerivedStateFromError(f){return{error:f}}static getDerivedStateFromProps(f,o){return o.location!==f.location||o.revalidation!=="idle"&&f.revalidation==="idle"?{error:f.error,location:f.location,revalidation:f.revalidation}:{error:f.error!==void 0?f.error:o.error,location:o.location,revalidation:f.revalidation||o.revalidation}}componentDidCatch(f,o){this.props.onError?this.props.onError(f,o):console.error("React Router caught the following error during render",f)}render(){let f=this.state.error;if(this.context&&typeof f=="object"&&f&&"digest"in f&&typeof f.digest=="string"){const s=Qv(f.digest);s&&(f=s)}let o=f!==void 0?_.createElement(Cl.Provider,{value:this.props.routeContext},_.createElement(jc.Provider,{value:f,children:this.props.component})):this.props.children;return this.context?_.createElement(Fv,{error:f},o):o}};Md.contextType=Td;var Nc=new WeakMap;function Fv({children:f,error:o}){let{basename:s}=_.useContext(ml);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Xv(o.digest);if(c){let d=Nc.get(o);if(d)throw d;let v=bd(c.location,s),b=v.absoluteURL||v.to;if(xv(b))throw new Error("Invalid redirect location");if(pd&&!Nc.get(o))if(v.isExternal||c.reloadDocument)window.location.href=b;else{const O=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(v.to,{replace:c.replace}));throw Nc.set(o,O),O}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${b}`})}}return f}function kv({routeContext:f,match:o,children:s}){let c=_.useContext(Ha);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),_.createElement(Cl.Provider,{value:f},s)}function Iv(f,o=[],s){let c=s==null?void 0:s.state;if(f==null){if(!c)return null;if(c.errors)f=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)f=c.matches;else return null}let d=f,v=c==null?void 0:c.errors;if(v!=null){let D=d.findIndex(R=>R.route.id&&(v==null?void 0:v[R.route.id])!==void 0);Rt(D>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),d=d.slice(0,Math.min(d.length,D+1))}let b=!1,O=-1;if(s&&c){b=c.renderFallback;for(let D=0;D=0?d=d.slice(0,O+1):d=[d[0]];break}}}}let p=s==null?void 0:s.onError,y=c&&p?(D,R)=>{var B,Z;p(D,{location:c.location,params:((Z=(B=c.matches)==null?void 0:B[0])==null?void 0:Z.params)??{},pattern:Nv(c.matches),errorInfo:R})}:void 0;return d.reduceRight((D,R,B)=>{let Z,V=!1,G=null,L=null;c&&(Z=v&&R.route.id?v[R.route.id]:void 0,G=R.route.errorElement||Wv,b&&(O<0&&B===0?(Dd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),V=!0,L=null):O===B&&(V=!0,L=R.route.hydrateFallbackElement||null)));let q=o.concat(d.slice(0,B+1)),W=()=>{let w;return Z?w=G:V?w=L:R.route.Component?w=_.createElement(R.route.Component,null):R.route.element?w=R.route.element:w=D,_.createElement(kv,{match:R,routeContext:{outlet:D,matches:q,isDataRoute:c!=null},children:w})};return c&&(R.route.ErrorBoundary||R.route.errorElement||B===0)?_.createElement(Md,{location:c.location,revalidation:c.revalidation,component:G,error:Z,children:W(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:y}):W()},null)}function Qc(f){return`${f} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pv(f){let o=_.useContext(Ha);return Rt(o,Qc(f)),o}function t0(f){let o=_.useContext(ui);return Rt(o,Qc(f)),o}function l0(f){let o=_.useContext(Cl);return Rt(o,Qc(f)),o}function Zc(f){let o=l0(f),s=o.matches[o.matches.length-1];return Rt(s.route.id,`${f} can only be used on routes that contain a unique "id"`),s.route.id}function e0(){return Zc("useRouteId")}function a0(){var c;let f=_.useContext(jc),o=t0("useRouteError"),s=Zc("useRouteError");return f!==void 0?f:(c=o.errors)==null?void 0:c[s]}function u0(){let{router:f}=Pv("useNavigate"),o=Zc("useNavigate"),s=_.useRef(!1);return _d(()=>{s.current=!0}),_.useCallback(async(d,v={})=>{dl(s.current,Rd),s.current&&(typeof d=="number"?await f.navigate(d):await f.navigate(d,{fromRouteId:o,...v}))},[f,o])}var cd={};function Dd(f,o,s){!o&&!cd[f]&&(cd[f]=!0,dl(!1,s))}_.memo(n0);function n0({routes:f,manifest:o,future:s,state:c,isStatic:d,onError:v}){return Od(f,void 0,{manifest:o,state:c,isStatic:d,onError:v})}function V0({to:f,replace:o,state:s,relative:c}){Rt(Ba()," may be used only in the context of a component.");let{static:d}=_.useContext(ml);dl(!d," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:v}=_.useContext(Cl),{pathname:b}=Nl(),O=Xc(),p=ai(f,Gc(v),b,c==="path"),y=JSON.stringify(p);return _.useEffect(()=>{O(JSON.parse(y),{replace:o,state:s,relative:c})},[O,y,c,o,s]),null}function K0(f){return Jv(f.context)}function i0(f){Rt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function f0({basename:f="/",children:o=null,location:s,navigationType:c="POP",navigator:d,static:v=!1,useTransitions:b}){Rt(!Ba(),"You cannot render a inside another . You should never have more than one in your app.");let O=f.replace(/^\/*/,"/"),p=_.useMemo(()=>({basename:O,navigator:d,static:v,useTransitions:b,future:{}}),[O,d,v,b]);typeof s=="string"&&(s=$e(s));let{pathname:y="/",search:D="",hash:R="",state:B=null,key:Z="default",mask:V}=s,G=_.useMemo(()=>{let L=ae(y,O);return L==null?null:{location:{pathname:L,search:D,hash:R,state:B,key:Z,mask:V},navigationType:c}},[O,y,D,R,B,Z,c,V]);return dl(G!=null,` is not able to match the URL "${y}${D}${R}" because it does not start with the basename, so the won't render anything.`),G==null?null:_.createElement(ml.Provider,{value:p},_.createElement(Cu.Provider,{children:o,value:G}))}function J0({children:f,location:o}){return wv(xc(f),o)}function xc(f,o=[]){let s=[];return _.Children.forEach(f,(c,d)=>{if(!_.isValidElement(c))return;let v=[...o,d];if(c.type===_.Fragment){s.push.apply(s,xc(c.props.children,v));return}Rt(c.type===i0,`[${typeof c.type=="string"?c.type:c.type.name}] is not a component. All component children of must be a or `),Rt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let b={id:c.props.id||v.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(b.children=xc(c.props.children,v)),s.push(b)}),s}var Pn="get",ti="application/x-www-form-urlencoded";function ni(f){return typeof HTMLElement<"u"&&f instanceof HTMLElement}function c0(f){return ni(f)&&f.tagName.toLowerCase()==="button"}function r0(f){return ni(f)&&f.tagName.toLowerCase()==="form"}function o0(f){return ni(f)&&f.tagName.toLowerCase()==="input"}function s0(f){return!!(f.metaKey||f.altKey||f.ctrlKey||f.shiftKey)}function h0(f,o){return f.button===0&&(!o||o==="_self")&&!s0(f)}function qc(f=""){return new URLSearchParams(typeof f=="string"||Array.isArray(f)||f instanceof URLSearchParams?f:Object.keys(f).reduce((o,s)=>{let c=f[s];return o.concat(Array.isArray(c)?c.map(d=>[s,d]):[[s,c]])},[]))}function d0(f,o){let s=qc(f);return o&&o.forEach((c,d)=>{s.has(d)||o.getAll(d).forEach(v=>{s.append(d,v)})}),s}var In=null;function m0(){if(In===null)try{new FormData(document.createElement("form"),0),In=!1}catch{In=!0}return In}var y0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hc(f){return f!=null&&!y0.has(f)?(dl(!1,`"${f}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${ti}"`),null):f}function v0(f,o){let s,c,d,v,b;if(r0(f)){let O=f.getAttribute("action");c=O?ae(O,o):null,s=f.getAttribute("method")||Pn,d=Hc(f.getAttribute("enctype"))||ti,v=new FormData(f)}else if(c0(f)||o0(f)&&(f.type==="submit"||f.type==="image")){let O=f.form;if(O==null)throw new Error('Cannot submit a