cartethyia 2.5.9 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +15 -42
- package/README.md +11 -10
- package/dist/dashboard/assets/{BannedPage-Brvuj_Eb.js → BannedPage-l6XMnfr9.js} +1 -1
- package/dist/dashboard/assets/BannedPage-l6XMnfr9.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-CqfXtI3y.js → CliToolDetailPage-DwOzAW45.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-DwOzAW45.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-GQeS91bg.js → CliToolsPage-BT3Up3QA.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-BT3Up3QA.js.gz +0 -0
- package/dist/dashboard/assets/{CombosPage-BDRsTXBB.js → CombosPage-6kYIUpzR.js} +1 -1
- package/dist/dashboard/assets/CombosPage-6kYIUpzR.js.gz +0 -0
- package/dist/dashboard/assets/{ConsoleLogPage-zP8AFHX0.js → ConsoleLogPage-zRnj1mlR.js} +1 -1
- package/dist/dashboard/assets/ConsoleLogPage-zRnj1mlR.js.gz +0 -0
- package/dist/dashboard/assets/{CustomizationPage-BmfrNZ14.js → CustomizationPage-C7m-H1Rz.js} +1 -1
- package/dist/dashboard/assets/CustomizationPage-C7m-H1Rz.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-C8MR_BdB.js +1 -0
- package/dist/dashboard/assets/HealthEventsModal-C8MR_BdB.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-DoreIgm8.js → LoginPage-CbphLvjg.js} +1 -1
- package/dist/dashboard/assets/LoginPage-CbphLvjg.js.gz +0 -0
- package/dist/dashboard/assets/{ModelPicker-C7pDb41R.js → ModelPicker-DVny4S5_.js} +1 -1
- package/dist/dashboard/assets/ModelPicker-DVny4S5_.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-DABu2Wgt.js +1 -0
- package/dist/dashboard/assets/OverviewPage-DABu2Wgt.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-C15x9q13.js +3 -0
- package/dist/dashboard/assets/ProviderDetailPage-C15x9q13.js.gz +0 -0
- package/dist/dashboard/assets/{ProvidersPage-BnoPgA7w.js → ProvidersPage-Dfb2896L.js} +1 -1
- package/dist/dashboard/assets/ProvidersPage-Dfb2896L.js.gz +0 -0
- package/dist/dashboard/assets/{ProxyPage-Bq_TGgdb.js → ProxyPage-BaCIdAUt.js} +1 -1
- package/dist/dashboard/assets/ProxyPage-BaCIdAUt.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-BsdoCIw1.js +1 -0
- package/dist/dashboard/assets/QuotaPage-BsdoCIw1.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-KVJFh3Ip.js +1 -0
- package/dist/dashboard/assets/SettingsPage-KVJFh3Ip.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-Day3mCOn.js → SetupPage-D4g6vOGc.js} +1 -1
- package/dist/dashboard/assets/SetupPage-D4g6vOGc.js.gz +0 -0
- package/dist/dashboard/assets/{SortableList-DQxllnB5.js → SortableList-C93i14BD.js} +1 -1
- package/dist/dashboard/assets/SortableList-C93i14BD.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-uMExoWu1.js → StudioPage-SgQpymjm.js} +1 -1
- package/dist/dashboard/assets/{StudioPage-uMExoWu1.js.gz → StudioPage-SgQpymjm.js.gz} +0 -0
- package/dist/dashboard/assets/{UsagePage-DXa1oR-4.js → UsagePage-BFME-eba.js} +2 -2
- package/dist/dashboard/assets/UsagePage-BFME-eba.js.gz +0 -0
- package/dist/dashboard/assets/{api-keys-DQYLQxpW.js → api-keys-C23S9sgp.js} +1 -1
- package/dist/dashboard/assets/api-keys-C23S9sgp.js.gz +0 -0
- package/dist/dashboard/assets/{app-BIt446yE.js → app-2KhtHCv9.js} +1 -1
- package/dist/dashboard/assets/{app-BIt446yE.js.gz → app-2KhtHCv9.js.gz} +0 -0
- package/dist/dashboard/assets/app-CEeaMHOy.css +2 -0
- package/dist/dashboard/assets/app-CEeaMHOy.css.gz +0 -0
- package/dist/dashboard/assets/{assert-C9FD_JwJ.js → assert-DU6qrMA_.js} +1 -1
- package/dist/dashboard/assets/assert-DU6qrMA_.js.gz +0 -0
- package/dist/dashboard/assets/{badge-CR72dasT.js → badge-CKsF123d.js} +1 -1
- package/dist/dashboard/assets/badge-CKsF123d.js.gz +0 -0
- package/dist/dashboard/assets/{banner-CI9_eSfO.js → banner-8j7uChA9.js} +1 -1
- package/dist/dashboard/assets/banner-8j7uChA9.js.gz +0 -0
- package/dist/dashboard/assets/{card-DS7CQEsO.js → card-CdsSlWA3.js} +1 -1
- package/dist/dashboard/assets/card-CdsSlWA3.js.gz +0 -0
- package/dist/dashboard/assets/{cli-tools-CNqzrfdb.js → cli-tools-BaFUuFFF.js} +1 -1
- package/dist/dashboard/assets/cli-tools-BaFUuFFF.js.gz +0 -0
- package/dist/dashboard/assets/{clipboard-button-611pSsaX.js → clipboard-button-uL5aYLfW.js} +1 -1
- package/dist/dashboard/assets/clipboard-button-uL5aYLfW.js.gz +0 -0
- package/dist/dashboard/assets/{dialog-k37exjNt.js → dialog-C07hr5_G.js} +1 -1
- package/dist/dashboard/assets/dialog-C07hr5_G.js.gz +0 -0
- package/dist/dashboard/assets/{drawer-CX7N8ucR.js → drawer-BPO1TcKH.js} +1 -1
- package/dist/dashboard/assets/drawer-BPO1TcKH.js.gz +0 -0
- package/dist/dashboard/assets/{entry-CTP8AyiS.js → entry-Bz_CtDfC.js} +1 -1
- package/dist/dashboard/assets/entry-Bz_CtDfC.js.gz +0 -0
- package/dist/dashboard/assets/entry-CwPRKk0d.js +4 -0
- package/dist/dashboard/assets/entry-CwPRKk0d.js.gz +0 -0
- package/dist/dashboard/assets/entry-GJRbmrpA.js +1 -0
- package/dist/dashboard/assets/entry-GJRbmrpA.js.gz +0 -0
- package/dist/dashboard/assets/{github-badge-sltk1qUi.js → github-badge-DmQreSDd.js} +1 -1
- package/dist/dashboard/assets/github-badge-DmQreSDd.js.gz +0 -0
- package/dist/dashboard/assets/{index-z3zDOSMM.js → index-Bblu6erR.js} +2 -2
- package/dist/dashboard/assets/index-Bblu6erR.js.gz +0 -0
- package/dist/dashboard/assets/{inline-BhY2sSnO.js → inline-C9dCYaBZ.js} +1 -1
- package/dist/dashboard/assets/inline-C9dCYaBZ.js.gz +0 -0
- package/dist/dashboard/assets/{input-V1umFiBk.js → input-CjCnXweJ.js} +1 -1
- package/dist/dashboard/assets/input-CjCnXweJ.js.gz +0 -0
- package/dist/dashboard/assets/{layout-BBOYycyS.js → layout-V6y8DAkl.js} +1 -1
- package/dist/dashboard/assets/layout-V6y8DAkl.js.gz +0 -0
- package/dist/dashboard/assets/{list-row-1zzZYM0B.js → list-row-CM1AaG_y.js} +1 -1
- package/dist/dashboard/assets/list-row-CM1AaG_y.js.gz +0 -0
- package/dist/dashboard/assets/{live-BivGfuUs.js → live-ta6GMb-8.js} +1 -1
- package/dist/dashboard/assets/live-ta6GMb-8.js.gz +0 -0
- package/dist/dashboard/assets/{model-bans-CmffjLuG.js → model-bans-BmYTmbAk.js} +1 -1
- package/dist/dashboard/assets/model-bans-BmYTmbAk.js.gz +0 -0
- package/dist/dashboard/assets/{mutation-46P0oWMe.js → mutation-g_fduiNw.js} +1 -1
- package/dist/dashboard/assets/mutation-g_fduiNw.js.gz +0 -0
- package/dist/dashboard/assets/{numbers-DkfMR5Qs.js → numbers-BOevJzdz.js} +1 -1
- package/dist/dashboard/assets/numbers-BOevJzdz.js.gz +0 -0
- package/dist/dashboard/assets/{query-keys-BFhGpwR1.js → query-keys-UETqfytp.js} +1 -1
- package/dist/dashboard/assets/query-keys-UETqfytp.js.gz +0 -0
- package/dist/dashboard/assets/{routing-CAb4F37R.js → routing-BPUo-W8d.js} +1 -1
- package/dist/dashboard/assets/routing-BPUo-W8d.js.gz +0 -0
- package/dist/dashboard/assets/{select-C6MMiaio.js → select-C980c4cz.js} +1 -1
- package/dist/dashboard/assets/select-C980c4cz.js.gz +0 -0
- package/dist/dashboard/assets/{settings-DNX9sydi.js → settings--3hxSyry.js} +1 -1
- package/dist/dashboard/assets/settings--3hxSyry.js.gz +0 -0
- package/dist/dashboard/assets/{stack-BHTfXdz_.js → stack-_gfTdLVB.js} +1 -1
- package/dist/dashboard/assets/stack-_gfTdLVB.js.gz +0 -0
- package/dist/dashboard/assets/{state-mPDRlQkl.js → state-2c5V4zo7.js} +1 -1
- package/dist/dashboard/assets/state-2c5V4zo7.js.gz +0 -0
- package/dist/dashboard/assets/{switch-DOmJxg7H.js → switch-Dkke7Naf.js} +1 -1
- package/dist/dashboard/assets/switch-Dkke7Naf.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-Dem0lXQj.js → useMutation-EDFRkn1i.js} +1 -1
- package/dist/dashboard/assets/useMutation-EDFRkn1i.js.gz +0 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +51 -51
- package/migrations/README.md +52 -52
- package/migrations/full-postgres/0020_add_telemetry_event_analytics.sql +77 -0
- package/migrations/full-postgres/0021_add_api_key_concurrency_tolerance.sql +13 -0
- package/migrations/full-postgres/0022_add_inferhub_config_key.sql +17 -0
- package/migrations/full-postgres/0023_drop_api_key_concurrency_tolerance.sql +13 -0
- package/migrations/lite-sqlite3/0020_add_telemetry_event_analytics.sql +69 -0
- package/migrations/lite-sqlite3/0021_add_api_key_concurrency_tolerance.sql +13 -0
- package/migrations/lite-sqlite3/0022_add_inferhub_config_key.sql +17 -0
- package/migrations/lite-sqlite3/0023_drop_api_key_concurrency_tolerance.sql +13 -0
- package/package.json +96 -97
- package/scripts/cli/admin.ts +126 -125
- package/scripts/cli/autostart.ts +237 -237
- package/scripts/cli/background.ts +120 -110
- package/scripts/cli/bin/carte.cjs +8 -8
- package/scripts/cli/bin/cartethyia.cjs +167 -167
- package/scripts/cli/console-menu.ts +308 -275
- package/scripts/cli/controller.ts +145 -0
- package/scripts/cli/doctor.ts +1 -1
- package/scripts/cli/env.ts +99 -99
- package/scripts/cli/gateway.ts +264 -261
- package/scripts/{health.ts → cli/health.ts} +4 -4
- package/scripts/cli/instance.ts +234 -224
- package/scripts/cli/main.ts +188 -164
- package/scripts/cli/platform.ts +64 -64
- package/scripts/cli/prompt.ts +275 -107
- package/scripts/cli/services.ts +88 -88
- package/scripts/cli/setup.ts +445 -445
- package/scripts/cli/start.ts +85 -82
- package/scripts/cli/startup-signal.ts +23 -23
- package/scripts/cli/telemetry.ts +70 -0
- package/scripts/cli/tray/index.ts +263 -263
- package/scripts/cli/tray/windows.ps1 +107 -107
- package/scripts/cli/tray.ts +192 -208
- package/scripts/cli/update.ts +39 -39
- package/scripts/cli/version.ts +67 -67
- package/scripts/cli/wordmark.ts +58 -58
- package/src/boot/app.ts +16 -1
- package/src/boot/dependencies.ts +128 -25
- package/src/config/package-paths.ts +24 -0
- package/src/config/resources.ts +137 -0
- package/src/config/runtime.ts +133 -76
- package/src/config/spec.ts +30 -29
- package/src/config/telemetry.ts +0 -25
- package/src/console/api-keys/bucket-spend.ts +14 -17
- package/src/console/api-keys/contracts.ts +410 -410
- package/src/console/api-keys/routes.ts +12 -0
- package/src/console/audit/store.ts +2 -3
- package/src/console/auth/setup-service.ts +8 -1
- package/src/console/backup/routes.ts +7 -0
- package/src/console/backup/service.ts +463 -463
- package/src/console/backup/store.ts +16 -11
- package/src/console/backup/validate.ts +1 -4
- package/src/console/cli-tools/fs-ops.ts +18 -2
- package/src/console/data-management/contracts.ts +1 -8
- package/src/console/data-management/operations.ts +61 -48
- package/src/console/data-management/routes.ts +4 -2
- package/src/console/domain-registration.ts +25 -3
- package/src/console/inferhub/client.ts +139 -0
- package/src/console/inferhub/key-store.ts +129 -0
- package/src/console/inferhub/normalize.ts +347 -0
- package/src/console/inferhub/routes.ts +411 -0
- package/src/console/inferhub/store.ts +109 -0
- package/src/console/inferhub/types.ts +183 -0
- package/src/console/observability/contracts.ts +2 -41
- package/src/console/observability/store.ts +176 -371
- package/src/console/providers/catalog/public-model-store.ts +0 -0
- package/src/console/providers/catalog/store.ts +23 -36
- package/src/console/quota/account-quota-shared.ts +52 -52
- package/src/console/quota/account-quota-tenant.ts +16 -24
- package/src/console/quota/refresh.ts +441 -441
- package/src/console/remote-support/service.ts +270 -114
- package/src/console/routing/pools/import-parse.ts +206 -206
- package/src/console/routing/pools/operations.ts +543 -543
- package/src/console/routing/pools/probe-verdict.ts +132 -132
- package/src/console/routing/pools/routes.ts +181 -181
- package/src/console/routing/pools/store.ts +1 -1
- package/src/console/settings/contracts.ts +42 -40
- package/src/console/settings/store.ts +25 -25
- package/src/console/share/share-stats.ts +22 -4
- package/src/console/share/share-usage.ts +30 -4
- package/src/console/shared/cursor.ts +15 -0
- package/src/console/updates/repository-updates.ts +40 -39
- package/src/console/updates/routes.ts +12 -0
- package/src/main.ts +13 -5
- package/src/network/pool/resolver.ts +1104 -1104
- package/src/observability/client-name.ts +22 -0
- package/src/observability/event-log.ts +5 -29
- package/src/observability/event-query.ts +690 -0
- package/src/observability/log-ring.ts +26 -2
- package/src/observability/log-sanitize.ts +118 -0
- package/src/observability/logger.ts +17 -13
- package/src/observability/metrics.ts +35 -0
- package/src/observability/payload-capture.ts +114 -41
- package/src/observability/payload-store.ts +249 -24
- package/src/observability/raw-event-writer.ts +118 -0
- package/src/observability/runtime-metrics.ts +71 -1
- package/src/observability/telemetry-buffer.ts +100 -17
- package/src/observability/telemetry-reconciliation.ts +417 -0
- package/src/persistence/boot.ts +20 -9
- package/src/persistence/db-pg.ts +13 -0
- package/src/persistence/db-sqlite.ts +569 -497
- package/src/persistence/dialect.ts +3 -2
- package/src/persistence/migrate.ts +181 -181
- package/src/persistence/schema.ts +1496 -1406
- package/src/persistence/shared-cache.ts +5 -1
- package/src/persistence/stores/api-key-store.ts +581 -581
- package/src/persistence/stores/telemetry-store.ts +124 -63
- package/src/protocol/reasoning-text.ts +30 -0
- package/src/protocol/registry.ts +2 -0
- package/src/protocol/response/chat.ts +33 -7
- package/src/protocol/response/codex.ts +14 -2
- package/src/protocol/response/messages.ts +5 -2
- package/src/providers/authentication/oauth-flow-store.ts +3 -10
- package/src/providers/bundled-discovery-providers.ts +122 -122
- package/src/providers/default-registry.ts +14 -0
- package/src/providers/discovery/catalog/catalog-blob.ts +18 -18
- package/src/providers/discovery/models-dev-catalog.ts +354 -354
- package/src/providers/discovery/probe-phases.ts +43 -7
- package/src/providers/discovery/probing-service.ts +70 -32
- package/src/providers/integrations/antigravity/antigravity.ts +9 -2
- package/src/providers/integrations/buddy/buddy-catalog-shared.ts +85 -17
- package/src/providers/integrations/buddy/buddy-chat-shared.ts +934 -934
- package/src/providers/integrations/buddy/buddy-checkin.ts +5 -9
- package/src/providers/integrations/buddy/buddy-discovery-shared.ts +3 -7
- package/src/providers/integrations/buddy/buddy-quota-shared.ts +3 -1
- package/src/providers/integrations/buddy/capabilities.ts +4 -0
- package/src/providers/integrations/buddy/codebuddy/cn-provider.ts +57 -49
- package/src/providers/integrations/buddy/codebuddy/provider.ts +180 -180
- package/src/providers/integrations/buddy/workbuddy/provider.ts +206 -206
- package/src/providers/integrations/buddy/workbuddy/quota.ts +161 -161
- package/src/providers/integrations/claude/claude-quota.ts +2 -2
- package/src/providers/integrations/claude/claude-user-profiles.ts +3 -2
- package/src/providers/integrations/claude/claude.ts +3 -4
- package/src/providers/integrations/cline/cline.ts +94 -8
- package/src/providers/integrations/codex/codex.ts +61 -37
- package/src/providers/integrations/cursor/cursor-catalog.ts +368 -368
- package/src/providers/integrations/cursor/cursor-http2.ts +300 -300
- package/src/providers/integrations/cursor/cursor-identity.ts +2 -4
- package/src/providers/integrations/cursor/cursor-request.ts +11 -0
- package/src/providers/integrations/cursor/cursor.ts +29 -17
- package/src/providers/integrations/cursor/protocol/framing.ts +129 -129
- package/src/providers/integrations/cursor/protocol/messages.ts +2380 -2380
- package/src/providers/integrations/cursor/protocol/struct.ts +305 -305
- package/src/providers/integrations/cursor/protocol/tool-canonical.ts +275 -0
- package/src/providers/integrations/github/github.ts +3 -1
- package/src/providers/integrations/grok/grok-quota.ts +279 -279
- package/src/providers/integrations/grok/grok-ratelimit-store.ts +73 -73
- package/src/providers/integrations/grok/grok-ratelimit.ts +218 -218
- package/src/providers/integrations/hermes.ts +7 -1
- package/src/providers/integrations/inferhub.ts +201 -73
- package/src/providers/integrations/kilo/kilo.ts +152 -152
- package/src/providers/integrations/kiro/kiro-machine-id.ts +2 -4
- package/src/providers/integrations/opencode/provider.ts +2 -0
- package/src/providers/integrations/openrouter/provider.ts +129 -129
- package/src/providers/integrations/qoder/qoder-quota.ts +193 -192
- package/src/providers/integrations/qoder/qoder-realm.ts +106 -106
- package/src/providers/integrations/trae/trae-headers.ts +17 -48
- package/src/providers/integrations/trae/trae-oauth.ts +4 -26
- package/src/providers/integrations/trae/trae-quota.ts +389 -384
- package/src/providers/integrations/trae/trae-realm.ts +15 -2
- package/src/providers/integrations/trae/trae.ts +22 -24
- package/src/providers/integrations/xiaomi-mimo/think-stream.ts +100 -24
- package/src/providers/integrations/zcode/oauth.ts +1 -1
- package/src/providers/operations/account-health-service.ts +605 -279
- package/src/providers/provider-metadata.ts +12 -1
- package/src/providers/provider-model-definition.ts +373 -373
- package/src/providers/provider-probe.ts +3 -0
- package/src/providers/quota/quota-contracts.ts +3 -7
- package/src/providers/search/search-provider.ts +2 -6
- package/src/security/admission/contracts.ts +10 -0
- package/src/security/admission/in-memory-store.ts +89 -14
- package/src/security/admission/lua.ts +191 -182
- package/src/security/admission/redis-store.ts +30 -0
- package/src/security/admission/service.ts +18 -0
- package/src/security/api-key-auth-cache.ts +96 -0
- package/src/security/api-key-auth.ts +11 -100
- package/src/security/client-router-fingerprint.ts +3 -7
- package/src/security/ip-boundary.ts +7 -3
- package/src/shared/coerce.ts +67 -0
- package/src/shared/hash.ts +6 -0
- package/src/shared/time.ts +7 -0
- package/src/transport/dispatch/attempt-finalize.ts +26 -138
- package/src/transport/dispatch/attempt-loop.ts +103 -81
- package/src/transport/dispatch/capture-policy.ts +78 -0
- package/src/transport/dispatch/proxy-request.ts +4 -2
- package/src/transport/dispatch/streaming/encoder.ts +111 -5
- package/src/transport/dispatch/streaming/stream.ts +19 -2
- package/src/transport/dispatch/streaming/thinking-loop.ts +300 -0
- package/src/transport/failure-policy.ts +27 -0
- package/src/transport/guards/abuse-guard.ts +2 -2
- package/src/transport/guards/auth-guard.ts +17 -0
- package/src/transport/guards/body-policy.ts +3 -2
- package/src/transport/guards/concurrency-guard.ts +89 -13
- package/src/transport/guards/early-rejection-capture.ts +43 -3
- package/src/transport/guards/error-lifecycle.ts +10 -2
- package/src/transport/guards/guard-errors.ts +23 -0
- package/src/transport/guards/headroom-guard.ts +41 -7
- package/src/transport/guards/pipeline.ts +24 -0
- package/src/transport/guards/request-context.ts +2 -1
- package/src/transport/routing/admission.ts +51 -9
- package/src/transport/routing/bounded-lru.ts +49 -0
- package/src/transport/routing/candidate-index.ts +88 -0
- package/src/transport/routing/reservations.ts +121 -7
- package/src/transport/routing/round-robin.ts +10 -22
- package/src/transport/routing/route-catalog.ts +26 -13
- package/src/transport/routing/route-model.ts +22 -2
- package/src/transport/routing/router.ts +53 -31
- package/src/transport/surface/chat/encode.ts +2 -3
- package/src/transport/surface/chat/parse.ts +2 -1
- package/src/transport/surface/dialects.ts +11 -3
- package/src/transport/surface/messages/encode.ts +2 -1
- package/src/transport/surface/messages/parse.ts +3 -1
- package/src/transport/surface/messages/stream.ts +2 -6
- package/src/workers/maintenance-lease.ts +200 -0
- package/src/workers/scheduler.ts +101 -1
- package/dist/dashboard/assets/BannedPage-Brvuj_Eb.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-CqfXtI3y.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-GQeS91bg.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-BDRsTXBB.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-zP8AFHX0.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-BmfrNZ14.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-Dn3M6WZc.js +0 -1
- package/dist/dashboard/assets/HealthEventsModal-Dn3M6WZc.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-DoreIgm8.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-C7pDb41R.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-CvvD1Ugk.js +0 -1
- package/dist/dashboard/assets/OverviewPage-CvvD1Ugk.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-Clbn1gsW.js +0 -3
- package/dist/dashboard/assets/ProviderDetailPage-Clbn1gsW.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-BnoPgA7w.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-Bq_TGgdb.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-D9DHXvom.js +0 -1
- package/dist/dashboard/assets/QuotaPage-D9DHXvom.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-7xV8WkWL.js +0 -1
- package/dist/dashboard/assets/SettingsPage-7xV8WkWL.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-Day3mCOn.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-DQxllnB5.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-DXa1oR-4.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-DQYLQxpW.js.gz +0 -0
- package/dist/dashboard/assets/app-CX_Z8cMs.css +0 -2
- package/dist/dashboard/assets/app-CX_Z8cMs.css.gz +0 -0
- package/dist/dashboard/assets/assert-C9FD_JwJ.js.gz +0 -0
- package/dist/dashboard/assets/badge-CR72dasT.js.gz +0 -0
- package/dist/dashboard/assets/banner-CI9_eSfO.js.gz +0 -0
- package/dist/dashboard/assets/card-DS7CQEsO.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-CNqzrfdb.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-611pSsaX.js.gz +0 -0
- package/dist/dashboard/assets/dialog-k37exjNt.js.gz +0 -0
- package/dist/dashboard/assets/drawer-CX7N8ucR.js.gz +0 -0
- package/dist/dashboard/assets/entry-B9Xvtnfj.js +0 -1
- package/dist/dashboard/assets/entry-B9Xvtnfj.js.gz +0 -0
- package/dist/dashboard/assets/entry-ByMGkR3C.js +0 -4
- package/dist/dashboard/assets/entry-ByMGkR3C.js.gz +0 -0
- package/dist/dashboard/assets/entry-CTP8AyiS.js.gz +0 -0
- package/dist/dashboard/assets/github-badge-sltk1qUi.js.gz +0 -0
- package/dist/dashboard/assets/index-z3zDOSMM.js.gz +0 -0
- package/dist/dashboard/assets/inline-BhY2sSnO.js.gz +0 -0
- package/dist/dashboard/assets/input-V1umFiBk.js.gz +0 -0
- package/dist/dashboard/assets/layout-BBOYycyS.js.gz +0 -0
- package/dist/dashboard/assets/list-row-1zzZYM0B.js.gz +0 -0
- package/dist/dashboard/assets/live-BivGfuUs.js.gz +0 -0
- package/dist/dashboard/assets/model-bans-CmffjLuG.js.gz +0 -0
- package/dist/dashboard/assets/mutation-46P0oWMe.js.gz +0 -0
- package/dist/dashboard/assets/numbers-DkfMR5Qs.js.gz +0 -0
- package/dist/dashboard/assets/query-keys-BFhGpwR1.js.gz +0 -0
- package/dist/dashboard/assets/routing-CAb4F37R.js.gz +0 -0
- package/dist/dashboard/assets/select-C6MMiaio.js.gz +0 -0
- package/dist/dashboard/assets/settings-DNX9sydi.js.gz +0 -0
- package/dist/dashboard/assets/stack-BHTfXdz_.js.gz +0 -0
- package/dist/dashboard/assets/state-mPDRlQkl.js.gz +0 -0
- package/dist/dashboard/assets/switch-DOmJxg7H.js.gz +0 -0
- package/dist/dashboard/assets/useMutation-Dem0lXQj.js.gz +0 -0
- package/scripts/build/aot.ts +0 -143
- package/scripts/build/build.ts +0 -24
- package/scripts/build/compile.ts +0 -88
- package/scripts/build/restart.ts +0 -120
- package/scripts/build/start.ts +0 -25
- package/src/observability/event-compaction.ts +0 -317
- package/src/observability/event-day-index.ts +0 -440
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},t=new class{#e=e;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function n(e){setTimeout(e,0)}var r=typeof window>`u`||`Deno`in globalThis;function i(){}function a(e,t){return typeof e==`function`?e(t):e}function o(e){return typeof e==`number`&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t){return typeof e==`function`?e(t):e}function l(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==d(o,t.options))return!1}else if(!p(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function u(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(f(t.options.mutationKey)!==f(a))return!1}else if(!p(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function d(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function p(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!p(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!p(e[r],t[r]))return!1;return!0}return!1}var m=Object.prototype.hasOwnProperty;function h(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=_(e)&&_(t);if(!r&&!(v(e)&&v(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:m.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=h(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function _(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!y(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function y(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(n=>{t.setTimeout(n,e)})}function b(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:h(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function x(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var S=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===S?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ne(e,t){return typeof e==`function`?e(...t):!!e}function w(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var T=()=>r,E=()=>T(),D=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},O=new class extends D{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},re=n;function ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=re,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var k=ie(),A=new class extends D{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ae(e){return Math.min(1e3*2**e,3e4)}function j(e){return(e??`online`)!==`online`||A.isOnline()}var M=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function N(e){return e instanceof M}function P(e){let t=!1,n=0,r,a=`pending`,o,s,c=new Promise((e,t)=>{o=e,s=t});c.catch(i);let l=()=>a!==`pending`,u=t=>{if(!l()){let n=new M(t);g(n),e.onCancel?.(n)}},d=()=>{t=!0},f=()=>{t=!1},p=()=>O.isFocused()&&(e.networkMode===`always`||A.isOnline())&&e.canRun(),m=()=>j(e.networkMode)&&e.canRun(),h=e=>{l()||(r?.(),a=`resolved`,o(e))},g=e=>{l()||(r?.(),a=`rejected`,s(e))},_=()=>new Promise(t=>{r=e=>{(l()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,l()||e.onContinue?.()}),v=()=>{if(l())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(l())return;let i=e.retry??(E()?0:3),a=e.retryDelay??ae,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),ee(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:c,status:()=>a,cancel:u,continue:()=>(r?.(),c),cancelRetry:d,continueRetry:f,canStart:m,start:()=>(m()?v():_().then(v),c)}}var F=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o(this.gcTime)&&(this.#e=t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(E()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(t.clearTimeout(this.#e),this.#e=void 0)}};function oe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{w(e,()=>t.signal,()=>n=!0)},u=C(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?x:te;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?se:I,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:I(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function I(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function se(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ce=class extends F{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=z(this.options);e.data!==void 0&&(this.setState(R(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=b(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(i).catch(i):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>c(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===S||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>c(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!s(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=C(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?oe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=P({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof M&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof M){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...R(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:j(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function R(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var B=new Set([`GET`,`HEAD`,`OPTIONS`]),V=new Set([`/auth/login`,`/auth/setup`]),H=`csrf_token`;function U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function W(e,t){return`${t===`upstream`||t===void 0&&e>=500?`Upstream`:t===`network`?`Network`:`Console`} request failed (${e})`}function le(e,t){if(U(e)){if(typeof e.message==`string`)return e.message;if(typeof e.error==`string`)return e.error;if(U(e.error)&&typeof e.error.message==`string`)return e.error.message}return W(t,K(e))}function G(e){if(U(e)){if(typeof e.code==`string`)return e.code;if(U(e.error)&&typeof e.error.code==`string`)return e.error.code}}function K(e){if(!U(e))return;let t=typeof e.origin==`string`?e.origin:U(e.error)&&typeof e.error.origin==`string`?e.error.origin:void 0;return t===`cartethyia`||t===`upstream`||t===`network`?t:void 0}function ue(e){if(U(e))return U(e.details)?e.details:U(e.error)&&U(e.error.details)?e.error.details:void 0}async function q(e){try{return await e.json()}catch{throw{status:e.status,code:`invalid_response`,message:`Upstream returned a non-JSON response (${e.status})`}}}function J(e,t){let n=G(e),r=K(e),i=ue(e);throw{status:t,message:le(e,t),...n?{code:n}:{},...r?{origin:r}:{},...i?{details:i}:{}}}function Y(){if(!(typeof document>`u`||typeof document.cookie!=`string`))for(let e of document.cookie.split(`;`)){let t=e.indexOf(`=`);if(t!==-1&&e.slice(0,t).trim()===H){let n=e.slice(t+1).trim();return n.length>0?n:void 0}}}function de(e,t,n){return n.csrf===!1||B.has(t)?!1:!V.has(e)}var fe=new Set([`/auth/login`,`/auth/setup`,`/auth/setup/restore`,`/auth/session`,`/auth/first-boot`]),pe=new Set([`insufficient_scope`,`tenant_required`,`provider_is_builtin`,`invalid_scope`,`invalid_request`,`not_authorized`]),X;function me(e){X=e}function Z(e){X?.(e)}function Q(e,t,n){if(fe.has(e)||t!==401&&t!==403||K(n)===`upstream`||K(n)===`network`)return;if(t===401){Z(`expired`);return}let r=G(n);r!==void 0&&pe.has(r)||Z(`banned`)}async function $(e,t={}){let n=(t.method??`GET`).toUpperCase(),r=new Headers(t.headers);if(r.has(`Accept`)||r.set(`Accept`,`application/json`),t.body!=null&&!(t.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`),de(e,n,t)&&!r.has(`X-CSRF-Token`)){let e=Y();e&&r.set(`X-CSRF-Token`,e)}let{csrf:i,...a}=t,o=await fetch(`/console/api${e}`,{...a,method:n,credentials:`same-origin`,headers:r}),s=await q(o);return o.ok||(Q(e,o.status,s),J(s,o.status)),s}async function he(e,t,n){let r=new TextEncoder().encode(t).byteLength,i=await new Promise((i,a)=>{let o=new XMLHttpRequest;o.open(`POST`,`/console/api${e}`),o.withCredentials=!0,o.setRequestHeader(`Content-Type`,`application/json`),o.setRequestHeader(`Accept`,`application/json`);let s=Y();s&&o.setRequestHeader(`X-CSRF-Token`,s),o.upload.onprogress=e=>{n?.({loaded:e.loaded,total:e.lengthComputable?e.total:r})},o.onload=()=>i(new Response(o.responseText,{status:o.status})),o.onerror=()=>a(Error(`Network request failed`)),o.send(t)}),a=await q(i);return i.ok||(Q(e,i.status,a),J(a,i.status)),a}async function ge(){let e=await $(`/auth/session`);return e.status===`authenticated`?{id:e.user_id,username:e.username,email:e.email,displayName:e.display_name,isFirstBoot:e.is_first_boot,sessionExpiresAt:e.session_expires_at,isPlatformAdmin:e.is_platform_admin}:null}function _e(e,t=`Request failed`){return ve(e)&&e.message.trim().length>0||e instanceof Error&&e.message.trim().length>0?e.message:t}function ve(e){return typeof e==`object`&&!!e&&`message`in e&&typeof e.message==`string`}var ye={staleTime:6e4,gcTime:12e4,retry:!1,refetchOnWindowFocus:!1},be={retry:0},xe={effectivelyImmutable:3e5},Se={warming:2e3,live:5e3,status:1e4,catalog:6e4},Ce={session:{current:[`console`,`session`]},system:{health:[`console`,`system`,`health`]},releases:{githubLatest:[`console`,`releases`,`github-latest`]},usageAnalytics:{summary:e=>[`console`,`usage`,`summary`,e],chart:e=>[`console`,`usage`,`chart`,e],by:(e,t)=>[`console`,`usage`,`by`,e,t],requests:(e,t,n)=>[`console`,`usage`,`requests`,e,t,n??`all`],requestDetail:e=>[`console`,`usage`,`requests`,e]},providers:{all:[`console`,`providers`],detail:e=>[`console`,`providers`,e],models:e=>[`console`,`providers`,e,`models`],flatAll:[`console`,`providers`,`models-flat-all`],accounts:e=>[`console`,`providers`,e,`accounts`],routing:e=>[`console`,`providers`,e,`routing`],accountInflight:e=>[`console`,`providers`,e,`account-inflight`],healthEvents:(e,t)=>[`console`,`providers`,e,`accounts`,t,`health-events`]},modelRouting:{all:[`console`,`model-routing`],aliases:[`console`,`model-routing`,`aliases`],combos:[`console`,`model-routing`,`combos`]},network:{pools:[`console`,`network`,`pools`],poolStrategy:[`console`,`network`,`pool-strategy`]},apiKeys:{all:[`console`,`api-keys`],shareLink:e=>[`console`,`api-keys`,e,`share`],sharedKeys:e=>[`console`,`api-keys`,e,`shared-keys`],sharedKeyActivity:(e,t)=>[`console`,`api-keys`,e,`shared-keys`,t,`activity`]},modelBans:{all:[`console`,`model-bans`]},settings:{runtime:[`console`,`settings`,`runtime`],diskUsage:[`console`,`settings`,`disk-usage`]},remoteSupport:{status:[`console`,`remote-support`,`status`]},cliTools:{registry:[`console`,`cli-tools`,`registry`],statuses:[`console`,`cli-tools`,`statuses`],mappings:(e,t)=>[`console`,`cli-tools`,e,t,`mappings`]},audit:{list:e=>[`console`,`audit`,`list`,e]},quota:{all:[`console`,`quota`],account:e=>[`console`,`quota`,`account`,e],resets:e=>[`console`,`quota`,`account`,e,`resets`]}};export{b as A,f as C,l as D,u as E,s as F,t as I,g as M,ne as N,i as O,S as P,a as S,o as T,A as _,Se as a,D as b,ge as c,me as d,ce as f,N as g,P as h,ye as i,c as j,p as k,_e as l,F as m,xe as n,$ as o,L as p,be as r,he as s,Ce as t,U as u,k as v,d as w,E as x,O as y};
|
|
1
|
+
var e={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},t=new class{#e=e;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function n(e){setTimeout(e,0)}var r=typeof window>`u`||`Deno`in globalThis;function i(){}function a(e,t){return typeof e==`function`?e(t):e}function o(e){return typeof e==`number`&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t){return typeof e==`function`?e(t):e}function l(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==d(o,t.options))return!1}else if(!p(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function u(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(f(t.options.mutationKey)!==f(a))return!1}else if(!p(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function d(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function p(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!p(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!p(e[r],t[r]))return!1;return!0}return!1}var m=Object.prototype.hasOwnProperty;function h(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=_(e)&&_(t);if(!r&&!(v(e)&&v(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:m.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=h(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function _(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!y(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function y(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(n=>{t.setTimeout(n,e)})}function b(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:h(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function x(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var S=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===S?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ne(e,t){return typeof e==`function`?e(...t):!!e}function w(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var T=()=>r,E=()=>T(),D=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},O=new class extends D{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},re=n;function ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=re,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var k=ie(),A=new class extends D{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ae(e){return Math.min(1e3*2**e,3e4)}function j(e){return(e??`online`)!==`online`||A.isOnline()}var M=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function N(e){return e instanceof M}function P(e){let t=!1,n=0,r,a=`pending`,o,s,c=new Promise((e,t)=>{o=e,s=t});c.catch(i);let l=()=>a!==`pending`,u=t=>{if(!l()){let n=new M(t);g(n),e.onCancel?.(n)}},d=()=>{t=!0},f=()=>{t=!1},p=()=>O.isFocused()&&(e.networkMode===`always`||A.isOnline())&&e.canRun(),m=()=>j(e.networkMode)&&e.canRun(),h=e=>{l()||(r?.(),a=`resolved`,o(e))},g=e=>{l()||(r?.(),a=`rejected`,s(e))},_=()=>new Promise(t=>{r=e=>{(l()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,l()||e.onContinue?.()}),v=()=>{if(l())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(l())return;let i=e.retry??(E()?0:3),a=e.retryDelay??ae,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),ee(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:c,status:()=>a,cancel:u,continue:()=>(r?.(),c),cancelRetry:d,continueRetry:f,canStart:m,start:()=>(m()?v():_().then(v),c)}}var F=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o(this.gcTime)&&(this.#e=t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(E()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(t.clearTimeout(this.#e),this.#e=void 0)}};function oe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{w(e,()=>t.signal,()=>n=!0)},u=C(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?x:te;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?se:I,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:I(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function I(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function se(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ce=class extends F{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=z(this.options);e.data!==void 0&&(this.setState(R(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=b(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(i).catch(i):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>c(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===S||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>c(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!s(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=C(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?oe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=P({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof M&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof M){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...R(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:j(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function R(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var B=new Set([`GET`,`HEAD`,`OPTIONS`]),V=new Set([`/auth/login`,`/auth/setup`]),H=`csrf_token`;function U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function W(e,t){return`${t===`upstream`||t===void 0&&e>=500?`Upstream`:t===`network`?`Network`:`Console`} request failed (${e})`}function le(e,t){if(U(e)){if(typeof e.message==`string`)return e.message;if(typeof e.error==`string`)return e.error;if(U(e.error)&&typeof e.error.message==`string`)return e.error.message}return W(t,K(e))}function G(e){if(U(e)){if(typeof e.code==`string`)return e.code;if(U(e.error)&&typeof e.error.code==`string`)return e.error.code}}function K(e){if(!U(e))return;let t=typeof e.origin==`string`?e.origin:U(e.error)&&typeof e.error.origin==`string`?e.error.origin:void 0;return t===`cartethyia`||t===`upstream`||t===`network`?t:void 0}function ue(e){if(U(e))return U(e.details)?e.details:U(e.error)&&U(e.error.details)?e.error.details:void 0}async function q(e){try{return await e.json()}catch{throw{status:e.status,code:`invalid_response`,message:`Upstream returned a non-JSON response (${e.status})`}}}function J(e,t){let n=G(e),r=K(e),i=ue(e);throw{status:t,message:le(e,t),...n?{code:n}:{},...r?{origin:r}:{},...i?{details:i}:{}}}function Y(){if(!(typeof document>`u`||typeof document.cookie!=`string`))for(let e of document.cookie.split(`;`)){let t=e.indexOf(`=`);if(t!==-1&&e.slice(0,t).trim()===H){let n=e.slice(t+1).trim();return n.length>0?n:void 0}}}function de(e,t,n){return n.csrf===!1||B.has(t)?!1:!V.has(e)}var fe=new Set([`/auth/login`,`/auth/setup`,`/auth/setup/restore`,`/auth/session`,`/auth/first-boot`]),pe=new Set([`insufficient_scope`,`tenant_required`,`provider_is_builtin`,`invalid_scope`,`invalid_request`,`not_authorized`]),X;function me(e){X=e}function Z(e){X?.(e)}function Q(e,t,n){if(fe.has(e)||t!==401&&t!==403||K(n)===`upstream`||K(n)===`network`)return;if(t===401){Z(`expired`);return}let r=G(n);r!==void 0&&pe.has(r)||Z(`banned`)}async function $(e,t={}){let n=(t.method??`GET`).toUpperCase(),r=new Headers(t.headers);if(r.has(`Accept`)||r.set(`Accept`,`application/json`),t.body!=null&&!(t.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`),de(e,n,t)&&!r.has(`X-CSRF-Token`)){let e=Y();e&&r.set(`X-CSRF-Token`,e)}let{csrf:i,...a}=t,o=await fetch(`/console/api${e}`,{...a,method:n,credentials:`same-origin`,headers:r}),s=await q(o);return o.ok||(Q(e,o.status,s),J(s,o.status)),s}async function he(e,t,n){let r=new TextEncoder().encode(t).byteLength,i=await new Promise((i,a)=>{let o=new XMLHttpRequest;o.open(`POST`,`/console/api${e}`),o.withCredentials=!0,o.setRequestHeader(`Content-Type`,`application/json`),o.setRequestHeader(`Accept`,`application/json`);let s=Y();s&&o.setRequestHeader(`X-CSRF-Token`,s),o.upload.onprogress=e=>{n?.({loaded:e.loaded,total:e.lengthComputable?e.total:r})},o.onload=()=>i(new Response(o.responseText,{status:o.status})),o.onerror=()=>a(Error(`Network request failed`)),o.send(t)}),a=await q(i);return i.ok||(Q(e,i.status,a),J(a,i.status)),a}async function ge(){let e=await $(`/auth/session`);return e.status===`authenticated`?{id:e.user_id,username:e.username,email:e.email,displayName:e.display_name,isFirstBoot:e.is_first_boot,sessionExpiresAt:e.session_expires_at,isPlatformAdmin:e.is_platform_admin}:null}function _e(e,t=`Request failed`){return ve(e)&&e.message.trim().length>0||e instanceof Error&&e.message.trim().length>0?e.message:t}function ve(e){return typeof e==`object`&&!!e&&`message`in e&&typeof e.message==`string`}var ye={staleTime:6e4,gcTime:12e4,retry:!1,refetchOnWindowFocus:!1},be={retry:0},xe={effectivelyImmutable:3e5},Se={warming:2e3,live:5e3,status:1e4,catalog:6e4},Ce={session:{current:[`console`,`session`]},system:{health:[`console`,`system`,`health`]},releases:{githubLatest:[`console`,`releases`,`github-latest`]},usageAnalytics:{summary:e=>[`console`,`usage`,`summary`,e],chart:e=>[`console`,`usage`,`chart`,e],by:(e,t)=>[`console`,`usage`,`by`,e,t],requests:(e,t,n)=>[`console`,`usage`,`requests`,e,t,n??`all`],requestDetail:e=>[`console`,`usage`,`requests`,e]},providers:{all:[`console`,`providers`],detail:e=>[`console`,`providers`,e],models:e=>[`console`,`providers`,e,`models`],flatAll:[`console`,`providers`,`models-flat-all`],accounts:e=>[`console`,`providers`,e,`accounts`],routing:e=>[`console`,`providers`,e,`routing`],accountInflight:e=>[`console`,`providers`,e,`account-inflight`],healthEvents:(e,t)=>[`console`,`providers`,e,`accounts`,t,`health-events`]},modelRouting:{all:[`console`,`model-routing`],aliases:[`console`,`model-routing`,`aliases`],combos:[`console`,`model-routing`,`combos`]},network:{pools:[`console`,`network`,`pools`],poolStrategy:[`console`,`network`,`pool-strategy`]},apiKeys:{all:[`console`,`api-keys`],shareLink:e=>[`console`,`api-keys`,e,`share`],sharedKeys:e=>[`console`,`api-keys`,e,`shared-keys`],sharedKeyActivity:(e,t)=>[`console`,`api-keys`,e,`shared-keys`,t,`activity`]},modelBans:{all:[`console`,`model-bans`]},settings:{runtime:[`console`,`settings`,`runtime`],diskUsage:[`console`,`settings`,`disk-usage`]},remoteSupport:{status:[`console`,`remote-support`,`status`]},cliTools:{registry:[`console`,`cli-tools`,`registry`],statuses:[`console`,`cli-tools`,`statuses`],mappings:(e,t)=>[`console`,`cli-tools`,e,t,`mappings`]},audit:{list:e=>[`console`,`audit`,`list`,e]},quota:{all:[`console`,`quota`],account:e=>[`console`,`quota`,`account`,e],resets:e=>[`console`,`quota`,`account`,e,`resets`]},inferhub:{summary:[`console`,`inferhub`,`summary`],models:e=>[`console`,`inferhub`,`models`,e??`all`]}};export{b as A,f as C,l as D,u as E,s as F,t as I,g as M,ne as N,i as O,S as P,a as S,o as T,A as _,Se as a,D as b,ge as c,me as d,ce as f,N as g,P as h,ye as i,c as j,p as k,_e as l,F as m,xe as n,$ as o,L as p,be as r,he as s,Ce as t,U as u,k as v,d as w,E as x,O as y};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,T as t,i as n,o as r,u as i,v as a}from"./assert-
|
|
1
|
+
import{C as e,T as t,i as n,o as r,u as i,v as a}from"./assert-DU6qrMA_.js";import{a as o,i as s,o as c,t as l}from"./query-keys-UETqfytp.js";import{t as u}from"./useMutation-EDFRkn1i.js";function d(){return e({queryKey:l.modelRouting.aliases,queryFn:e=>c(`/routing/aliases`,{signal:a(e)}).then(n),...s})}function f(){return e({queryKey:l.modelRouting.combos,queryFn:e=>c(`/routing/combos`,{signal:a(e)}).then(r),...s})}function p(t){return e({queryKey:l.providers.routing(t),queryFn:e=>c(`/providers/${encodeURIComponent(t??``)}/routing`,{signal:a(e)}).then(i),enabled:t!==void 0&&t.length>0,...s})}function m(t){return e({queryKey:l.providers.accountInflight(t),queryFn:async e=>{let n=await c(`/providers/${encodeURIComponent(t??``)}/account-inflight`,{signal:a(e)});if(!Array.isArray(n))throw{status:500,code:`invalid_response`,message:`Invalid account inflight response`};let r=new Map;for(let e of n){if(typeof e!=`object`||!e)continue;let t=e;typeof t.accountId==`string`&&typeof t.inflight==`number`&&r.set(t.accountId,Math.max(0,Math.floor(t.inflight)))}return r},enabled:t!==void 0&&t.length>0,refetchInterval:o.live,refetchIntervalInBackground:!1})}function h(){let e=t();return u({mutationFn:e=>c(`/routing/aliases`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.aliases})}})}function g(){let e=t();return u({mutationFn:({id:e,request:t})=>c(`/routing/aliases/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.aliases})}})}function _(){let e=t();return u({mutationFn:e=>c(`/routing/aliases/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.aliases})}})}function v(){let e=t();return u({mutationFn:e=>c(`/routing/aliases/reorder`,{method:`POST`,body:JSON.stringify({ids:e})}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.aliases})}})}function y(){let e=t();return u({mutationFn:e=>c(`/routing/combos/reorder`,{method:`POST`,body:JSON.stringify({ids:e})}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.combos})}})}function b(){let e=t();return u({mutationFn:e=>c(`/routing/combos`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.combos})}})}function x(){let e=t();return u({mutationFn:e=>c(`/routing/combos/${encodeURIComponent(e)}/clone`,{method:`POST`}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.combos})}})}function S(){let e=t();return u({mutationFn:({id:e,request:t})=>c(`/routing/combos/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.combos})}})}function C(){let e=t();return u({mutationFn:e=>c(`/routing/combos/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:async()=>{await e.invalidateQueries({queryKey:l.modelRouting.combos})}})}function w(){let e=t();return u({mutationFn:({providerId:e,request:t})=>c(`/providers/${encodeURIComponent(e)}/routing`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:l.providers.routing(n.providerId)}),await e.invalidateQueries({queryKey:l.providers.all})}})}export{C as a,m as c,y as d,g as f,_ as i,p as l,w as m,h as n,d as o,S as p,b as r,f as s,x as t,v as u};
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{c as r}from"./app-BIt446yE.js";import{O as i,m as a}from"./numbers-DkfMR5Qs.js";import{lt as o}from"./entry-ByMGkR3C.js";var s=e(t(),1),c=e(r(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,[t,n]){return Math.min(n,Math.max(t,e))}u(d,`clamp`);var f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=!!(typeof window<`u`&&window.document&&window.document.createElement);function h(e,t,{checkForDefaultPrevented:n=!0}={}){return p(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}p(h,`composeEventHandlers`);function g(e){if(!m)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}p(g,`getOwnerWindow`);function _(e){if(!m)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}p(_,`getOwnerDocument`);function v(e,t=!1){let{activeElement:n}=_(e);if(!n?.nodeName)return null;if(y(n)&&n.contentDocument)return v(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=_(n).getElementById(e);if(t)return t}}return n}p(v,`getActiveElement`);function y(e){return e.tagName===`IFRAME`}p(y,`isFrame`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=S(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[o,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>s.createContext(e));return S(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0});function O(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}D(O,`setRef`);function k(...e){return t=>{let n=!1,r=e.map(e=>{let r=O(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():O(e[t],null)}}}}D(k,`composeRefs`);function A(...e){return s.useCallback(k(...e),e)}D(A,`useComposedRefs`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0});function N(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];te(r)&&typeof ae==`function`&&(r=ae(r._payload)),s.Children.forEach(r,e=>{if(z(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;te(n)&&typeof ae==`function`&&(n=ae(n._payload)),a=I(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?R(a):void 0,u=A(n,l);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let d=L(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}M(N,`createSlot`);var P=Symbol.for(`radix.slottable`);function F(e){let t=M(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=P,t}M(F,`createSlottable`);var I=M((e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function L(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}M(L,`mergeProps`);function R(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}M(R,`getElementRef`);function z(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===P}M(z,`isSlottable`);var ee=Symbol.for(`react.lazy`);function te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ee&&`_payload`in e&&ne(e._payload)}M(te,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}M(ne,`isPromiseLike`);var re=M(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=M(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ae=s.use,oe=Object.defineProperty,B=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=B(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,b.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let c=e+`CollectionSlot`,l=N(c),u=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(c,n).collectionRef);return(0,b.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=N(d),m=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=A(t,o),l=a(d,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,b.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return B(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}B(se,`createCollection`);var ce=new WeakMap,le=class e extends Map{static{B(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ce.set(this,!0)}set(e,t){return ce.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=fe(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ue(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ue(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ue(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ue(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=de(e,t);return n===-1?void 0:e[n]}B(ue,`at`);function de(e,t){let n=e.length,r=fe(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}B(de,`toSafeIndex`);function fe(e){return e!==e||e===0?0:Math.trunc(e)}B(fe,`toSafeInteger`);function pe(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new le,setItemMap:B(()=>void 0,`setItemMap`)}),o=B(({state:e,...t})=>e?(0,b.jsx)(l,{...t,state:e}):(0,b.jsx)(c,{...t}),`CollectionProvider`);o.displayName=t;let c=B(e=>{let t=g();return(0,b.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=B(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,c]=s.useState(null),l=A(a,c),[u,d]=r;return s.useEffect(()=>{if(!o)return;let e=_e(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,b.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=N(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(u,n).collectionRef);return(0,b.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=N(p),h=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),[c,l]=s.useState(null),u=A(t,o,l),{setItemMap:d}=a(p,n),f=s.useRef(i);me(f.current,i)||(f.current=i);let h=f.current;return s.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(ge):(t.set(c,{...e,element:c}),t.toSorted(ge)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new le(e)))}},[c,h,d]),(0,b.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return s.useState(new le)}B(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return B(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}B(pe,`createCollection`);function me(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}B(me,`shallowEqual`);function he(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}B(he,`isElementPreceding`);function ge(e,t){return!e[1].element||!t[1].element?0:he(e[1].element,t[1].element)?-1:1}B(ge,`sortByDocumentPosition`);function _e(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}B(_e,`getChildListObserver`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=s.createContext(void 0);function xe(e){let t=s.useContext(be);return e||t||`ltr`}ye(xe,`useDirection`);var Se=Object.defineProperty,Ce=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function we(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}Ce(we,`dispatchDiscreteCustomEvent`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function H(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ee(H,`useCallbackRef`);var De=Object.defineProperty,U=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Oe=`dismissableLayer.update`,ke=`dismissableLayer.pointerDownOutside`,Ae=`dismissableLayer.focusOutside`,je,Me=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ne=s.forwardRef(U(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(Me),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=A(t,p),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?v.indexOf(y):-1,S=f?v.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=s.useRef(!1),E=Ie(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Le(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?S===v.length-1:!1,k=H(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return s.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(je=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Re(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=je))}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Re())},[f,d]),s.useEffect(()=>{let e=U(()=>g({}),`handleUpdate`);return document.addEventListener(Oe,e),()=>document.removeEventListener(Oe,e)},[]),(0,b.jsx)(V.div,{...u,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:h(e.onFocusCapture,D.onFocusCapture),onBlurCapture:h(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Pe(){let e=s.useContext(Me),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}U(Pe,`useDismissableLayerSurface`);var Fe=U(()=>!0,`IS_TRUE`);function Ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fe}=t,c=H(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}U(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}U(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}U(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}U(p,`handleInteractionBubble`);let m=U(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ze(ke,c,p,{discrete:!0})};if(U(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:U(()=>l.current=!0,`onPointerDownCapture`)}}U(Ie,`usePointerDownOutside`);function Le(e,t=globalThis?.document){let n=H(e),r=s.useRef(!1);return s.useEffect(()=>{let e=U(e=>{e.target&&!r.current&&ze(Ae,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:U(()=>r.current=!0,`onFocusCapture`),onBlurCapture:U(()=>r.current=!1,`onBlurCapture`)}}U(Le,`useFocusOutside`);function Re(){let e=new CustomEvent(Oe);document.dispatchEvent(e)}U(Re,`dispatchUpdate`);function ze(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?we(i,a):i.dispatchEvent(a)}U(ze,`handleAndDispatchCustomEvent`);var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=0,Ue=null;function We(e){return Ge(),e.children}Ve(We,`FocusGuards`);function Ge(){s.useEffect(()=>{Ue||={start:Ke(),end:Ke()};let{start:e,end:t}=Ue;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),He++,()=>{He===1&&(Ue?.start.remove(),Ue?.end.remove(),Ue=null),He=Math.max(0,He-1)}},[])}Ve(Ge,`useFocusGuards`);function Ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ve(Ke,`createFocusGuard`);var qe=Object.defineProperty,W=(e,t)=>qe(e,`name`,{value:t,configurable:!0}),Je=`focusScope.autoFocusOnMount`,Ye=`focusScope.autoFocusOnUnmount`,Xe={bubbles:!1,cancelable:!0},Ze=s.forwardRef(W(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),u=H(i),d=H(a),f=s.useRef(null),p=A(t,l),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:G(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||G(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&G(c)};W(e,`handleFocusIn`),W(t,`handleFocusOut`),W(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),s.useEffect(()=>{if(c){it.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Je,Xe);c.addEventListener(Je,u),c.dispatchEvent(t),t.defaultPrevented||(Qe(st(et(c)),{select:!0}),document.activeElement===e&&G(c))}return()=>{c.removeEventListener(Je,u),setTimeout(()=>{let t=new CustomEvent(Ye,Xe);c.addEventListener(Ye,d),c.dispatchEvent(t),t.defaultPrevented||G(e??document.body,{select:!0}),c.removeEventListener(Ye,d),it.remove(m)},0)}}},[c,u,d,m]);let h=s.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&G(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&G(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(V.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(G(r,{select:t}),document.activeElement!==n)return}W(Qe,`focusFirst`);function $e(e){let t=et(e);return[tt(t,e),tt(t.reverse(),e)]}W($e,`getTabbableEdges`);function et(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:W(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}W(et,`getTabbableCandidates`);function tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nt(r,{upTo:t})))return r}W(tt,`findVisible`);function nt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}W(nt,`isHidden`);function rt(e){return e instanceof HTMLInputElement&&`select`in e}W(rt,`isSelectableInput`);function G(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rt(e)&&t&&e.select()}}W(G,`focus`);var it=at();function at(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ot(e,t),e.unshift(t)},remove(t){e=ot(e,t),e[0]?.resume()}}}W(at,`createFocusScopesStack`);function ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}W(ot,`arrayRemove`);function st(e){return e.filter(e=>e.tagName!==`A`)}W(st,`removeLinks`);var K=globalThis?.document?s.useLayoutEffect:()=>{},ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=s.useId||(()=>void 0),dt=0;function ft(e){let[t,n]=s.useState(ut());return K(()=>{e||n(e=>e??String(dt++))},[e]),e||(t?`radix-${t}`:``)}lt(ft,`useId`);var pt=[`top`,`right`,`bottom`,`left`],mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(q(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return yt[t]+e.slice(t.length)}function Lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ct(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),D=mt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=bt(E,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=q(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===q(t)||T.every(e=>q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return pt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=q(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(i),p=wt(f),m=u[p],h=u[f],g=(e,t)=>bt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=q(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xt(e,t),c=await i.detectOverflow(t,s),l=St(n),u=Ct(n),d=q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mt(p-c[m],g),y=mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ht(c.left,c.right):S=p-2*ht(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return an(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rn(e){return((an(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function an(e){return tn()?e instanceof Node||e instanceof J(e).Node:!1}function Y(e){return tn()?e instanceof Element||e instanceof J(e).Element:!1}function on(e){return tn()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function sn(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function cn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ln(e){return/^(table|td|th)$/.test(nn(e))}function un(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,pn=e=>!!e&&e!==`none`,mn;function hn(e){let t=Y(e)?X(e):e;return pn(t.transform)||pn(t.translate)||pn(t.scale)||pn(t.rotate)||pn(t.perspective)||!_n()&&(pn(t.backdropFilter)||pn(t.filter))||dn.test(t.willChange||``)||fn.test(t.contain||``)}function gn(e){let t=bn(e);for(;on(t)&&!vn(t);){if(hn(t))return t;if(un(t))return null;t=bn(t)}return null}function _n(){return mn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mn}function vn(e){return/^(html|body|#document)$/.test(nn(e))}function X(e){return J(e).getComputedStyle(e)}function yn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||rn(e);return sn(t)?t.host:t}function xn(e){let t=bn(e);return vn(t)?(e.ownerDocument||e).body:on(t)&&cn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],cn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tn(e){return Y(e)?e:e.contextElement}function En(e){let t=Tn(e);if(!on(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dn=vt(0);function On(e){let t=J(e);return!_n()||!t.visualViewport?Dn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===J(e)}function An(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tn(e),o=vt(1);t&&(r?Y(r)&&(o=En(r)):o=En(e));let s=kn(a,n,r)?On(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=J(a),t=Y(r)?J(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=En(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=Cn(n)}}return zt({width:u,height:d,x:c,y:l})}function jn(e,t){let n=yn(e).scrollLeft;return t?t.left+n:An(rn(e)).left+n}function Mn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jn(e,n),y:n.top+t.scrollTop}}function Nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rn(r),s=t?un(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=on(r);if((d||!a)&&((nn(r)!==`body`||cn(o))&&(c=yn(r)),d)){let e=An(r);l=En(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fn(e){let t=yn(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jn(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var In=25;function Ln(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=J(e),a=rn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_n()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=In&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rn(e,t){let n=An(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ln(e,n,t);else if(t===`document`)r=Fn(rn(e));else if(Y(t))r=Rn(t,n);else{let n=On(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Bn(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>Y(e)&&nn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?bn(e):e;for(;Y(o)&&!vn(o);){let e=X(o),t=hn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?un(t)?[]:Bn(t,this._c):[].concat(n),r],o=zn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hn(e){let{width:t,height:n}=wn(e);return{width:t,height:n}}function Un(e,t,n){let r=on(t),i=rn(t),a=n===`fixed`,o=An(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);if((r||!a)&&((nn(t)!==`body`||cn(i))&&(s=yn(t)),r)){let e=An(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jn(i));let l=i&&!r&&!a?Mn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wn(e){return X(e).position===`static`}function Gn(e,t){if(!on(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rn(e)===n&&(n=n.ownerDocument.body),n}function Kn(e,t){let n=J(e);if(un(e))return n;if(!on(e)){let t=bn(e);for(;t&&!vn(t);){if(Y(t)&&!Wn(t))return t;t=bn(t)}return n}let r=Gn(e,t);for(;r&&ln(r)&&Wn(r);)r=Gn(r,t);return r&&vn(r)&&Wn(r)&&!hn(r)?n:r||gn(e)||n}var qn=async function(e){let t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Un(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jn(e){return X(e).direction===`rtl`}var Yn={convertOffsetParentRelativeRectToViewportRelativeRect:Nn,getDocumentElement:rn,getClippingRect:Vn,getOffsetParent:Kn,getElementRects:qn,getClientRects:Pn,getDimensions:Hn,getScale:En,isElement:Y,isRTL:Jn};function Xn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zn(e,t,n){let r=null,i,a=rn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_t(d),h=_t(a.clientWidth-(u+f)),g=_t(a.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=J(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Tn(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?An(e):null;c&&g();function g(){let t=An(e);h&&!Xn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $n=Zt,er=Qt,tr=Gt,nr=en,rr=Jt,ir=Wt,ar=$t,or=(e,t,n)=>{let r=new Map,i=n??{},a={...Yn,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},sr=typeof document<`u`?s.useLayoutEffect:function(){};function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){let n=lr(e);return Math.round(t*n)/n}function dr(e){let t=s.useRef(e);return sr(()=>{t.current=e}),t}function fr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);cr(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=u!=null,O=dr(u),k=dr(i),A=dr(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),or(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cr(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);sr(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);sr(()=>(M.current=!0,()=>{M.current=!1}),[]),sr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ur(P.floating,f.x),r=ur(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var pr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ir({element:r.current,padding:i}).fn(n):r?ir({element:r,padding:i}).fn(n):{}}}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>({fn:ar(e).fn,options:[e,t]}),_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e){let[t,n]=s.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Sr(Cr,`useSize`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=`Popper`,[Dr,Or]=w(Er),[kr,Ar]=Dr(Er),jr=Tr(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,b.jsx)(kr,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Mr=`PopperAnchor`,Nr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ar(Mr,n),o=s.useRef(null),c=a.onAnchorChange,l=A(t,s.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Br(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,b.jsx)(V.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Pr=`PopperContent`,[Fr,Ir]=Dr(Pr),Lr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Ar(Pr,n),[v,y]=s.useState(null),x=A(t,y),[S,C]=s.useState(null),w=Cr(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],j=k.length>0,M={padding:O,boundary:k.filter(Rr),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=fr({strategy:`fixed`,placement:D,whileElementsMounted:Tr((...e)=>Qn(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[mr({mainAxis:i+E,alignmentAxis:o}),l&&hr({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gr():void 0,...M}),l&&_r({...M}),vr({...M,apply:Tr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&br({element:S,padding:c}),zr({arrowWidth:T,arrowHeight:E}),p&&yr({strategy:`referenceHidden`,...M,boundary:j?M.boundary:void 0})]}),R=_.setPlacementState;K(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,ee]=Br(F),te=H(h);K(()=>{I&&te?.()},[I,te]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=s.useState();return K(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,b.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Fr,{scope:n,placedSide:z,placedAlign:ee,onArrowChange:C,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,b.jsx)(V.div,{"data-side":z,"data-align":ee,...g,ref:x,style:{...g.style,animation:I?g.style?.animation:`none`}})})})},`PopperContent`));function Rr(e){return e!==null}Tr(Rr,`isNotNull`);var zr=Tr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Tr(Br,`getSideAndAlignFromPlacement`);var Vr=jr,Hr=Nr,Ur=Lr,Wr=Object.defineProperty,Gr=s.forwardRef(((e,t)=>Wr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?c.createPortal((0,b.jsx)(V.div,{...r,ref:t}),o):null},`Portal`)),Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0});function Jr(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}qr(Jr,`useStateMachine`);var Yr=qr(e=>{let{present:t,children:n}=e,r=Xr(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Qr(r.ref,ei(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Xr(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Jr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??$r(r.current),o.current=void 0):a.current=`none`},[c]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$r(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qr(a=>{let o=$r(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qr(e=>{e.target===t&&(a.current=$r(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$r(t)}else r.current=null;n(e)},[])}}qr(Xr,`usePresence`);function Zr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qr(Zr,`setRef`);function Qr(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zr(n[e],null)}}},[])}qr(Qr,`useStableComposedRefs`);function $r(e){return e?.animationName||`none`}qr($r,`getAnimationName`);function ei(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qr(ei,`getElementRef`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=s.useEffectEvent,ii=s.useInsertionEffect;function ai(e){if(typeof ri==`function`)return ri(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ii==`function`?ii(()=>{t.current=e}):K(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}ni(ai,`useEffectEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=s.useInsertionEffect||K;function li({prop:e,defaultProp:t,onChange:n=si(()=>{},`onChange`),caller:r}){let[i,a,o]=ui({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=di(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}si(li,`useControllableState`);function ui({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return ci(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}si(ui,`useUncontrolledState`);function di(e){return typeof e==`function`}si(di,`isFunction`);var fi=Symbol(`RADIX:SYNC_STATE`);function pi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=ai(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===fi)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:fi,state:i})},[i,f.state,l]),[g,p]}si(pi,`useControllableStateReducer`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0});function gi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}hi(gi,`usePrevious`);var _i=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},yi=new WeakMap,bi=new WeakMap,xi={},Si=0,Ci=function(e){return e&&(e.host||Ci(e.parentNode))},wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ci(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ti=function(e,t,n,r){var i=wi(t,Array.isArray(e)?e:[e]);xi[n]||(xi[n]=new WeakMap);var a=xi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(yi.get(e)||0)+1,l=(a.get(e)||0)+1;yi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Si++,function(){o.forEach(function(e){var t=yi.get(e)-1,i=a.get(e)-1;yi.set(e,t),a.set(e,i),t||(bi.has(e)||e.removeAttribute(r),bi.delete(e)),i||e.removeAttribute(n)}),Si--,Si||(yi=new WeakMap,yi=new WeakMap,bi=new WeakMap,xi={})}},Ei=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ti(r,i,n,`aria-hidden`)):function(){return null}},Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ki=`right-scroll-bar-position`,Ai=`width-before-scroll-bar`,ji=`with-scroll-bars-hidden`,Mi=`--removed-body-scroll-bar-size`;function Ni(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pi(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fi=typeof window<`u`?s.useLayoutEffect:s.useEffect,Ii=new WeakMap;function Li(e,t){var n=Pi(t||null,function(t){return e.forEach(function(e){return Ni(e,t)})});return Fi(function(){var t=Ii.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ni(e,null)}),i.forEach(function(e){r.has(e)||Ni(e,a)})}Ii.set(n,e)},[e]),n}function Ri(e){return e}function zi(e,t){t===void 0&&(t=Ri);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bi(e){e===void 0&&(e={});var t=zi(null);return t.options=Z({async:!0,ssr:!1},e),t}var Vi=function(e){var t=e.sideCar,n=Di(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,Z({},n))};Vi.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),Vi}var Ui=Bi(),Wi=function(){},Gi=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Di(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Li([n,t]),w=Z(Z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ui,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),Z(Z({},w),{ref:C})):s.createElement(y,Z({},w,{className:l,ref:C}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Ai,zeroRight:ki};var Ki=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ki();return t&&e.setAttribute(`nonce`,t),e}function Ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ji(t,n),Yi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zi=function(){var e=Xi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qi=function(){var e=Zi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$i={left:0,top:0,right:0,gap:0},ea=function(e){return parseInt(e||``,10)||0},ta=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ea(n),ea(r),ea(i)]},na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $i;var t=ta(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ra=Qi(),ia=`data-scroll-locked`,aa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{u as r}from"./app-2KhtHCv9.js";import{O as i,m as a}from"./numbers-BOevJzdz.js";import{lt as o}from"./entry-CwPRKk0d.js";var s=e(t(),1),c=e(r(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,[t,n]){return Math.min(n,Math.max(t,e))}u(d,`clamp`);var f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=!!(typeof window<`u`&&window.document&&window.document.createElement);function h(e,t,{checkForDefaultPrevented:n=!0}={}){return p(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}p(h,`composeEventHandlers`);function g(e){if(!m)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}p(g,`getOwnerWindow`);function _(e){if(!m)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}p(_,`getOwnerDocument`);function v(e,t=!1){let{activeElement:n}=_(e);if(!n?.nodeName)return null;if(y(n)&&n.contentDocument)return v(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=_(n).getElementById(e);if(t)return t}}return n}p(v,`getActiveElement`);function y(e){return e.tagName===`IFRAME`}p(y,`isFrame`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=S(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[o,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>s.createContext(e));return S(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0});function O(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}D(O,`setRef`);function k(...e){return t=>{let n=!1,r=e.map(e=>{let r=O(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():O(e[t],null)}}}}D(k,`composeRefs`);function A(...e){return s.useCallback(k(...e),e)}D(A,`useComposedRefs`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0});function N(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];te(r)&&typeof ae==`function`&&(r=ae(r._payload)),s.Children.forEach(r,e=>{if(z(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;te(n)&&typeof ae==`function`&&(n=ae(n._payload)),a=I(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?R(a):void 0,u=A(n,l);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let d=L(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}M(N,`createSlot`);var P=Symbol.for(`radix.slottable`);function F(e){let t=M(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=P,t}M(F,`createSlottable`);var I=M((e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function L(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}M(L,`mergeProps`);function R(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}M(R,`getElementRef`);function z(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===P}M(z,`isSlottable`);var ee=Symbol.for(`react.lazy`);function te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ee&&`_payload`in e&&ne(e._payload)}M(te,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}M(ne,`isPromiseLike`);var re=M(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=M(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ae=s.use,oe=Object.defineProperty,B=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=B(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,b.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let c=e+`CollectionSlot`,l=N(c),u=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(c,n).collectionRef);return(0,b.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=N(d),m=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=A(t,o),l=a(d,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,b.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return B(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}B(se,`createCollection`);var ce=new WeakMap,le=class e extends Map{static{B(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ce.set(this,!0)}set(e,t){return ce.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=fe(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ue(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ue(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ue(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ue(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=de(e,t);return n===-1?void 0:e[n]}B(ue,`at`);function de(e,t){let n=e.length,r=fe(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}B(de,`toSafeIndex`);function fe(e){return e!==e||e===0?0:Math.trunc(e)}B(fe,`toSafeInteger`);function pe(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new le,setItemMap:B(()=>void 0,`setItemMap`)}),o=B(({state:e,...t})=>e?(0,b.jsx)(l,{...t,state:e}):(0,b.jsx)(c,{...t}),`CollectionProvider`);o.displayName=t;let c=B(e=>{let t=g();return(0,b.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=B(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,c]=s.useState(null),l=A(a,c),[u,d]=r;return s.useEffect(()=>{if(!o)return;let e=_e(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,b.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=N(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(u,n).collectionRef);return(0,b.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=N(p),h=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),[c,l]=s.useState(null),u=A(t,o,l),{setItemMap:d}=a(p,n),f=s.useRef(i);me(f.current,i)||(f.current=i);let h=f.current;return s.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(ge):(t.set(c,{...e,element:c}),t.toSorted(ge)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new le(e)))}},[c,h,d]),(0,b.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return s.useState(new le)}B(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return B(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}B(pe,`createCollection`);function me(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}B(me,`shallowEqual`);function he(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}B(he,`isElementPreceding`);function ge(e,t){return!e[1].element||!t[1].element?0:he(e[1].element,t[1].element)?-1:1}B(ge,`sortByDocumentPosition`);function _e(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}B(_e,`getChildListObserver`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=s.createContext(void 0);function xe(e){let t=s.useContext(be);return e||t||`ltr`}ye(xe,`useDirection`);var Se=Object.defineProperty,Ce=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function we(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}Ce(we,`dispatchDiscreteCustomEvent`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function H(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ee(H,`useCallbackRef`);var De=Object.defineProperty,U=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Oe=`dismissableLayer.update`,ke=`dismissableLayer.pointerDownOutside`,Ae=`dismissableLayer.focusOutside`,je,Me=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ne=s.forwardRef(U(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(Me),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=A(t,p),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?v.indexOf(y):-1,S=f?v.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=s.useRef(!1),E=Ie(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Le(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?S===v.length-1:!1,k=H(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return s.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(je=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Re(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=je))}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Re())},[f,d]),s.useEffect(()=>{let e=U(()=>g({}),`handleUpdate`);return document.addEventListener(Oe,e),()=>document.removeEventListener(Oe,e)},[]),(0,b.jsx)(V.div,{...u,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:h(e.onFocusCapture,D.onFocusCapture),onBlurCapture:h(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Pe(){let e=s.useContext(Me),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}U(Pe,`useDismissableLayerSurface`);var Fe=U(()=>!0,`IS_TRUE`);function Ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fe}=t,c=H(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}U(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}U(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}U(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}U(p,`handleInteractionBubble`);let m=U(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ze(ke,c,p,{discrete:!0})};if(U(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:U(()=>l.current=!0,`onPointerDownCapture`)}}U(Ie,`usePointerDownOutside`);function Le(e,t=globalThis?.document){let n=H(e),r=s.useRef(!1);return s.useEffect(()=>{let e=U(e=>{e.target&&!r.current&&ze(Ae,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:U(()=>r.current=!0,`onFocusCapture`),onBlurCapture:U(()=>r.current=!1,`onBlurCapture`)}}U(Le,`useFocusOutside`);function Re(){let e=new CustomEvent(Oe);document.dispatchEvent(e)}U(Re,`dispatchUpdate`);function ze(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?we(i,a):i.dispatchEvent(a)}U(ze,`handleAndDispatchCustomEvent`);var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=0,Ue=null;function We(e){return Ge(),e.children}Ve(We,`FocusGuards`);function Ge(){s.useEffect(()=>{Ue||={start:Ke(),end:Ke()};let{start:e,end:t}=Ue;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),He++,()=>{He===1&&(Ue?.start.remove(),Ue?.end.remove(),Ue=null),He=Math.max(0,He-1)}},[])}Ve(Ge,`useFocusGuards`);function Ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ve(Ke,`createFocusGuard`);var qe=Object.defineProperty,W=(e,t)=>qe(e,`name`,{value:t,configurable:!0}),Je=`focusScope.autoFocusOnMount`,Ye=`focusScope.autoFocusOnUnmount`,Xe={bubbles:!1,cancelable:!0},Ze=s.forwardRef(W(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),u=H(i),d=H(a),f=s.useRef(null),p=A(t,l),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:G(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||G(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&G(c)};W(e,`handleFocusIn`),W(t,`handleFocusOut`),W(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),s.useEffect(()=>{if(c){it.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Je,Xe);c.addEventListener(Je,u),c.dispatchEvent(t),t.defaultPrevented||(Qe(st(et(c)),{select:!0}),document.activeElement===e&&G(c))}return()=>{c.removeEventListener(Je,u),setTimeout(()=>{let t=new CustomEvent(Ye,Xe);c.addEventListener(Ye,d),c.dispatchEvent(t),t.defaultPrevented||G(e??document.body,{select:!0}),c.removeEventListener(Ye,d),it.remove(m)},0)}}},[c,u,d,m]);let h=s.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&G(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&G(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(V.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(G(r,{select:t}),document.activeElement!==n)return}W(Qe,`focusFirst`);function $e(e){let t=et(e);return[tt(t,e),tt(t.reverse(),e)]}W($e,`getTabbableEdges`);function et(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:W(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}W(et,`getTabbableCandidates`);function tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nt(r,{upTo:t})))return r}W(tt,`findVisible`);function nt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}W(nt,`isHidden`);function rt(e){return e instanceof HTMLInputElement&&`select`in e}W(rt,`isSelectableInput`);function G(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rt(e)&&t&&e.select()}}W(G,`focus`);var it=at();function at(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ot(e,t),e.unshift(t)},remove(t){e=ot(e,t),e[0]?.resume()}}}W(at,`createFocusScopesStack`);function ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}W(ot,`arrayRemove`);function st(e){return e.filter(e=>e.tagName!==`A`)}W(st,`removeLinks`);var K=globalThis?.document?s.useLayoutEffect:()=>{},ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=s.useId||(()=>void 0),dt=0;function ft(e){let[t,n]=s.useState(ut());return K(()=>{e||n(e=>e??String(dt++))},[e]),e||(t?`radix-${t}`:``)}lt(ft,`useId`);var pt=[`top`,`right`,`bottom`,`left`],mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(q(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return yt[t]+e.slice(t.length)}function Lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ct(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),D=mt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=bt(E,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=q(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===q(t)||T.every(e=>q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return pt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=q(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(i),p=wt(f),m=u[p],h=u[f],g=(e,t)=>bt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=q(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xt(e,t),c=await i.detectOverflow(t,s),l=St(n),u=Ct(n),d=q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mt(p-c[m],g),y=mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ht(c.left,c.right):S=p-2*ht(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return an(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rn(e){return((an(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function an(e){return tn()?e instanceof Node||e instanceof J(e).Node:!1}function Y(e){return tn()?e instanceof Element||e instanceof J(e).Element:!1}function on(e){return tn()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function sn(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function cn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ln(e){return/^(table|td|th)$/.test(nn(e))}function un(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,pn=e=>!!e&&e!==`none`,mn;function hn(e){let t=Y(e)?X(e):e;return pn(t.transform)||pn(t.translate)||pn(t.scale)||pn(t.rotate)||pn(t.perspective)||!_n()&&(pn(t.backdropFilter)||pn(t.filter))||dn.test(t.willChange||``)||fn.test(t.contain||``)}function gn(e){let t=bn(e);for(;on(t)&&!vn(t);){if(hn(t))return t;if(un(t))return null;t=bn(t)}return null}function _n(){return mn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mn}function vn(e){return/^(html|body|#document)$/.test(nn(e))}function X(e){return J(e).getComputedStyle(e)}function yn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||rn(e);return sn(t)?t.host:t}function xn(e){let t=bn(e);return vn(t)?(e.ownerDocument||e).body:on(t)&&cn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],cn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tn(e){return Y(e)?e:e.contextElement}function En(e){let t=Tn(e);if(!on(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dn=vt(0);function On(e){let t=J(e);return!_n()||!t.visualViewport?Dn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===J(e)}function An(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tn(e),o=vt(1);t&&(r?Y(r)&&(o=En(r)):o=En(e));let s=kn(a,n,r)?On(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=J(a),t=Y(r)?J(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=En(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=Cn(n)}}return zt({width:u,height:d,x:c,y:l})}function jn(e,t){let n=yn(e).scrollLeft;return t?t.left+n:An(rn(e)).left+n}function Mn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jn(e,n),y:n.top+t.scrollTop}}function Nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rn(r),s=t?un(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=on(r);if((d||!a)&&((nn(r)!==`body`||cn(o))&&(c=yn(r)),d)){let e=An(r);l=En(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fn(e){let t=yn(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jn(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var In=25;function Ln(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=J(e),a=rn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_n()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=In&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rn(e,t){let n=An(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ln(e,n,t);else if(t===`document`)r=Fn(rn(e));else if(Y(t))r=Rn(t,n);else{let n=On(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Bn(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>Y(e)&&nn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?bn(e):e;for(;Y(o)&&!vn(o);){let e=X(o),t=hn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?un(t)?[]:Bn(t,this._c):[].concat(n),r],o=zn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hn(e){let{width:t,height:n}=wn(e);return{width:t,height:n}}function Un(e,t,n){let r=on(t),i=rn(t),a=n===`fixed`,o=An(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);if((r||!a)&&((nn(t)!==`body`||cn(i))&&(s=yn(t)),r)){let e=An(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jn(i));let l=i&&!r&&!a?Mn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wn(e){return X(e).position===`static`}function Gn(e,t){if(!on(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rn(e)===n&&(n=n.ownerDocument.body),n}function Kn(e,t){let n=J(e);if(un(e))return n;if(!on(e)){let t=bn(e);for(;t&&!vn(t);){if(Y(t)&&!Wn(t))return t;t=bn(t)}return n}let r=Gn(e,t);for(;r&&ln(r)&&Wn(r);)r=Gn(r,t);return r&&vn(r)&&Wn(r)&&!hn(r)?n:r||gn(e)||n}var qn=async function(e){let t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Un(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jn(e){return X(e).direction===`rtl`}var Yn={convertOffsetParentRelativeRectToViewportRelativeRect:Nn,getDocumentElement:rn,getClippingRect:Vn,getOffsetParent:Kn,getElementRects:qn,getClientRects:Pn,getDimensions:Hn,getScale:En,isElement:Y,isRTL:Jn};function Xn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zn(e,t,n){let r=null,i,a=rn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_t(d),h=_t(a.clientWidth-(u+f)),g=_t(a.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=J(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Tn(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?An(e):null;c&&g();function g(){let t=An(e);h&&!Xn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $n=Zt,er=Qt,tr=Gt,nr=en,rr=Jt,ir=Wt,ar=$t,or=(e,t,n)=>{let r=new Map,i=n??{},a={...Yn,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},sr=typeof document<`u`?s.useLayoutEffect:function(){};function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){let n=lr(e);return Math.round(t*n)/n}function dr(e){let t=s.useRef(e);return sr(()=>{t.current=e}),t}function fr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);cr(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=u!=null,O=dr(u),k=dr(i),A=dr(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),or(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cr(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);sr(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);sr(()=>(M.current=!0,()=>{M.current=!1}),[]),sr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ur(P.floating,f.x),r=ur(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var pr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ir({element:r.current,padding:i}).fn(n):r?ir({element:r,padding:i}).fn(n):{}}}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>({fn:ar(e).fn,options:[e,t]}),_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e){let[t,n]=s.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Sr(Cr,`useSize`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=`Popper`,[Dr,Or]=w(Er),[kr,Ar]=Dr(Er),jr=Tr(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,b.jsx)(kr,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Mr=`PopperAnchor`,Nr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ar(Mr,n),o=s.useRef(null),c=a.onAnchorChange,l=A(t,s.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Br(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,b.jsx)(V.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Pr=`PopperContent`,[Fr,Ir]=Dr(Pr),Lr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Ar(Pr,n),[v,y]=s.useState(null),x=A(t,y),[S,C]=s.useState(null),w=Cr(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],j=k.length>0,M={padding:O,boundary:k.filter(Rr),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=fr({strategy:`fixed`,placement:D,whileElementsMounted:Tr((...e)=>Qn(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[mr({mainAxis:i+E,alignmentAxis:o}),l&&hr({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gr():void 0,...M}),l&&_r({...M}),vr({...M,apply:Tr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&br({element:S,padding:c}),zr({arrowWidth:T,arrowHeight:E}),p&&yr({strategy:`referenceHidden`,...M,boundary:j?M.boundary:void 0})]}),R=_.setPlacementState;K(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,ee]=Br(F),te=H(h);K(()=>{I&&te?.()},[I,te]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=s.useState();return K(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,b.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Fr,{scope:n,placedSide:z,placedAlign:ee,onArrowChange:C,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,b.jsx)(V.div,{"data-side":z,"data-align":ee,...g,ref:x,style:{...g.style,animation:I?g.style?.animation:`none`}})})})},`PopperContent`));function Rr(e){return e!==null}Tr(Rr,`isNotNull`);var zr=Tr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Tr(Br,`getSideAndAlignFromPlacement`);var Vr=jr,Hr=Nr,Ur=Lr,Wr=Object.defineProperty,Gr=s.forwardRef(((e,t)=>Wr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?c.createPortal((0,b.jsx)(V.div,{...r,ref:t}),o):null},`Portal`)),Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0});function Jr(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}qr(Jr,`useStateMachine`);var Yr=qr(e=>{let{present:t,children:n}=e,r=Xr(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Qr(r.ref,ei(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Xr(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Jr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??$r(r.current),o.current=void 0):a.current=`none`},[c]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$r(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qr(a=>{let o=$r(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qr(e=>{e.target===t&&(a.current=$r(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$r(t)}else r.current=null;n(e)},[])}}qr(Xr,`usePresence`);function Zr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qr(Zr,`setRef`);function Qr(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zr(n[e],null)}}},[])}qr(Qr,`useStableComposedRefs`);function $r(e){return e?.animationName||`none`}qr($r,`getAnimationName`);function ei(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qr(ei,`getElementRef`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=s.useEffectEvent,ii=s.useInsertionEffect;function ai(e){if(typeof ri==`function`)return ri(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ii==`function`?ii(()=>{t.current=e}):K(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}ni(ai,`useEffectEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=s.useInsertionEffect||K;function li({prop:e,defaultProp:t,onChange:n=si(()=>{},`onChange`),caller:r}){let[i,a,o]=ui({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=di(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}si(li,`useControllableState`);function ui({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return ci(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}si(ui,`useUncontrolledState`);function di(e){return typeof e==`function`}si(di,`isFunction`);var fi=Symbol(`RADIX:SYNC_STATE`);function pi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=ai(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===fi)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:fi,state:i})},[i,f.state,l]),[g,p]}si(pi,`useControllableStateReducer`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0});function gi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}hi(gi,`usePrevious`);var _i=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},yi=new WeakMap,bi=new WeakMap,xi={},Si=0,Ci=function(e){return e&&(e.host||Ci(e.parentNode))},wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ci(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ti=function(e,t,n,r){var i=wi(t,Array.isArray(e)?e:[e]);xi[n]||(xi[n]=new WeakMap);var a=xi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(yi.get(e)||0)+1,l=(a.get(e)||0)+1;yi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Si++,function(){o.forEach(function(e){var t=yi.get(e)-1,i=a.get(e)-1;yi.set(e,t),a.set(e,i),t||(bi.has(e)||e.removeAttribute(r),bi.delete(e)),i||e.removeAttribute(n)}),Si--,Si||(yi=new WeakMap,yi=new WeakMap,bi=new WeakMap,xi={})}},Ei=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ti(r,i,n,`aria-hidden`)):function(){return null}},Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ki=`right-scroll-bar-position`,Ai=`width-before-scroll-bar`,ji=`with-scroll-bars-hidden`,Mi=`--removed-body-scroll-bar-size`;function Ni(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pi(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fi=typeof window<`u`?s.useLayoutEffect:s.useEffect,Ii=new WeakMap;function Li(e,t){var n=Pi(t||null,function(t){return e.forEach(function(e){return Ni(e,t)})});return Fi(function(){var t=Ii.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ni(e,null)}),i.forEach(function(e){r.has(e)||Ni(e,a)})}Ii.set(n,e)},[e]),n}function Ri(e){return e}function zi(e,t){t===void 0&&(t=Ri);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bi(e){e===void 0&&(e={});var t=zi(null);return t.options=Z({async:!0,ssr:!1},e),t}var Vi=function(e){var t=e.sideCar,n=Di(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,Z({},n))};Vi.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),Vi}var Ui=Bi(),Wi=function(){},Gi=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Di(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Li([n,t]),w=Z(Z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ui,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),Z(Z({},w),{ref:C})):s.createElement(y,Z({},w,{className:l,ref:C}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Ai,zeroRight:ki};var Ki=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ki();return t&&e.setAttribute(`nonce`,t),e}function Ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ji(t,n),Yi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zi=function(){var e=Xi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qi=function(){var e=Zi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$i={left:0,top:0,right:0,gap:0},ea=function(e){return parseInt(e||``,10)||0},ta=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ea(n),ea(r),ea(i)]},na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $i;var t=ta(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ra=Qi(),ia=`data-scroll-locked`,aa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${ji} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-CXUMngI_.js";import{C as t,T as n,v as r}from"./assert-
|
|
1
|
+
import{n as e}from"./jsx-runtime-CXUMngI_.js";import{C as t,T as n,v as r}from"./assert-DU6qrMA_.js";import{i,n as a,o,t as s}from"./query-keys-UETqfytp.js";import{t as c}from"./useMutation-EDFRkn1i.js";var l=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);function u(){return t({queryKey:s.settings.runtime,queryFn:e=>o(`/settings/runtime`,{signal:r(e)}),...i,staleTime:a.effectivelyImmutable})}function d(){let e=n();return c({mutationFn:e=>o(`/settings/runtime`,{method:`PATCH`,body:JSON.stringify(e)}),onSuccess:async()=>{await e.invalidateQueries({queryKey:s.settings.runtime})}})}export{d as n,l as r,u as t};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{m as t}from"./numbers-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{m as t}from"./numbers-BOevJzdz.js";var n={0:`gap-0`,1:`gap-0.5`,2:`gap-1`,3:`gap-1.5`,4:`gap-2`,5:`gap-2.5`,6:`gap-3`,7:`gap-3.5`,8:`gap-4`,9:`gap-4.5`,10:`gap-5`,12:`gap-6`,14:`gap-7`,16:`gap-8`,18:`gap-9`,20:`gap-10`,24:`gap-12`,32:`gap-16`};function r(e){if(typeof e==`number`)return n[e]??null;let t=e.trim(),r=t.endsWith(`px`)?Number.parseFloat(t):NaN;return Number.isFinite(r)?n[r]??null:null}function i(e,t){return e===void 0?n[t]??null:r(e)}var a=e(),o={center:`items-center`,start:`items-start`,end:`items-end`,"flex-start":`items-start`,"flex-end":`items-end`,baseline:`items-baseline`,stretch:`items-stretch`},s={center:`justify-center`,start:`justify-start`,end:`justify-end`,"flex-start":`justify-start`,"flex-end":`justify-end`,"space-between":`justify-between`,"space-around":`justify-around`,"space-evenly":`justify-evenly`};function c({children:e,direction:n=`column`,gap:r=6,gapRaw:c,align:l,justify:u,wrap:d=!1,style:f,className:p=``}){let m=i(r,6);return(0,a.jsx)(`div`,{className:t(`flex`,n===`row`?`flex-row`:`flex-col`,o[l??``]??``,s[u??``]??``,d&&`flex-wrap`,c===void 0?m:null,p),style:c===void 0?f:{gap:c,...f},children:e})}export{r as n,i as r,c as t};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./jsx-runtime-CXUMngI_.js";import{c as n,m as r,v as i,x as a}from"./numbers-
|
|
1
|
+
import{n as e,t}from"./jsx-runtime-CXUMngI_.js";import{c as n,m as r,v as i,x as a}from"./numbers-BOevJzdz.js";var o=e(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),s=t();function c(e){return r(`state-viewport flex-1 min-h-110 flex items-center justify-center w-full`,e===!0&&`state-viewport-compact min-h-0 py-2 px-0 [&_.state-box]:gap-3 [&_.state-box]:py-4 [&_.state-box-icon]:size-15`)}function l({title:e,message:t,icon:n,action:r,compact:i}){return(0,s.jsx)(`div`,{className:c(i),children:(0,s.jsxs)(`div`,{className:`state-box`,children:[(0,s.jsx)(`div`,{className:`state-box-icon`,"aria-hidden":`true`,children:n??(0,s.jsx)(o,{size:20})}),(0,s.jsx)(`h3`,{children:e}),(0,s.jsx)(`p`,{children:t}),r?(0,s.jsx)(`div`,{className:`mt-4`,children:r}):null]})})}function u({label:e=`Loading data…`,compact:t}){return(0,s.jsx)(`div`,{className:c(t),children:(0,s.jsxs)(`div`,{className:`state-box`,children:[(0,s.jsx)(`div`,{className:`state-box-icon`,"aria-hidden":`true`,children:(0,s.jsx)(a,{size:20,className:`animate-spin`})}),(0,s.jsx)(`p`,{className:`state-box-label`,role:`status`,"aria-live":`polite`,children:e})]})})}function d({title:e=`Unable to load data`,message:t,onRetry:r,retrying:a=!1,action:o,compact:l}){return(0,s.jsx)(`div`,{className:c(l),children:(0,s.jsxs)(`div`,{className:`state-box`,children:[(0,s.jsx)(`div`,{className:`state-box-icon state-box-icon-danger`,"aria-hidden":`true`,children:(0,s.jsx)(i,{size:20})}),(0,s.jsx)(`h3`,{className:`!text-red`,children:e}),(0,s.jsx)(`p`,{role:`alert`,children:t}),o?(0,s.jsx)(`div`,{className:`mt-4`,children:o}):null,r?(0,s.jsx)(n,{variant:`secondary`,size:`sm`,onClick:r,disabled:a,className:`mt-3`,children:a?`Retrying…`:`Retry`}):null]})})}function f({kind:e,title:t,description:n,action:i,className:a=``,padding:o=`md`,fill:c=!1}){let f=r(`flex items-center justify-center`,c&&`min-h-0 flex-1`,o===`sm`?`p-10`:`p-16`,a);return e===`loading`?(0,s.jsx)(`div`,{className:f,children:(0,s.jsx)(u,{label:n||t||`Loading…`})}):e===`error`?(0,s.jsx)(`div`,{className:f,children:(0,s.jsx)(d,{title:t||`Unable to load data`,message:n||`Check the console session and retry.`,action:i})}):(0,s.jsx)(`div`,{className:f,children:(0,s.jsx)(l,{title:t||`Nothing here yet`,message:n||`There is no data to show.`,action:i})})}export{f as i,d as n,u as r,l as t};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{m as t}from"./numbers-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{m as t}from"./numbers-BOevJzdz.js";var n=e();function r({checked:e,onChange:r,disabled:i=!1,id:a,label:o,"aria-label":s,className:c=``}){return(0,n.jsxs)(`div`,{className:t(`switch-container ${i?`is-disabled`:``}`.trim(),c),children:[(0,n.jsx)(`button`,{type:`button`,id:a,role:`switch`,"aria-checked":e,"aria-label":s??o,disabled:i,onClick:i?void 0:()=>r(!e),className:`switch-track ${e?`is-checked`:``}`,children:(0,n.jsx)(`span`,{className:`switch-thumb`})}),o?(0,n.jsx)(`span`,{className:`switch-label`,children:o}):null]})}export{r as t};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,r as t}from"./jsx-runtime-CXUMngI_.js";import{T as n}from"./assert-
|
|
1
|
+
import{o as e,r as t}from"./jsx-runtime-CXUMngI_.js";import{T as n}from"./assert-DU6qrMA_.js";import{C as r,M as i,N as a,O as o,b as s,v as c}from"./query-keys-UETqfytp.js";import{n as l}from"./mutation-g_fduiNw.js";var u=class extends s{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&r(t.mutationKey)!==r(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??l();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){c.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let r=n(t),[i]=d.useState(()=>new u(r,e));d.useEffect(()=>{i.setOptions(e)},[i,e]);let s=d.useSyncExternalStore(d.useCallback(e=>i.subscribe(c.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=d.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(o)},[i]);if(s.error&&a(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}export{f as t};
|
|
Binary file
|
|
Binary file
|