@kaitranntt/ccs 7.79.1 → 8.0.0-dev.2
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/README.md +29 -11
- package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
- package/dist/bin/ccsxp-runtime.js +8 -0
- package/dist/bin/ccsxp-runtime.js.map +1 -1
- package/dist/bin/codex-runtime-router.d.ts +24 -0
- package/dist/bin/codex-runtime-router.d.ts.map +1 -0
- package/dist/bin/codex-runtime-router.js +117 -0
- package/dist/bin/codex-runtime-router.js.map +1 -0
- package/dist/bin/codex-runtime.d.ts +1 -0
- package/dist/bin/codex-runtime.js +7 -2
- package/dist/bin/codex-runtime.js.map +1 -1
- package/dist/ccs.js +2 -1
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/ai-providers/codex-plan-compatibility.js +2 -2
- package/dist/cliproxy/ai-providers/codex-plan-compatibility.js.map +1 -1
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts +2 -2
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js +16 -8
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js.map +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts +8 -0
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.js +19 -2
- package/dist/cliproxy/ai-providers/model-id-normalizer.js.map +1 -1
- package/dist/cliproxy/ai-providers/service.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/service.js +39 -12
- package/dist/cliproxy/ai-providers/service.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts +13 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +111 -34
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/auth/oauth-trace/redactor.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-trace/redactor.js +9 -1
- package/dist/cliproxy/auth/oauth-trace/redactor.js.map +1 -1
- package/dist/cliproxy/config/generator.d.ts.map +1 -1
- package/dist/cliproxy/config/generator.js +5 -2
- package/dist/cliproxy/config/generator.js.map +1 -1
- package/dist/cliproxy/config/thinking-config.js +6 -6
- package/dist/cliproxy/config/thinking-config.js.map +1 -1
- package/dist/cliproxy/executor/env-resolver.js +1 -1
- package/dist/cliproxy/executor/env-resolver.js.map +1 -1
- package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
- package/dist/cliproxy/executor/session-bridge.js +11 -8
- package/dist/cliproxy/executor/session-bridge.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-claude.js +35 -4
- package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.js +4 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
- package/dist/cliproxy/quota/quota-manager.d.ts +1 -0
- package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-manager.js +53 -2
- package/dist/cliproxy/quota/quota-manager.js.map +1 -1
- package/dist/cliproxy/services/oauth-usage-log-transformer.d.ts.map +1 -1
- package/dist/cliproxy/services/oauth-usage-log-transformer.js +5 -0
- package/dist/cliproxy/services/oauth-usage-log-transformer.js.map +1 -1
- package/dist/codex-auth/codex-account-identity.d.ts +8 -0
- package/dist/codex-auth/codex-account-identity.d.ts.map +1 -0
- package/dist/codex-auth/codex-account-identity.js +53 -0
- package/dist/codex-auth/codex-account-identity.js.map +1 -0
- package/dist/codex-auth/codex-auth-dashboard-service.d.ts +46 -0
- package/dist/codex-auth/codex-auth-dashboard-service.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-dashboard-service.js +228 -0
- package/dist/codex-auth/codex-auth-dashboard-service.js.map +1 -0
- package/dist/codex-auth/codex-auth-help.d.ts +7 -0
- package/dist/codex-auth/codex-auth-help.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-help.js +87 -0
- package/dist/codex-auth/codex-auth-help.js.map +1 -0
- package/dist/codex-auth/codex-auth-router.d.ts +16 -0
- package/dist/codex-auth/codex-auth-router.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-router.js +77 -0
- package/dist/codex-auth/codex-auth-router.js.map +1 -0
- package/dist/codex-auth/codex-config-symlink.d.ts +14 -0
- package/dist/codex-auth/codex-config-symlink.d.ts.map +1 -0
- package/dist/codex-auth/codex-config-symlink.js +128 -0
- package/dist/codex-auth/codex-config-symlink.js.map +1 -0
- package/dist/codex-auth/codex-profile-paths.d.ts +5 -0
- package/dist/codex-auth/codex-profile-paths.d.ts.map +1 -0
- package/dist/codex-auth/codex-profile-paths.js +58 -0
- package/dist/codex-auth/codex-profile-paths.js.map +1 -0
- package/dist/codex-auth/codex-profile-registry.d.ts +34 -0
- package/dist/codex-auth/codex-profile-registry.d.ts.map +1 -0
- package/dist/codex-auth/codex-profile-registry.js +360 -0
- package/dist/codex-auth/codex-profile-registry.js.map +1 -0
- package/dist/codex-auth/codex-profile-resources.d.ts +6 -0
- package/dist/codex-auth/codex-profile-resources.d.ts.map +1 -0
- package/dist/codex-auth/codex-profile-resources.js +119 -0
- package/dist/codex-auth/codex-profile-resources.js.map +1 -0
- package/dist/codex-auth/commands/create-command.d.ts +9 -0
- package/dist/codex-auth/commands/create-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/create-command.js +203 -0
- package/dist/codex-auth/commands/create-command.js.map +1 -0
- package/dist/codex-auth/commands/import-default-command.d.ts +18 -0
- package/dist/codex-auth/commands/import-default-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/import-default-command.js +385 -0
- package/dist/codex-auth/commands/import-default-command.js.map +1 -0
- package/dist/codex-auth/commands/index.d.ts +13 -0
- package/dist/codex-auth/commands/index.d.ts.map +1 -0
- package/dist/codex-auth/commands/index.js +27 -0
- package/dist/codex-auth/commands/index.js.map +1 -0
- package/dist/codex-auth/commands/login-command.d.ts +9 -0
- package/dist/codex-auth/commands/login-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/login-command.js +152 -0
- package/dist/codex-auth/commands/login-command.js.map +1 -0
- package/dist/codex-auth/commands/remove-command.d.ts +10 -0
- package/dist/codex-auth/commands/remove-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/remove-command.js +230 -0
- package/dist/codex-auth/commands/remove-command.js.map +1 -0
- package/dist/codex-auth/commands/show-command.d.ts +10 -0
- package/dist/codex-auth/commands/show-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/show-command.js +127 -0
- package/dist/codex-auth/commands/show-command.js.map +1 -0
- package/dist/codex-auth/commands/show-detail-view.d.ts +7 -0
- package/dist/codex-auth/commands/show-detail-view.d.ts.map +1 -0
- package/dist/codex-auth/commands/show-detail-view.js +134 -0
- package/dist/codex-auth/commands/show-detail-view.js.map +1 -0
- package/dist/codex-auth/commands/switch-command.d.ts +7 -0
- package/dist/codex-auth/commands/switch-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/switch-command.js +48 -0
- package/dist/codex-auth/commands/switch-command.js.map +1 -0
- package/dist/codex-auth/commands/types.d.ts +45 -0
- package/dist/codex-auth/commands/types.d.ts.map +1 -0
- package/dist/codex-auth/commands/types.js +85 -0
- package/dist/codex-auth/commands/types.js.map +1 -0
- package/dist/codex-auth/commands/use-command.d.ts +16 -0
- package/dist/codex-auth/commands/use-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/use-command.js +86 -0
- package/dist/codex-auth/commands/use-command.js.map +1 -0
- package/dist/codex-auth/decode-id-token.d.ts +12 -0
- package/dist/codex-auth/decode-id-token.d.ts.map +1 -0
- package/dist/codex-auth/decode-id-token.js +83 -0
- package/dist/codex-auth/decode-id-token.js.map +1 -0
- package/dist/codex-auth/index.d.ts +9 -0
- package/dist/codex-auth/index.d.ts.map +1 -0
- package/dist/codex-auth/index.js +22 -0
- package/dist/codex-auth/index.js.map +1 -0
- package/dist/codex-auth/resolve-active-profile.d.ts +13 -0
- package/dist/codex-auth/resolve-active-profile.d.ts.map +1 -0
- package/dist/codex-auth/resolve-active-profile.js +161 -0
- package/dist/codex-auth/resolve-active-profile.js.map +1 -0
- package/dist/codex-auth/shell-detect.d.ts +19 -0
- package/dist/codex-auth/shell-detect.d.ts.map +1 -0
- package/dist/codex-auth/shell-detect.js +91 -0
- package/dist/codex-auth/shell-detect.js.map +1 -0
- package/dist/codex-auth/types.d.ts +26 -0
- package/dist/codex-auth/types.d.ts.map +1 -0
- package/dist/codex-auth/types.js +34 -0
- package/dist/codex-auth/types.js.map +1 -0
- package/dist/commands/cliproxy/variant-subcommand.js +1 -1
- package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
- package/dist/commands/command-catalog.d.ts +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +10 -1
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/completion-backend.d.ts.map +1 -1
- package/dist/commands/completion-backend.js +2 -0
- package/dist/commands/completion-backend.js.map +1 -1
- package/dist/commands/config-command.d.ts +2 -0
- package/dist/commands/config-command.d.ts.map +1 -1
- package/dist/commands/config-command.js +31 -20
- package/dist/commands/config-command.js.map +1 -1
- package/dist/commands/docker/finalize-key-rotation-subcommand.d.ts +2 -0
- package/dist/commands/docker/finalize-key-rotation-subcommand.d.ts.map +1 -0
- package/dist/commands/docker/finalize-key-rotation-subcommand.js +79 -0
- package/dist/commands/docker/finalize-key-rotation-subcommand.js.map +1 -0
- package/dist/commands/docker/help-subcommand.d.ts.map +1 -1
- package/dist/commands/docker/help-subcommand.js +6 -0
- package/dist/commands/docker/help-subcommand.js.map +1 -1
- package/dist/commands/docker/index.d.ts.map +1 -1
- package/dist/commands/docker/index.js +4 -0
- package/dist/commands/docker/index.js.map +1 -1
- package/dist/commands/docker/show-key-subcommand.d.ts +2 -0
- package/dist/commands/docker/show-key-subcommand.d.ts.map +1 -0
- package/dist/commands/docker/show-key-subcommand.js +96 -0
- package/dist/commands/docker/show-key-subcommand.js.map +1 -0
- package/dist/commands/docker/up-subcommand.d.ts.map +1 -1
- package/dist/commands/docker/up-subcommand.js +4 -0
- package/dist/commands/docker/up-subcommand.js.map +1 -1
- package/dist/commands/persist-command.d.ts.map +1 -1
- package/dist/commands/persist-command.js +77 -5
- package/dist/commands/persist-command.js.map +1 -1
- package/dist/dispatcher/cli-argument-parser.d.ts +3 -2
- package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
- package/dist/dispatcher/cli-argument-parser.js +37 -7
- package/dist/dispatcher/cli-argument-parser.js.map +1 -1
- package/dist/dispatcher/pre-dispatch.d.ts.map +1 -1
- package/dist/dispatcher/pre-dispatch.js +7 -0
- package/dist/dispatcher/pre-dispatch.js.map +1 -1
- package/dist/dispatcher/target-executor.d.ts +2 -2
- package/dist/dispatcher/target-executor.d.ts.map +1 -1
- package/dist/dispatcher/target-executor.js +5 -5
- package/dist/dispatcher/target-executor.js.map +1 -1
- package/dist/docker/docker-bootstrap.d.ts +1 -1
- package/dist/docker/docker-bootstrap.d.ts.map +1 -1
- package/dist/docker/docker-bootstrap.js +99 -3
- package/dist/docker/docker-bootstrap.js.map +1 -1
- package/dist/docker/docker-executor.d.ts +3 -0
- package/dist/docker/docker-executor.d.ts.map +1 -1
- package/dist/docker/docker-executor.js +53 -0
- package/dist/docker/docker-executor.js.map +1 -1
- package/dist/docker/docker-key-rotation.d.ts +48 -0
- package/dist/docker/docker-key-rotation.d.ts.map +1 -0
- package/dist/docker/docker-key-rotation.js +179 -0
- package/dist/docker/docker-key-rotation.js.map +1 -0
- package/dist/management/checks/config-check.d.ts.map +1 -1
- package/dist/management/checks/config-check.js +10 -1
- package/dist/management/checks/config-check.js.map +1 -1
- package/dist/management/doctor.d.ts +1 -0
- package/dist/management/doctor.d.ts.map +1 -1
- package/dist/management/doctor.js +23 -0
- package/dist/management/doctor.js.map +1 -1
- package/dist/proxy/proxy-daemon.d.ts.map +1 -1
- package/dist/proxy/proxy-daemon.js +15 -3
- package/dist/proxy/proxy-daemon.js.map +1 -1
- package/dist/proxy/server/messages-route.d.ts.map +1 -1
- package/dist/proxy/server/messages-route.js +27 -1
- package/dist/proxy/server/messages-route.js.map +1 -1
- package/dist/shared/claude-extension-setup.d.ts.map +1 -1
- package/dist/shared/claude-extension-setup.js +21 -1
- package/dist/shared/claude-extension-setup.js.map +1 -1
- package/dist/shared/stale-codex-translator-settings.d.ts +4 -0
- package/dist/shared/stale-codex-translator-settings.d.ts.map +1 -0
- package/dist/shared/stale-codex-translator-settings.js +35 -0
- package/dist/shared/stale-codex-translator-settings.js.map +1 -0
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +64 -5
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -1
- package/dist/targets/codex-cliproxy-provider-config.js +56 -24
- package/dist/targets/codex-cliproxy-provider-config.js.map +1 -1
- package/dist/ui/assets/Trans-DyZQZ3e2.js +1 -0
- package/dist/ui/assets/accounts-BPJltru3.js +1 -0
- package/dist/ui/assets/{alert-dialog-DC1l1GRX.js → alert-dialog-DWHL-dqd.js} +1 -1
- package/dist/ui/assets/api-BxPN-zy4.js +4 -0
- package/dist/ui/assets/auth-section-B4o90dwz.js +1 -0
- package/dist/ui/assets/backups-section-1AsdSIJO.js +1 -0
- package/dist/ui/assets/channels-CU4Zdsc_.js +1 -0
- package/dist/ui/assets/{charts-CeK2xCSo.js → charts-eIPy2oG6.js} +34 -34
- package/dist/ui/assets/{checkbox-Dgd2ucy2.js → checkbox-CbCKGH8I.js} +1 -1
- package/dist/ui/assets/claude-extension-CWpjmIGt.js +1 -0
- package/dist/ui/assets/cliproxy-K6eBb5VO.js +4 -0
- package/dist/ui/assets/{cliproxy-ai-providers-DxoCNEaQ.js → cliproxy-ai-providers-Dr4L5NRY.js} +6 -6
- package/dist/ui/assets/cliproxy-control-panel-Cz5r7kHP.js +1 -0
- package/dist/ui/assets/code-highlight-ClSMkeL5.js +1 -0
- package/dist/ui/assets/codex-0HdbW8NR.js +30 -0
- package/dist/ui/assets/{confirm-dialog-nDFNrH0F.js → confirm-dialog-b5Dahgnk.js} +1 -1
- package/dist/ui/assets/copilot-B1Ojakbt.js +3 -0
- package/dist/ui/assets/cursor-PUtNVPx1.js +1 -0
- package/dist/ui/assets/droid-S2gclncb.js +2 -0
- package/dist/ui/assets/globalenv-section-7wKSmNSG.js +1 -0
- package/dist/ui/assets/health-hMLN_gyw.js +1 -0
- package/dist/ui/assets/index-BMoGhs28.css +1 -0
- package/dist/ui/assets/index-BWboJia4.js +1 -0
- package/dist/ui/assets/index-COt1pbk-.js +1 -0
- package/dist/ui/assets/index-CcGVqYOy.js +56 -0
- package/dist/ui/assets/index-Coc3_ABK.js +1 -0
- package/dist/ui/assets/index-Cx0dmbiQ.js +1 -0
- package/dist/ui/assets/index-CxvNNHgE.js +1 -0
- package/dist/ui/assets/index-DkR2KVhF.js +1 -0
- package/dist/ui/assets/logs-BRFVfyLc.js +1 -0
- package/dist/ui/assets/{masked-input-5TJ4LSuz.js → masked-input-4L9CIZGb.js} +1 -1
- package/dist/ui/assets/proxy-status-widget-s1UWOE23.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-Fg4WMiuD.js → raw-json-settings-editor-panel-DXh8c8rA.js} +1 -1
- package/dist/ui/assets/{searchable-select-CPJn5vA1.js → searchable-select-CtvEQrMo.js} +1 -1
- package/dist/ui/assets/{separator-BrQkfpAp.js → separator-E0ISp1SN.js} +1 -1
- package/dist/ui/assets/shared-BeYwHeNS.js +8 -0
- package/dist/ui/assets/{table-DRzNRkpJ.js → table-BBslZvNP.js} +1 -1
- package/dist/ui/assets/updates-CDrm903n.js +1 -0
- package/dist/ui/assets/{use-accounts-B6AXtlfF.js → use-accounts-BdalFsdY.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/claude-subcommand-detector.d.ts +12 -3
- package/dist/utils/claude-subcommand-detector.d.ts.map +1 -1
- package/dist/utils/claude-subcommand-detector.js +59 -12
- package/dist/utils/claude-subcommand-detector.js.map +1 -1
- package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
- package/dist/web-server/middleware/auth-middleware.js +25 -1
- package/dist/web-server/middleware/auth-middleware.js.map +1 -1
- package/dist/web-server/models-dev/pricing-resolver.d.ts.map +1 -1
- package/dist/web-server/models-dev/pricing-resolver.js +7 -0
- package/dist/web-server/models-dev/pricing-resolver.js.map +1 -1
- package/dist/web-server/models-dev/registry-cache.d.ts.map +1 -1
- package/dist/web-server/models-dev/registry-cache.js +14 -4
- package/dist/web-server/models-dev/registry-cache.js.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.js +5 -0
- package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts +8 -0
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +13 -26
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
- package/dist/web-server/routes/codex-routes.js +14 -0
- package/dist/web-server/routes/codex-routes.js.map +1 -1
- package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
- package/dist/web-server/routes/proxy-routes.js +1 -1
- package/dist/web-server/routes/proxy-routes.js.map +1 -1
- package/dist/web-server/services/cliproxy-dashboard-restart-service.d.ts +21 -0
- package/dist/web-server/services/cliproxy-dashboard-restart-service.d.ts.map +1 -0
- package/dist/web-server/services/cliproxy-dashboard-restart-service.js +49 -0
- package/dist/web-server/services/cliproxy-dashboard-restart-service.js.map +1 -0
- package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
- package/dist/web-server/services/codex-dashboard-service.js +30 -3
- package/dist/web-server/services/codex-dashboard-service.js.map +1 -1
- package/dist/web-server/usage/aggregator.d.ts +13 -7
- package/dist/web-server/usage/aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/aggregator.js +37 -22
- package/dist/web-server/usage/aggregator.js.map +1 -1
- package/dist/web-server/usage/handlers.d.ts +1 -0
- package/dist/web-server/usage/handlers.d.ts.map +1 -1
- package/dist/web-server/usage/handlers.js +16 -8
- package/dist/web-server/usage/handlers.js.map +1 -1
- package/dist/web-server/usage/profile-filter.d.ts +13 -0
- package/dist/web-server/usage/profile-filter.d.ts.map +1 -0
- package/dist/web-server/usage/profile-filter.js +30 -0
- package/dist/web-server/usage/profile-filter.js.map +1 -0
- package/dist/web-server/usage/sqlite-cli.d.ts.map +1 -1
- package/dist/web-server/usage/sqlite-cli.js +22 -1
- package/dist/web-server/usage/sqlite-cli.js.map +1 -1
- package/dist/web-server/usage/types.d.ts +8 -0
- package/dist/web-server/usage/types.d.ts.map +1 -1
- package/lib/hooks/websearch-transformer.cjs +12 -3
- package/lib/mcp/ccs-browser-server.cjs +217 -12
- package/package.json +1 -1
- package/scripts/docker-dashboard-sunset-guard.js +171 -0
- package/scripts/run-test-bucket.js +1 -0
- package/scripts/verify-bundle.js +4 -1
- package/dist/ui/assets/accounts-BQu3Aeey.js +0 -1
- package/dist/ui/assets/api-BTbrbjic.js +0 -4
- package/dist/ui/assets/auth-section-BsSVWOMp.js +0 -1
- package/dist/ui/assets/backups-section-BGHYHASS.js +0 -1
- package/dist/ui/assets/channels-vJ8L4j-z.js +0 -1
- package/dist/ui/assets/claude-extension-B3ern4Ad.js +0 -1
- package/dist/ui/assets/cliproxy-CGljI0Or.js +0 -4
- package/dist/ui/assets/cliproxy-control-panel-BJ3Mliy1.js +0 -1
- package/dist/ui/assets/code-highlight-D4E79GKQ.js +0 -3
- package/dist/ui/assets/codex-DBGHPn0v.js +0 -30
- package/dist/ui/assets/copilot-CE_Z3NB0.js +0 -3
- package/dist/ui/assets/cursor-YzGsSR_d.js +0 -1
- package/dist/ui/assets/droid-C-ItViCi.js +0 -2
- package/dist/ui/assets/globalenv-section-C9gSGyZ8.js +0 -1
- package/dist/ui/assets/health-DEeA97sQ.js +0 -1
- package/dist/ui/assets/index-B71yJlMj.css +0 -1
- package/dist/ui/assets/index-BPVO-QAw.js +0 -1
- package/dist/ui/assets/index-BRZp_Csi.js +0 -72
- package/dist/ui/assets/index-BYUwpOeA.js +0 -1
- package/dist/ui/assets/index-D2r_fAW5.js +0 -1
- package/dist/ui/assets/index-DGiziSVQ.js +0 -1
- package/dist/ui/assets/index-DwG6bbUr.js +0 -1
- package/dist/ui/assets/index-Dwtj4wGT.js +0 -1
- package/dist/ui/assets/logs-Mt2W7M3G.js +0 -1
- package/dist/ui/assets/proxy-status-widget-BQOAlYsb.js +0 -1
- package/dist/ui/assets/shared-BlkDl2HF.js +0 -8
- package/dist/ui/assets/updates-BQNeSzLj.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./radix-ui-nu4wz29m.js";import{r as O,E as F,f as es}from"./react-vendor-Bjx91N7w.js";import{L as Te,aI as Nn,r as It,s as Tt,t as Ct,v as Nt,w as qe,I as nt,d as ye,c as K,Q as sr,R as or,U as it,V as at,n as Dt,a as lr,Y as kt,M as ts,N as ns,O as rs,ah as ss,ai as os,aj as ls,ak as is,al as as,bm as cs,bn as Pt,bo as kn,bp as us,bq as Rn,br as En,bs as zn,bt as Hn,bu as Ln,S as ze}from"./index-BRZp_Csi.js";import{au as ds,Q as ir,E as ar,aZ as ms,a_ as hs,a$ as fs,o as Jt,aL as cr,g as gs,s as ur,C as xs,T as ps,av as vs,X as bs,d as ws,R as js,y as Ss,e as ys,J as Is,D as Ts,b0 as Cs}from"./icons-DzKUh8vG.js";import{u as At,a as Ns,b as ks,k as Rs}from"./tanstack-bhJxV1h8.js";import{t as On}from"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";function Bn(e,t){const n=Number.parseInt(e,10);return Number.isNaN(n)?t:Math.max(0,n)}function Es({config:e,onSave:t,isPending:n}){const[s,o]=O.useState(e);O.useEffect(()=>{o(e)},[e]);const l=O.useMemo(()=>JSON.stringify(s)!==JSON.stringify(e),[e,s]);return r.jsxs("form",{className:"space-y-5",onSubmit:i=>{i.preventDefault(),t(s)},children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4 rounded border border-border bg-background px-3 py-2",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Te,{htmlFor:"logs-enabled",className:"text-sm font-medium",children:"Enabled"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Capture structured log entries."})]}),r.jsx(Nn,{id:"logs-enabled",checked:s.enabled,onCheckedChange:i=>o(a=>({...a,enabled:i}))})]}),r.jsxs("div",{className:"flex items-center justify-between gap-4 rounded border border-border bg-background px-3 py-2",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Te,{htmlFor:"logs-redact",className:"text-sm font-medium",children:"Redact sensitive values"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide payload values until explicitly revealed."})]}),r.jsx(Nn,{id:"logs-redact",checked:s.redact,onCheckedChange:i=>o(a=>({...a,redact:i}))})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-config-level",className:"text-sm font-medium",children:"Minimum level"}),r.jsxs(It,{value:s.level,onValueChange:i=>o(a=>({...a,level:i})),children:[r.jsx(Tt,{id:"logs-config-level",className:"h-9",children:r.jsx(Ct,{})}),r.jsxs(Nt,{children:[r.jsx(qe,{value:"error",children:"Error only"}),r.jsx(qe,{value:"warn",children:"Warn and above"}),r.jsx(qe,{value:"info",children:"Info and above"}),r.jsx(qe,{value:"debug",children:"Full debug"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-rotate-mb",className:"text-sm font-medium",children:"Rotation (MB)"}),r.jsx(nt,{id:"logs-rotate-mb",type:"number",min:1,value:s.rotate_mb,onChange:i=>o(a=>({...a,rotate_mb:Bn(i.target.value,a.rotate_mb)})),className:"h-9"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-retain-days",className:"text-sm font-medium",children:"Retention (days)"}),r.jsx(nt,{id:"logs-retain-days",type:"number",min:1,value:s.retain_days,onChange:i=>o(a=>({...a,retain_days:Bn(i.target.value,a.retain_days)})),className:"h-9"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[r.jsxs(ye,{type:"submit",disabled:!l||n,size:"sm",className:"gap-1.5",children:[r.jsx(ds,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Save changes"]}),r.jsxs(ye,{type:"button",variant:"ghost",size:"sm",disabled:!l||n,onClick:()=>o(e),className:"gap-1.5",children:[r.jsx(ir,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Reset"]})]})]})}function zs(e){if(e==null)return"{}";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Hs(e){switch(e){case"error":return"Error";case"warn":return"Warn";case"info":return"Info";case"debug":return"Debug"}}function dr(e,t){return e.module??t??e.source??"—"}function Ls(e){return e.stage??"—"}function mr(e,t={}){return e.requestId?t.short?e.requestId.slice(-8):e.requestId:"—"}function hr(e){return e.latencyMs===void 0||e.latencyMs===null?"—":`${e.latencyMs}ms`}const Os={error:{bg:"bg-red-500/10",fg:"text-red-700 dark:text-red-300",border:"border-red-500/30",dot:"bg-red-500"},warn:{bg:"bg-amber-500/10",fg:"text-amber-800 dark:text-amber-200",border:"border-amber-500/30",dot:"bg-amber-500"},info:{bg:"bg-sky-500/10",fg:"text-sky-800 dark:text-sky-200",border:"border-sky-500/30",dot:"bg-sky-500"},debug:{bg:"bg-zinc-500/10",fg:"text-zinc-700 dark:text-zinc-300",border:"border-zinc-500/30",dot:"bg-zinc-500"}},fr={compact:"h-8 text-[12px]",cozy:"h-10 text-[13px]"},Ae="font-mono tabular-nums",gr="transition-colors hover:bg-muted/40 data-[selected=true]:bg-muted/60",ve="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";function ln({level:e,className:t}){const n=Os[e];return r.jsxs("span",{className:K("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium",n.border,n.bg,n.fg,t),children:[r.jsx("span",{className:K("h-1.5 w-1.5 rounded-full",n.dot),"aria-hidden":"true"}),Hs(e)]})}const Bs={selection:{title:"No entry selected",body:"Pick a row in the list to inspect its context. Use j/k to move and Enter to focus the detail.",icon:fs},noData:{title:"No log activity yet",body:"Once requests flow through the system, structured entries will appear here.",icon:hs},noResults:{title:"No entries match your filters",body:"Adjust source, level, search, or time window to see more entries.",icon:ms},selectionOutOfScope:{title:"Selected entry not visible under current filter",body:"Clear your filter or select another row to inspect details.",icon:ar}};function an({variant:e,onClearFilters:t}){const{title:n,body:s,icon:o}=Bs[e],l=e==="selectionOutOfScope"||e==="noResults";return r.jsxs("div",{role:"status",className:"flex h-full flex-col items-center justify-center gap-3 px-6 py-10 text-center",children:[r.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-muted/30 text-muted-foreground",children:r.jsx(o,{className:"h-5 w-5","aria-hidden":"true"})}),r.jsx("h3",{className:"text-sm font-semibold text-foreground",children:n}),r.jsx("p",{className:"max-w-xs text-[13px] leading-relaxed text-muted-foreground",children:s}),l&&t?r.jsx(ye,{variant:"outline",size:"sm",onClick:t,className:"mt-1",children:"Clear filters"}):null]})}function Fs(e,t){return[{label:"Time",value:new Date(e.timestamp).toISOString(),mono:!0},{label:"Level",value:e.level},{label:"Module",value:dr(e,t)},{label:"Stage",value:Ls(e)},{label:"Request ID",value:mr(e),mono:!0},{label:"Latency",value:hr(e),mono:!0},{label:"Source",value:t??e.source??"—"},{label:"Run ID",value:e.runId??"—",mono:!0},{label:"Process ID",value:e.processId??"—",mono:!0}]}function Zt({value:e,redact:t,depth:n=0}){const[s,o]=O.useState(!1);if(n>8)return r.jsx("span",{className:"text-muted-foreground",children:"…"});if(e==null)return r.jsx("span",{className:"text-muted-foreground",children:"null"});if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return t&&typeof e=="string"&&e.length>0&&!s?r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-muted-foreground",children:"redacted"}),r.jsx("button",{type:"button",onClick:()=>o(!0),"aria-label":"Reveal value",className:K("rounded p-0.5 text-muted-foreground hover:text-foreground",ve),children:r.jsx(gs,{className:"h-3 w-3","aria-hidden":"true"})})]}):r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx("span",{className:K("text-foreground/90",typeof e!="string"&&Ae),children:String(e)}),t&&typeof e=="string"&&s?r.jsx("button",{type:"button",onClick:()=>o(!1),"aria-label":"Hide value",className:K("rounded p-0.5 text-muted-foreground hover:text-foreground",ve),children:r.jsx(ar,{className:"h-3 w-3","aria-hidden":"true"})}):null]});if(Array.isArray(e))return r.jsxs("ul",{className:"border-l border-border/60 pl-3",children:[e.slice(0,50).map((a,c)=>r.jsxs("li",{className:"text-[12px]",children:[r.jsxs("span",{className:"text-muted-foreground",children:["[",c,"]"]})," ",r.jsx(Zt,{value:a,redact:t,depth:n+1})]},c)),e.length>50?r.jsxs("li",{className:"text-[12px] text-muted-foreground",children:["… +",e.length-50," more"]}):null]});const l=e,i=Object.keys(l);return r.jsx("ul",{className:"border-l border-border/60 pl-3",children:i.map(a=>r.jsxs("li",{className:"text-[12px]",children:[r.jsx("span",{className:"font-medium text-foreground/80",children:a}),":"," ",r.jsx(Zt,{value:l[a],redact:t,depth:n+1})]},a))})}async function Fn(e){try{await navigator.clipboard.writeText(e)}catch{}}function Ms({entry:e,sourceLabel:t,onShowTrace:n,redact:s=!1}){const o=O.useMemo(()=>e?Fs(e,t):[],[e,t]);if(!e)return r.jsx(an,{variant:"selection"});const l=zs(e);return r.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background",children:[r.jsxs("header",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ln,{level:e.level}),r.jsx("span",{className:"truncate text-[12px] text-muted-foreground",children:e.event})]}),r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:e.message}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[r.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>void Fn(l),className:K("h-7 gap-1.5 px-2 text-xs",ve),children:[r.jsx(Jt,{className:"h-3 w-3","aria-hidden":"true"}),"Copy JSON"]}),e.requestId?r.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>e.requestId&&void Fn(e.requestId),className:K("h-7 gap-1.5 px-2 text-xs",ve),children:[r.jsx(Jt,{className:"h-3 w-3","aria-hidden":"true"}),"Copy requestId"]}):null,e.requestId&&n?r.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>e.requestId&&n(e.requestId),className:K("h-7 gap-1.5 px-2 text-xs",ve),children:[r.jsx(cr,{className:"h-3 w-3","aria-hidden":"true"}),"Show trace"]}):null]})]}),r.jsxs(sr,{defaultValue:"overview",className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs(or,{className:"m-2 h-8 w-fit bg-muted/40",children:[r.jsx(it,{value:"overview",className:"text-xs",children:"Overview"}),r.jsx(it,{value:"context",className:"text-xs",children:"Context"}),r.jsx(it,{value:"raw",className:"text-xs",children:"Raw"})]}),r.jsx(at,{value:"overview",className:"m-0 min-h-0 flex-1",children:r.jsx(Dt,{className:"h-full",children:r.jsxs("dl",{className:"grid grid-cols-[120px_minmax(0,1fr)] gap-x-3 gap-y-2 px-4 pb-4",children:[o.map(i=>r.jsx(Ds,{...i},i.label)),e.error?r.jsxs("div",{className:"col-span-2 mt-2 rounded border border-red-500/30 bg-red-500/5 p-3",children:[r.jsxs("p",{className:"text-xs font-semibold text-red-700 dark:text-red-400",children:[e.error.code??"Error",": ",e.error.message]}),e.error.stack?r.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap font-mono text-[11px] text-red-700/80 dark:text-red-300/80",children:e.error.stack}):null]}):null]})})}),r.jsx(at,{value:"context",className:"m-0 min-h-0 flex-1",children:r.jsx(Dt,{className:"h-full",children:r.jsx("div",{className:"px-4 pb-4 text-[12px] leading-relaxed",children:e.metadata&&Object.keys(e.metadata).length>0?r.jsx(Zt,{value:e.metadata,redact:s}):r.jsx("p",{className:"text-muted-foreground",children:"No structured metadata."})})})}),r.jsx(at,{value:"raw",className:"m-0 min-h-0 flex-1",children:r.jsx(Dt,{className:"h-full",children:r.jsx("pre",{className:K("m-0 px-4 pb-4 text-[12px] leading-relaxed text-foreground/90",Ae),children:l})})})]})]})}function Ds({label:e,value:t,mono:n}){return r.jsxs(r.Fragment,{children:[r.jsx("dt",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:e}),r.jsx("dd",{className:K("truncate text-[13px] text-foreground/90",n&&Ae),title:t==null?void 0:String(t),children:t??"—"})]})}const Lt=0,Qe=1,ot=2,xr=4;function Mn(e){return()=>e}function Ps(e){e()}function pr(e,t){return n=>e(t(n))}function Dn(e,t){return()=>e(t)}function As(e,t){return n=>e(t,n)}function cn(e){return e!==void 0}function Ws(...e){return()=>{e.map(Ps)}}function lt(){}function Ot(e,t){return t(e),e}function _s(e,t){return t(e)}function se(...e){return e}function J(e,t){return e(Qe,t)}function q(e,t){e(Lt,t)}function un(e){e(ot)}function le(e){return e(xr)}function M(e,t){return J(e,As(t,Lt))}function Oe(e,t){const n=e(Qe,s=>{n(),t(s)});return n}function Pn(e){let t,n;return s=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{s(t)},e)}}function vr(e,t){return e===t}function re(e=vr){let t;return n=>s=>{e(t,s)||(t=s,n(s))}}function A(e){return t=>n=>{e(n)&&t(n)}}function L(e){return t=>pr(t,e)}function De(e){return t=>()=>{t(e)}}function w(e,...t){const n=Vs(...t);return(s,o)=>{switch(s){case ot:un(e);return;case Qe:return J(e,n(o))}}}function Pe(e,t){return n=>s=>{n(t=e(t,s))}}function Ze(e){return t=>n=>{e>0?e--:t(n)}}function _e(e){let t=null,n;return s=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,s(t)},e))}}function G(...e){const t=new Array(e.length);let n=0,s=null;const o=Math.pow(2,e.length)-1;return e.forEach((l,i)=>{const a=Math.pow(2,i);J(l,c=>{const u=n;n=n|a,t[i]=c,u!==o&&n===o&&s&&(s(),s=null)})}),l=>i=>{const a=()=>{l([i].concat(t))};n===o?a():s=a}}function Vs(...e){return t=>e.reduceRight(_s,t)}function qs(e){let t,n;const s=()=>t?.();return function(o,l){switch(o){case Qe:return l?n===l?void 0:(s(),n=l,t=J(e,l),t):(s(),lt);case ot:s(),n=null;return}}}function I(e){let t=e;const n=U();return(s,o)=>{switch(s){case Lt:t=o;break;case Qe:{o(t);break}case xr:return t}return n(s,o)}}function we(e,t){return Ot(I(t),n=>M(e,n))}function U(){const e=[];return(t,n)=>{switch(t){case Lt:e.slice().forEach(s=>{s(n)});return;case ot:e.splice(0,e.length);return;case Qe:return e.push(n),()=>{const s=e.indexOf(n);s>-1&&e.splice(s,1)}}}}function ke(e){return Ot(U(),t=>M(e,t))}function $(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:Gs(),singleton:n}}const Gs=()=>Symbol();function Qs(e){const t=new Map,n=({constructor:s,dependencies:o,id:l,singleton:i})=>{if(i&&t.has(l))return t.get(l);const a=s(o.map(c=>n(c)));return i&&t.set(l,a),a};return n(e)}function de(...e){const t=U(),n=new Array(e.length);let s=0;const o=Math.pow(2,e.length)-1;return e.forEach((l,i)=>{const a=Math.pow(2,i);J(l,c=>{n[i]=c,s=s|a,s===o&&q(t,n)})}),function(l,i){switch(l){case ot:{un(t);return}case Qe:return s===o&&i(n),J(t,i)}}}function P(e,t=vr){return w(e,re(t))}function Xt(...e){return function(t,n){switch(t){case ot:return;case Qe:return Ws(...e.map(s=>J(s,n)))}}}var Ce=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Ce||{});const Us={0:"debug",3:"error",1:"log",2:"warn"},Ks=()=>typeof globalThis>"u"?window:globalThis,Ue=$(()=>{const e=I(3);return{log:I((t,n,s=1)=>{var o;const l=(o=Ks().VIRTUOSO_LOG_LEVEL)!=null?o:le(e);s>=l&&console[Us[s]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function Xe(e,t,n){return dn(e,t,n).callbackRef}function dn(e,t,n){const s=F.useRef(null);let o=i=>{};const l=F.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const a=()=>{const c=i[0].target;c.offsetParent!==null&&e(c)};n?a():requestAnimationFrame(a)}):null,[e,n]);return o=i=>{i&&t?(l?.observe(i),s.current=i):(s.current&&l?.unobserve(s.current),s.current=null)},{callbackRef:o,ref:s}}function $s(e,t,n,s,o,l,i,a,c){const u=F.useCallback(f=>{const p=Ys(f.children,t,a?"offsetWidth":"offsetHeight",o);let x=f.parentElement;for(;!x.dataset.virtuosoScroller;)x=x.parentElement;const v=x.lastElementChild.dataset.viewportType==="window";let T;v&&(T=x.ownerDocument.defaultView);const k=i?a?i.scrollLeft:i.scrollTop:v?a?T.scrollX||T.document.documentElement.scrollLeft:T.scrollY||T.document.documentElement.scrollTop:a?x.scrollLeft:x.scrollTop,g=i?a?i.scrollWidth:i.scrollHeight:v?a?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight:a?x.scrollWidth:x.scrollHeight,m=i?a?i.offsetWidth:i.offsetHeight:v?a?T.innerWidth:T.innerHeight:a?x.offsetWidth:x.offsetHeight;s({scrollHeight:g,scrollTop:Math.max(k,0),viewportHeight:m}),l?.(a?An("column-gap",getComputedStyle(f).columnGap,o):An("row-gap",getComputedStyle(f).rowGap,o)),p!==null&&e(p)},[e,t,o,l,i,s,a]);return dn(u,n,c)}function Ys(e,t,n,s){const o=e.length;if(o===0)return null;const l=[];for(let i=0;i<o;i++){const a=e.item(i);if(a.dataset.index===void 0)continue;const c=parseInt(a.dataset.index),u=parseFloat(a.dataset.knownSize),f=t(a,n);if(f===0&&s("Zero-sized element, this should not happen",{child:a},Ce.ERROR),f===u)continue;const p=l[l.length-1];l.length===0||p.size!==f||p.endIndex!==c-1?l.push({endIndex:c,size:f,startIndex:c}):l[l.length-1].endIndex++}return l}function An(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Ce.WARN),t==="normal"?0:parseInt(t??"0",10)}function br(e,t,n){const s=F.useRef(null),o=F.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const u=c.getBoundingClientRect(),f=u.width;let p,x;if(t){const v=t.getBoundingClientRect(),T=u.top-v.top;x=v.height-Math.max(0,T),p=T+t.scrollTop}else{const v=i.current.ownerDocument.defaultView;x=v.innerHeight-Math.max(0,u.top),p=u.top+v.scrollY}s.current={offsetTop:p,visibleHeight:x,visibleWidth:f},e(s.current)},[e,t]),{callbackRef:l,ref:i}=dn(o,!0,n),a=F.useCallback(()=>{o(i.current)},[o,i]);return F.useEffect(()=>{var c;if(t){t.addEventListener("scroll",a);const u=new ResizeObserver(()=>{requestAnimationFrame(a)});return u.observe(t),()=>{t.removeEventListener("scroll",a),u.unobserve(t)}}else{const u=(c=i.current)==null?void 0:c.ownerDocument.defaultView;return u?.addEventListener("scroll",a),u?.addEventListener("resize",a),()=>{u?.removeEventListener("scroll",a),u?.removeEventListener("resize",a)}}},[a,t,i]),l}const Ie=$(()=>{const e=U(),t=U(),n=I(0),s=U(),o=I(0),l=U(),i=U(),a=I(0),c=I(0),u=I(0),f=I(0),p=U(),x=U(),v=I(!1),T=I(!1),k=I(!1);return M(w(e,L(({scrollTop:g})=>g)),t),M(w(e,L(({scrollHeight:g})=>g)),i),M(t,o),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:c,footerHeight:f,headerHeight:a,horizontalDirection:T,scrollBy:x,scrollContainerState:e,scrollHeight:i,scrollingInProgress:v,scrollTo:p,scrollTop:t,skipAnimationFrameInResizeObserver:k,smoothScrollTargetReached:s,statefulScrollTop:o,viewportHeight:l}},[],{singleton:!0}),dt={lvl:0};function wr(e,t){const n=e.length;if(n===0)return[];let{index:s,value:o}=t(e[0]);const l=[];for(let i=1;i<n;i++){const{index:a,value:c}=t(e[i]);l.push({end:a-1,start:s,value:o}),s=a,o=c}return l.push({end:1/0,start:s,value:o}),l}function ee(e){return e===dt}function mt(e,t){if(!ee(e))return t===e.k?e.v:t<e.k?mt(e.l,t):mt(e.r,t)}function Be(e,t,n="k"){if(ee(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const s=Be(e.r,t,n);return s[0]===-1/0?[e.k,e.v]:s}return Be(e.l,t,n)}function Ne(e,t,n){return ee(e)?yr(t,n,1):t===e.k?he(e,{k:t,v:n}):t<e.k?Wn(he(e,{l:Ne(e.l,t,n)})):Wn(he(e,{r:Ne(e.r,t,n)}))}function rt(){return dt}function st(e,t,n){if(ee(e))return[];const s=Be(e,t)[0];return Js(tn(e,s,n))}function en(e,t){if(ee(e))return dt;const{k:n,l:s,r:o}=e;if(t===n){if(ee(s))return o;if(ee(o))return s;{const[l,i]=Sr(s);return Rt(he(e,{k:l,l:jr(s),v:i}))}}else return t<n?Rt(he(e,{l:en(s,t)})):Rt(he(e,{r:en(o,t)}))}function Je(e){return ee(e)?[]:[...Je(e.l),{k:e.k,v:e.v},...Je(e.r)]}function tn(e,t,n){if(ee(e))return[];const{k:s,l:o,r:l,v:i}=e;let a=[];return s>t&&(a=a.concat(tn(o,t,n))),s>=t&&s<=n&&a.push({k:s,v:i}),s<=n&&(a=a.concat(tn(l,t,n))),a}function Rt(e){const{l:t,lvl:n,r:s}=e;if(s.lvl>=n-1&&t.lvl>=n-1)return e;if(n>s.lvl+1){if(Wt(t))return Ir(he(e,{lvl:n-1}));if(!ee(t)&&!ee(t.r))return he(t.r,{l:he(t,{r:t.r.l}),lvl:n,r:he(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(Wt(e))return nn(he(e,{lvl:n-1}));if(!ee(s)&&!ee(s.l)){const o=s.l,l=Wt(o)?s.lvl-1:s.lvl;return he(o,{l:he(e,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:nn(he(s,{l:o.r,lvl:l}))})}else throw new Error("Unexpected empty nodes")}}function he(e,t){return yr(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function jr(e){return ee(e.r)?e.l:Rt(he(e,{r:jr(e.r)}))}function Wt(e){return ee(e)||e.lvl>e.r.lvl}function Sr(e){return ee(e.r)?[e.k,e.v]:Sr(e.r)}function yr(e,t,n,s=dt,o=dt){return{k:e,l:s,lvl:n,r:o,v:t}}function Wn(e){return nn(Ir(e))}function Ir(e){const{l:t}=e;return!ee(t)&&t.lvl===e.lvl?he(t,{r:he(e,{l:t.r})}):e}function nn(e){const{lvl:t,r:n}=e;return!ee(n)&&!ee(n.r)&&n.lvl===t&&n.r.lvl===t?he(n,{l:he(e,{r:n.l}),lvl:t+1}):e}function Js(e){return wr(e,({k:t,v:n})=>({index:t,value:n}))}function Tr(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function ht(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const mn=$(()=>({recalcInProgress:I(!1)}),[],{singleton:!0});function Cr(e,t,n){return e[zt(e,t,n)]}function zt(e,t,n,s=0){let o=e.length-1;for(;s<=o;){const l=Math.floor((s+o)/2),i=e[l],a=n(i,t);if(a===0)return l;if(a===-1){if(o-s<2)return l-1;o=l-1}else{if(o===s)return l;s=l+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Zs(e,t,n,s){const o=zt(e,t,s),l=zt(e,n,s,o);return e.slice(o,l+1)}function Ge(e,t){return Math.round(e.getBoundingClientRect()[t])}function Bt(e){return!ee(e.groupOffsetTree)}function hn({index:e},t){return t===e?0:t<e?-1:1}function Xs(){return{groupIndices:[],groupOffsetTree:rt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:rt()}}function eo(e,t){let n=ee(e)?0:1/0;for(const s of t){const{endIndex:o,size:l,startIndex:i}=s;if(n=Math.min(n,i),ee(e)){e=Ne(e,0,l);continue}const a=st(e,i-1,o+1);if(a.some(io(s)))continue;let c=!1,u=!1;for(const{end:f,start:p,value:x}of a)c?(o>=p||l===x)&&(e=en(e,p)):(u=x!==l,c=!0),f>o&&o>=p&&x!==l&&(e=Ne(e,o+1,x));u&&(e=Ne(e,i,l))}return[e,n]}function to(e){return typeof e.groupIndex<"u"}function no({offset:e},t){return t===e?0:t<e?-1:1}function ft(e,t,n){if(t.length===0)return 0;const{index:s,offset:o,size:l}=Cr(t,e,hn),i=e-s,a=l*i+(i-1)*n+o;return a>0?a+n:a}function Nr(e,t){if(!Bt(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function kr(e,t,n){if(to(e))return t.groupIndices[e.groupIndex]+1;{const s=e.index==="LAST"?n:e.index;let o=Nr(s,t);return o=Math.max(0,o,Math.min(n,o)),o}}function ro(e,t,n,s=0){return s>0&&(t=Math.max(t,Cr(e,s,hn).offset)),wr(Zs(e,t,n,no),lo)}function so(e,[t,n,s,o]){t.length>0&&s("received item sizes",t,Ce.DEBUG);const l=e.sizeTree;let i=l,a=0;if(n.length>0&&ee(l)&&t.length===2){const x=t[0].size,v=t[1].size;i=n.reduce((T,k)=>Ne(Ne(T,k,x),k+1,v),i)}else[i,a]=eo(i,t);if(i===l)return e;const{lastIndex:c,lastOffset:u,lastSize:f,offsetTree:p}=rn(e.offsetTree,a,i,o);return{groupIndices:n,groupOffsetTree:n.reduce((x,v)=>Ne(x,v,ft(v,p,o)),rt()),lastIndex:c,lastOffset:u,lastSize:f,offsetTree:p,sizeTree:i}}function oo(e){return Je(e).map(({k:t,v:n},s,o)=>{const l=o[s+1];return{endIndex:l?l.k-1:1/0,size:n,startIndex:t}})}function _n(e,t){let n=0,s=0;for(;n<e;)n+=t[s+1]-t[s]-1,s++;return s-(n===e?0:1)}function rn(e,t,n,s){let o=e,l=0,i=0,a=0,c=0;if(t!==0){c=zt(o,t-1,hn),a=o[c].offset;const u=Be(n,t-1);l=u[0],i=u[1],o.length&&o[c].size===Be(n,t)[1]&&(c-=1),o=o.slice(0,c+1)}else o=[];for(const{start:u,value:f}of st(n,t,1/0)){const p=u-l,x=p*i+a+p*s;o.push({index:u,offset:x,size:f}),l=u,a=x,i=f}return{lastIndex:l,lastOffset:a,lastSize:i,offsetTree:o}}function lo(e){return{index:e.index,value:e}}function io(e){const{endIndex:t,size:n,startIndex:s}=e;return o=>o.start===s&&(o.end===t||o.end===1/0)&&o.value===n}const ao={offsetHeight:"height",offsetWidth:"width"},We=$(([{log:e},{recalcInProgress:t}])=>{const n=U(),s=U(),o=we(s,0),l=U(),i=U(),a=I(0),c=I([]),u=I(void 0),f=I(void 0),p=I(void 0),x=I(void 0),v=I((d,b)=>Ge(d,ao[b])),T=I(void 0),k=I(0),g=Xs(),m=we(w(n,G(c,e,k),Pe(so,g),re()),g),h=we(w(c,re(),Pe((d,b)=>({current:b,prev:d.current}),{current:[],prev:[]}),L(({prev:d})=>d)),[]);M(w(c,A(d=>d.length>0),G(m,k),L(([d,b,y])=>{const z=d.reduce((S,C,D)=>Ne(S,C,ft(C,b.offsetTree,y)||D),rt());return{...b,groupIndices:d,groupOffsetTree:z}})),m),M(w(s,G(m),A(([d,{lastIndex:b}])=>d<b),L(([d,{lastIndex:b,lastSize:y}])=>[{endIndex:b,size:y,startIndex:d}])),n),M(u,f);const j=we(w(u,L(d=>d===void 0)),!0);M(w(f,A(d=>d!==void 0&&ee(le(m).sizeTree)),L(d=>{const b=le(p),y=le(c).length>0;return b?y?[{endIndex:0,size:b,startIndex:0},{endIndex:1,size:d,startIndex:1}]:[]:[{endIndex:0,size:d,startIndex:0}]})),n),M(w(x,A(d=>d!==void 0&&d.length>0&&ee(le(m).sizeTree)),L(d=>{const b=[];let y=d[0],z=0;for(let S=1;S<d.length;S++){const C=d[S];C!==y&&(b.push({endIndex:S-1,size:y,startIndex:z}),y=C,z=S)}return b.push({endIndex:d.length-1,size:y,startIndex:z}),b})),n),M(w(c,G(p,f),A(([,d,b])=>d!==void 0&&b!==void 0),L(([d,b,y])=>{const z=[];for(let S=0;S<d.length;S++){const C=d[S],D=d[S+1];z.push({startIndex:C,endIndex:C,size:b}),D!==void 0&&z.push({startIndex:C+1,endIndex:D-1,size:y})}return z})),n);const H=ke(w(n,G(m),Pe(({sizes:d},[b,y])=>({changed:y!==d,sizes:y}),{changed:!1,sizes:g}),L(d=>d.changed)));J(w(a,Pe((d,b)=>({diff:d.prev-b,prev:b}),{diff:0,prev:0}),L(d=>d.diff)),d=>{const{groupIndices:b}=le(m);if(d>0)q(t,!0),q(l,d+_n(d,b));else if(d<0){const y=le(h);y.length>0&&(d-=_n(-d,y)),q(i,d)}}),J(w(a,G(e)),([d,b])=>{d<0&&b("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Ce.ERROR)});const E=ke(l);M(w(l,G(m),L(([d,b])=>{const y=b.groupIndices.length>0,z=[],S=b.lastSize;if(y){const C=mt(b.sizeTree,0);let D=0,B=0;for(;D<d;){const Q=b.groupIndices[B],Z=b.groupIndices.length===B+1?1/0:b.groupIndices[B+1]-Q-1;z.push({endIndex:Q,size:C,startIndex:Q}),z.push({endIndex:Q+1+Z-1,size:S,startIndex:Q+1}),B++,D+=Z+1}const V=Je(b.sizeTree);return D!==d&&V.shift(),V.reduce((Q,{k:Z,v:ne})=>{let je=Q.ranges;return Q.prevSize!==0&&(je=[...Q.ranges,{endIndex:Z+d-1,size:Q.prevSize,startIndex:Q.prevIndex}]),{prevIndex:Z+d,prevSize:ne,ranges:je}},{prevIndex:d,prevSize:0,ranges:z}).ranges}return Je(b.sizeTree).reduce((C,{k:D,v:B})=>({prevIndex:D+d,prevSize:B,ranges:[...C.ranges,{endIndex:D+d-1,size:C.prevSize,startIndex:C.prevIndex}]}),{prevIndex:0,prevSize:S,ranges:[]}).ranges})),n);const R=ke(w(i,G(m,k),L(([d,{offsetTree:b},y])=>{const z=-d;return ft(z,b,y)})));return M(w(i,G(m,k),L(([d,b,y])=>{if(b.groupIndices.length>0){if(ee(b.sizeTree))return b;let z=rt();const S=le(h);let C=0,D=0,B=0;for(;C<-d;){B=S[D];const V=S[D+1]-B-1;D++,C+=V+1}if(z=Je(b.sizeTree).reduce((V,{k:Q,v:Z})=>Ne(V,Math.max(0,Q+d),Z),z),C!==-d){const V=mt(b.sizeTree,B);z=Ne(z,0,V);const Q=Be(b.sizeTree,-d+1)[1];z=Ne(z,1,Q)}return{...b,sizeTree:z,...rn(b.offsetTree,0,z,y)}}else{const z=Je(b.sizeTree).reduce((S,{k:C,v:D})=>Ne(S,Math.max(0,C+d),D),rt());return{...b,sizeTree:z,...rn(b.offsetTree,0,z,y)}}})),m),{beforeUnshiftWith:E,data:T,defaultItemSize:f,firstItemIndex:a,fixedItemSize:u,fixedGroupSize:p,gap:k,groupIndices:c,heightEstimates:x,itemSize:v,listRefresh:H,shiftWith:i,shiftWithOffset:R,sizeRanges:n,sizes:m,statefulTotalCount:o,totalCount:s,trackItemSizes:j,unshiftWith:l}},se(Ue,mn),{singleton:!0});function co(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const Rr=$(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:s,scrollTop:o}])=>{const l=U(),i=U(),a=ke(w(l,L(co)));return M(w(a,L(c=>c.totalCount)),n),M(w(a,L(c=>c.groupIndices)),e),M(w(de(o,t,s),A(([c,u])=>Bt(u)),L(([c,u,f])=>Be(u.groupOffsetTree,Math.max(c-f,0),"v")[0]),re(),L(c=>[c])),i),{groupCounts:l,topItemsIndexes:i}},se(We,Ie)),Ke=$(([{log:e}])=>{const t=I(!1),n=ke(w(t,A(s=>s),re()));return J(t,s=>{s&&le(e)("props updated",{},Ce.DEBUG)}),{didMount:n,propsReady:t}},se(Ue),{singleton:!0}),uo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Er(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!uo)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const vt=$(([{gap:e,listRefresh:t,sizes:n,totalCount:s},{fixedFooterHeight:o,fixedHeaderHeight:l,footerHeight:i,headerHeight:a,scrollingInProgress:c,scrollTo:u,smoothScrollTargetReached:f,viewportHeight:p},{log:x}])=>{const v=U(),T=U(),k=I(0);let g=null,m=null,h=null;function j(){g&&(g(),g=null),h&&(h(),h=null),m&&(clearTimeout(m),m=null),q(c,!1)}return M(w(v,G(n,p,s,k,a,i,x),G(e,l,o),L(([[H,E,R,d,b,y,z,S],C,D,B])=>{const V=Er(H),{align:Q,behavior:Z,offset:ne}=V,je=d-1,ge=kr(V,E,je);let xe=ft(ge,E.offsetTree,C)+y;Q==="end"?(xe+=D+Be(E.sizeTree,ge)[1]-R+B,ge===je&&(xe+=z)):Q==="center"?xe+=(D+Be(E.sizeTree,ge)[1]-R+B)/2:xe-=b,ne&&(xe+=ne);const Re=Se=>{j(),Se?(S("retrying to scroll to",{location:H},Ce.DEBUG),q(v,H)):(q(T,!0),S("list did not change, scroll successful",{},Ce.DEBUG))};if(j(),Z==="smooth"){let Se=!1;h=J(t,Fe=>{Se=Se||Fe}),g=Oe(f,()=>{Re(Se)})}else g=Oe(w(t,mo(150)),Re);return m=setTimeout(()=>{j()},1200),q(c,!0),S("scrolling from index to",{behavior:Z,index:ge,top:xe},Ce.DEBUG),{behavior:Z,top:xe}})),u),{scrollTargetReached:T,scrollToIndex:v,topListHeight:k}},se(We,Ie,Ue),{singleton:!0});function mo(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return s=>{s&&(t(!0),clearTimeout(n))}}}function fn(e,t){e==0?t():requestAnimationFrame(()=>{fn(e-1,t)})}function gn(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const bt=$(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:s},{scrollTargetReached:o,scrollToIndex:l},{didMount:i}])=>{const a=I(!0),c=I(0),u=I(!0);return M(w(i,G(c),A(([f,p])=>!!p),De(!1)),a),M(w(i,G(c),A(([f,p])=>!!p),De(!1)),u),J(w(de(t,i),G(a,n,e,u),A(([[,f],p,{sizeTree:x},v,T])=>f&&(!ee(x)||cn(v))&&!p&&!T),G(c)),([,f])=>{Oe(o,()=>{q(u,!0)}),fn(4,()=>{Oe(s,()=>{q(a,!0)}),q(l,f)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:c,scrolledToInitialItem:a}},se(We,Ie,vt,Ke),{singleton:!0});function zr(e,t){return Math.abs(e-t)<1.01}const gt="up",ct="down",ho="none",fo={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},go=0,wt=$(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:s,scrollTop:o,viewportHeight:l}])=>{const i=I(!1),a=I(!0),c=U(),u=U(),f=I(4),p=I(go),x=we(w(Xt(w(P(o),Ze(1),De(!0)),w(P(o),Ze(1),De(!1),Pn(100))),re()),!1),v=we(w(Xt(w(n,De(!0)),w(n,De(!1),Pn(200))),re()),!1);M(w(de(P(o),P(p)),L(([h,j])=>h<=j),re()),a),M(w(a,_e(50)),u);const T=ke(w(de(s,P(l),P(t),P(e),P(f)),Pe((h,[{scrollHeight:j,scrollTop:H},E,R,d,b])=>{const y=H+E-j>-b,z={scrollHeight:j,scrollTop:H,viewportHeight:E};if(y){let C,D;return H>h.state.scrollTop?(C="SCROLLED_DOWN",D=h.state.scrollTop-H):(C="SIZE_DECREASED",D=h.state.scrollTop-H||h.scrollTopDelta),{atBottom:!0,atBottomBecause:C,scrollTopDelta:D,state:z}}let S;return z.scrollHeight>h.state.scrollHeight?S="SIZE_INCREASED":E<h.state.viewportHeight?S="VIEWPORT_HEIGHT_DECREASING":H<h.state.scrollTop?S="SCROLLING_UPWARDS":S="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:S,state:z}},fo),re((h,j)=>h&&h.atBottom===j.atBottom))),k=we(w(s,Pe((h,{scrollHeight:j,scrollTop:H,viewportHeight:E})=>{if(zr(h.scrollHeight,j))return{changed:!1,jump:0,scrollHeight:j,scrollTop:H};{const R=j-(H+E)<1;return h.scrollTop!==H&&R?{changed:!0,jump:h.scrollTop-H,scrollHeight:j,scrollTop:H}:{changed:!0,jump:0,scrollHeight:j,scrollTop:H}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),A(h=>h.changed),L(h=>h.jump)),0);M(w(T,L(h=>h.atBottom)),i),M(w(i,_e(50)),c);const g=I(ct);M(w(s,L(({scrollTop:h})=>h),re(),Pe((h,j)=>le(v)?{direction:h.direction,prevScrollTop:j}:{direction:j<h.prevScrollTop?gt:ct,prevScrollTop:j},{direction:ct,prevScrollTop:0}),L(h=>h.direction)),g),M(w(s,_e(50),De(ho)),g);const m=I(0);return M(w(x,A(h=>!h),De(0)),m),M(w(o,_e(100),G(x),A(([h,j])=>!!j),Pe(([h,j],[H])=>[j,H],[0,0]),L(([h,j])=>j-h)),m),{atBottomState:T,atBottomStateChange:c,atBottomThreshold:f,atTopStateChange:u,atTopThreshold:p,isAtBottom:i,isAtTop:a,isScrolling:x,lastJumpDueToItemResize:k,scrollDirection:g,scrollVelocity:m}},se(Ie)),xt="top",pt="bottom",Vn="none";function qn(e,t,n){return typeof e=="number"?n===gt&&t===xt||n===ct&&t===pt?e:0:n===gt?t===xt?e.main:e.reverse:t===pt?e.main:e.reverse}function Gn(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const xn=$(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:s,viewportHeight:o}])=>{const l=U(),i=I(0),a=I(0),c=I(0),u=we(w(de(P(s),P(o),P(n),P(l,ht),P(c),P(i),P(t),P(e),P(a)),L(([f,p,x,[v,T],k,g,m,h,j])=>{const H=f-h,E=g+m,R=Math.max(x-H,0);let d=Vn;const b=Gn(j,xt),y=Gn(j,pt);return v-=h,v+=x+m,T+=x+m,T-=h,v>f+E-b&&(d=gt),T<f-R+p+y&&(d=ct),d!==Vn?[Math.max(H-x-qn(k,xt,d)-b,0),H-R-m+p+qn(k,pt,d)+y]:null}),A(f=>f!=null),re(ht)),[0,0]);return{increaseViewportBy:a,listBoundary:l,overscan:c,topListHeight:i,visibleRange:u}},se(Ie),{singleton:!0});function xo(e,t,n){if(Bt(t)){const s=Nr(e,t);return[{index:Be(t.groupOffsetTree,s)[0],offset:0,size:0},{data:n?.[0],index:s,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}const _t={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Et(e,t,n,s,o,l){const{lastIndex:i,lastOffset:a,lastSize:c}=o;let u=0,f=0;if(e.length>0){u=e[0].offset;const k=e[e.length-1];f=k.offset+k.size}const p=n-i,x=a+p*c+(p-1)*s,v=u,T=x-f;return{bottom:f,firstItemIndex:l,items:Qn(e,o,l),offsetBottom:T,offsetTop:u,top:v,topItems:Qn(t,o,l),topListHeight:t.reduce((k,g)=>g.size+k,0),totalCount:n}}function Hr(e,t,n,s,o,l){let i=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-i>=e)break;i++}const a=e+i,c=gn(t,a),u=Array.from({length:a}).map((f,p)=>({data:l[p+c],index:p+c,offset:0,size:0}));return Et(u,[],a,o,n,s)}function Qn(e,t,n){if(e.length===0)return[];if(!Bt(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const s=e[0].index,o=e[e.length-1].index,l=[],i=st(t.groupOffsetTree,s,o);let a,c=0;for(const u of e){(!a||a.end<u.index)&&(a=i.shift(),c=t.groupIndices.indexOf(a.start));let f;u.index===a.start?f={index:c,type:"group"}:f={groupIndex:c,index:u.index-(c+1)+n},l.push({...f,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return l}function Un(e,t){var n;return e===void 0?0:typeof e=="number"?e:(n=e[t])!=null?n:0}const et=$(([{data:e,firstItemIndex:t,gap:n,sizes:s,totalCount:o},l,{listBoundary:i,topListHeight:a,visibleRange:c},{initialTopMostItemIndex:u,scrolledToInitialItem:f},{topListHeight:p},x,{didMount:v},{recalcInProgress:T}])=>{const k=I([]),g=I(0),m=U(),h=I(0);M(l.topItemsIndexes,k);const j=we(w(de(v,T,P(c,ht),P(o),P(s),P(u),f,P(k),P(t),P(n),P(h),e),A(([d,b,,y,,,,,,,,z])=>{const S=z&&z.length!==y;return d&&!b&&!S}),L(([,,[d,b],y,z,S,C,D,B,V,Q,Z])=>{var ne,je,ge,xe;const Re=z,{offsetTree:Se,sizeTree:Fe}=Re,$e=le(g);if(y===0)return{..._t,totalCount:y};if(d===0&&b===0)return $e===0?{..._t,totalCount:y}:Hr($e,S,z,B,V,Z||[]);if(ee(Fe))return $e>0?null:Et(xo(gn(S,y),Re,Z),[],y,V,Re,B);const Ve=[];if(D.length>0){const ie=D[0],ae=D[D.length-1];let fe=0;for(const ue of st(Fe,ie,ae)){const X=ue.value,te=Math.max(ue.start,ie),Ee=Math.min(ue.end,ae);for(let pe=te;pe<=Ee;pe++)Ve.push({data:Z?.[pe],index:pe,offset:fe,size:X}),fe+=X}}if(!C)return Et([],Ve,y,V,Re,B);const Me=D.length>0?D[D.length-1]+1:0,N=ro(Se,d,b,Me);if(N.length===0)return null;const _=y-1,Y=Ot([],ie=>{for(const ae of N){const fe=ae.value;let ue=fe.offset,X=ae.start;const te=fe.size;if(fe.offset<d){X+=Math.floor((d-fe.offset+V)/(te+V));const pe=X-ae.start;ue+=pe*te+pe*V}X<Me&&(ue+=(Me-X)*te,X=Me);const Ee=Math.min(ae.end,_);for(let pe=X;pe<=Ee&&!(ue>=b);pe++)ie.push({data:Z?.[pe],index:pe,offset:ue,size:te}),ue+=te+V}}),ce=Un(Q,xt),me=Un(Q,pt);if(Y.length>0&&(ce>0||me>0)){const ie=Y[0],ae=Y[Y.length-1];if(ce>0&&ie.index>Me){const fe=Math.min(ce,ie.index-Me),ue=[];let X=ie.offset;for(let te=ie.index-1;te>=ie.index-fe;te--){const Ee=(je=(ne=st(Fe,te,te)[0])==null?void 0:ne.value)!=null?je:ie.size;X-=Ee+V,ue.unshift({data:Z?.[te],index:te,offset:X,size:Ee})}Y.unshift(...ue)}if(me>0&&ae.index<_){const fe=Math.min(me,_-ae.index);let ue=ae.offset+ae.size+V;for(let X=ae.index+1;X<=ae.index+fe;X++){const te=(xe=(ge=st(Fe,X,X)[0])==null?void 0:ge.value)!=null?xe:ae.size;Y.push({data:Z?.[X],index:X,offset:ue,size:te}),ue+=te+V}}}return Et(Y,Ve,y,V,Re,B)}),A(d=>d!==null),re()),_t);M(w(e,A(cn),L(d=>d?.length)),o),M(w(j,L(d=>d.topListHeight)),p),M(p,a),M(w(j,L(d=>[d.top,d.bottom])),i),M(w(j,L(d=>d.items)),m);const H=ke(w(j,A(({items:d})=>d.length>0),G(o,e),A(([{items:d},b])=>d[d.length-1].originalIndex===b-1),L(([,d,b])=>[d-1,b]),re(ht),L(([d])=>d))),E=ke(w(j,_e(200),A(({items:d,topItems:b})=>d.length>0&&d[0].originalIndex===b.length),L(({items:d})=>d[0].index),re())),R=ke(w(j,A(({items:d})=>d.length>0),L(({items:d})=>{let b=0,y=d.length-1;for(;d[b].type==="group"&&b<y;)b++;for(;d[y].type==="group"&&y>b;)y--;return{endIndex:d[y].index,startIndex:d[b].index}}),re(Tr)));return{endReached:H,initialItemCount:g,itemsRendered:m,listState:j,minOverscanItemCount:h,rangeChanged:R,startReached:E,topItemsIndexes:k,...x}},se(We,Rr,xn,bt,vt,wt,Ke,mn),{singleton:!0}),Lr=$(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:s},{listState:o}])=>{const l=U(),i=we(w(de(n,e,s,t,o),L(([a,c,u,f,p])=>a+c+u+f+p.offsetBottom+p.bottom)),0);return M(P(i),l),{totalListHeight:i,totalListHeightChanged:l}},se(Ie,et),{singleton:!0}),po=$(([{viewportHeight:e},{totalListHeight:t}])=>{const n=I(!1),s=we(w(de(n,e,t),A(([o])=>o),L(([,o,l])=>Math.max(0,o-l)),_e(0),re()),0);return{alignToBottom:n,paddingTopAddition:s}},se(Ie,Lr),{singleton:!0}),Or=$(()=>({context:I(null)})),vo=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:s,...o},viewportBottom:l,viewportTop:i})=>t<i?{...o,align:n??"start",behavior:s}:e>l?{...o,align:n??"end",behavior:s}:null,Br=$(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:s,fixedHeaderHeight:o,headerHeight:l,scrollingInProgress:i,scrollTop:a,viewportHeight:c},{scrollToIndex:u}])=>{const f=U();return M(w(f,G(t,c,n,l,o,s,a),G(e),L(([[p,x,v,T,k,g,m,h],j])=>{const{align:H,behavior:E,calculateViewLocation:R=vo,done:d,...b}=p,y=kr(p,x,T-1),z=ft(y,x.offsetTree,j)+k+g,S=z+Be(x.sizeTree,y)[1],C=h+g,D=h+v-m,B=R({itemBottom:S,itemTop:z,locationParams:{align:H,behavior:E,...b},viewportBottom:D,viewportTop:C});return B?d&&Oe(w(i,A(V=>!V),Ze(le(i)?1:2)),d):d&&d(),B}),A(p=>p!==null)),u),{scrollIntoView:f}},se(We,Ie,vt,et,Ue),{singleton:!0});function Kn(e){return e?e==="smooth"?"smooth":"auto":!1}const bo=(e,t)=>typeof e=="function"?Kn(e(t)):t&&Kn(e),wo=$(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:s},{atBottomState:o,isAtBottom:l},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:c,propsReady:u},{log:f},{scrollingInProgress:p},{context:x},{scrollIntoView:v}])=>{const T=I(!1),k=U();let g=null;function m(E){q(i,{align:"end",behavior:E,index:"LAST"})}J(w(de(w(P(t),Ze(1)),c),G(P(T),l,a,p),L(([[E,R],d,b,y,z])=>{let S=R&&y,C="auto";return S&&(C=bo(d,b||z),S=S&&!!C),{followOutputBehavior:C,shouldFollow:S,totalCount:E}}),A(({shouldFollow:E})=>E)),({followOutputBehavior:E,totalCount:R})=>{g&&(g(),g=null),le(n)?requestAnimationFrame(()=>{le(f)("following output to ",{totalCount:R},Ce.DEBUG),m(E)}):g=Oe(e,()=>{le(f)("following output to ",{totalCount:R},Ce.DEBUG),m(E),g=null})});function h(E){const R=Oe(o,d=>{E&&!d.atBottom&&d.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(le(f)("scrolling to bottom due to increased size",{},Ce.DEBUG),m("auto"))});setTimeout(R,100)}J(w(de(P(T),t,u),A(([E,,R])=>E&&R),Pe(({value:E},[,R])=>({refreshed:E===R,value:R}),{refreshed:!1,value:0}),A(({refreshed:E})=>E),G(T,t)),([,E])=>{le(a)&&h(E!==!1)}),J(k,()=>{h(le(T)!==!1)}),J(de(P(T),o),([E,R])=>{E&&!R.atBottom&&R.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&m("auto")});const j=I(null),H=U();return M(Xt(w(P(s),L(E=>{var R;return(R=E?.length)!=null?R:0})),w(P(t))),H),J(w(de(w(H,Ze(1)),c),G(P(j),a,p,x),L(([[E,R],d,b,y,z])=>R&&b&&d?.({context:z,totalCount:E,scrollingInProgress:y})),A(E=>!!E),_e(0)),E=>{g&&(g(),g=null),le(n)?requestAnimationFrame(()=>{le(f)("scrolling into view",{}),q(v,E)}):g=Oe(e,()=>{le(f)("scrolling into view",{}),q(v,E),g=null})}),{autoscrollToBottom:k,followOutput:T,scrollIntoViewOnChange:j}},se(We,wt,vt,bt,Ke,Ue,Ie,Or,Br)),jo=$(([{data:e,firstItemIndex:t,gap:n,sizes:s},{initialTopMostItemIndex:o},{initialItemCount:l,listState:i},{didMount:a}])=>(M(w(a,G(l),A(([,c])=>c!==0),G(o,s,t,n,e),L(([[,c],u,f,p,x,v=[]])=>Hr(c,u,f,p,x,v))),i),{}),se(We,bt,et,Ke),{singleton:!0}),So=$(([{didMount:e},{scrollTo:t},{listState:n}])=>{const s=I(0);return J(w(e,G(s),A(([,o])=>o!==0),L(([,o])=>({top:o}))),o=>{Oe(w(n,Ze(1),A(l=>l.items.length>1)),()=>{requestAnimationFrame(()=>{q(t,o)})})}),{initialScrollTop:s}},se(Ke,Ie,et),{singleton:!0}),Fr=$(([{scrollVelocity:e}])=>{const t=I(!1),n=U(),s=I(!1);return M(w(e,G(s,t,n),A(([o,l])=>!!l),L(([o,l,i,a])=>{const{enter:c,exit:u}=l;if(i){if(u(o,a))return!1}else if(c(o,a))return!0;return i}),re()),t),J(w(de(t,e,n),G(s)),([[o,l,i],a])=>{o&&a&&a.change&&a.change(l,i)}),{isSeeking:t,scrollSeekConfiguration:s,scrollSeekRangeChanged:n,scrollVelocity:e}},se(wt),{singleton:!0}),pn=$(([{scrollContainerState:e,scrollTo:t}])=>{const n=U(),s=U(),o=U(),l=I(!1),i=I(void 0);return M(w(de(n,s),L(([{scrollHeight:a,scrollTop:c,viewportHeight:u},{offsetTop:f}])=>({scrollHeight:a,scrollTop:Math.max(0,c-f),viewportHeight:u}))),e),M(w(t,G(s),L(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),o),{customScrollParent:i,useWindowScroll:l,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:s}},se(Ie)),yo=$(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:s},{initialTopMostItemIndex:o},{didMount:l},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:c}])=>{const u=U(),f=I(void 0),p=I(null),x=I(null);return M(a,p),M(c,x),J(w(u,G(t,s,i,p,x,n)),([v,T,k,g,m,h,j])=>{const H=oo(T.sizeTree);g&&m!==null&&h!==null&&(k=m.scrollTop-h.offsetTop),k-=j,v({ranges:H,scrollTop:k})}),M(w(f,A(cn),L(Io)),o),M(w(l,G(f),A(([,v])=>v!==void 0),re(),L(([,v])=>v.ranges)),e),{getState:u,restoreStateFrom:f}},se(We,Ie,bt,Ke,pn));function Io(e){return{align:"start",index:0,offset:e.scrollTop}}const To=$(([{topItemsIndexes:e}])=>{const t=I(0);return M(w(t,A(n=>n>=0),L(n=>Array.from({length:n}).map((s,o)=>o))),e),{topItemCount:t}},se(et));function Mr(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Co=Mr(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),No=$(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:s},{isAtBottom:o,isScrolling:l,lastJumpDueToItemResize:i,scrollDirection:a},{listState:c},{beforeUnshiftWith:u,gap:f,shiftWithOffset:p,sizes:x},{log:v},{recalcInProgress:T}])=>{const k=ke(w(c,G(i),Pe(([,m,h,j],[{bottom:H,items:E,offsetBottom:R,totalCount:d},b])=>{const y=H+R;let z=0;return h===d&&m.length>0&&E.length>0&&(E[0].originalIndex===0&&m[0].originalIndex===0||(z=y-j,z!==0&&(z+=b))),[z,E,d,y]},[0,[],0,0]),A(([m])=>m!==0),G(s,a,n,o,v,T),A(([,m,h,j,,,H])=>!H&&!j&&m!==0&&h===gt),L(([[m],,,,,h])=>(h("Upward scrolling compensation",{amount:m},Ce.DEBUG),m))));function g(m){m>0?(q(t,{behavior:"auto",top:-m}),q(e,0)):(q(e,0),q(t,{behavior:"auto",top:-m}))}return J(w(k,G(e,l)),([m,h,j])=>{j&&Co()?q(e,h-m):g(-m)}),J(w(de(we(l,!1),e,T),A(([m,h,j])=>!m&&!j&&h!==0),L(([m,h])=>h),_e(1)),g),M(w(p,L(m=>({top:-m}))),t),J(w(u,G(x,f),L(([m,{groupIndices:h,lastSize:j,sizeTree:H},E])=>{function R(d){return d*(j+E)}if(h.length===0)return R(m);{let d=0;const b=mt(H,0);let y=0,z=0;for(;y<m;){y++,d+=b;let S=h.length===z+1?1/0:h[z+1]-h[z]-1;y+S>m&&(d-=b,S=m-y+1),y+=S,d+=R(S),z++}return d}})),m=>{q(e,m),requestAnimationFrame(()=>{q(t,{top:m}),requestAnimationFrame(()=>{q(e,0),q(T,!1)})})}),{deviation:e}},se(Ie,wt,et,We,Ue,mn)),ko=$(([e,t,n,s,o,l,i,a,c,u,f])=>({...e,...t,...n,...s,...o,...l,...i,...a,...c,...u,...f}),se(xn,jo,Ke,Fr,Lr,So,po,pn,Br,Ue,Or)),Dr=$(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:s,fixedGroupSize:o,gap:l,groupIndices:i,heightEstimates:a,itemSize:c,sizeRanges:u,sizes:f,statefulTotalCount:p,totalCount:x,trackItemSizes:v},{initialItemFinalLocationReached:T,initialTopMostItemIndex:k,scrolledToInitialItem:g},m,h,j,H,{scrollToIndex:E},R,{topItemCount:d},{groupCounts:b},y])=>{const{listState:z,minOverscanItemCount:S,topItemsIndexes:C,rangeChanged:D,...B}=H;return M(D,y.scrollSeekRangeChanged),M(w(y.windowViewportRect,L(V=>V.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:s,fixedGroupHeight:o,gap:l,groupCounts:b,heightEstimates:a,initialItemFinalLocationReached:T,initialTopMostItemIndex:k,scrolledToInitialItem:g,sizeRanges:u,topItemCount:d,topItemsIndexes:C,totalCount:x,...j,groupIndices:i,itemSize:c,listState:z,minOverscanItemCount:S,scrollToIndex:E,statefulTotalCount:p,trackItemSizes:v,rangeChanged:D,...B,...y,...m,sizes:f,...h}},se(We,bt,Ie,yo,wo,et,vt,No,To,Rr,ko));function Ro(e,t){const n={},s={};let o=0;const l=e.length;for(;o<l;)s[e[o]]=1,o+=1;for(const i in t)Object.hasOwn(s,i)||(n[i]=t[i]);return n}const St=typeof document<"u"?F.useLayoutEffect:F.useEffect;function Pr(e,t,n){const s=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),l=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=F.createContext({});function c(g,m){g.propsReady&&q(g.propsReady,!1);for(const h of s){const j=g[t.required[h]];q(j,m[h])}for(const h of o)if(h in m){const j=g[t.optional[h]];q(j,m[h])}g.propsReady&&q(g.propsReady,!0)}function u(g){return l.reduce((m,h)=>(m[h]=j=>{const H=g[t.methods[h]];q(H,j)},m),{})}function f(g){return i.reduce((m,h)=>(m[h]=qs(g[t.events[h]]),m),{})}const p=F.forwardRef((g,m)=>{const{children:h,...j}=g,[H]=F.useState(()=>Ot(Qs(e),d=>{c(d,j)})),[E]=F.useState(Dn(f,H));St(()=>{for(const d of i)d in j&&J(E[d],j[d]);return()=>{Object.values(E).map(un)}},[j,E,H]),St(()=>{c(H,j)}),F.useImperativeHandle(m,Mn(u(H)));const R=n;return r.jsx(a.Provider,{value:H,children:n?r.jsx(R,{...Ro([...s,...o,...i],j),children:h}):h})}),x=g=>{const m=F.useContext(a);return F.useCallback(h=>{q(m[g],h)},[m,g])},v=g=>{const m=F.useContext(a)[g],h=F.useCallback(j=>J(m,j),[m]);return F.useSyncExternalStore(h,()=>le(m),()=>le(m))},T=g=>{const m=F.useContext(a)[g],[h,j]=F.useState(Dn(le,m));return St(()=>J(m,H=>{H!==h&&j(Mn(H))}),[m,h]),h},k=F.version.startsWith("18")?v:T;return{Component:p,useEmitter:(g,m)=>{const h=F.useContext(a)[g];St(()=>J(h,m),[m,h])},useEmitterValue:k,usePublisher:x}}const Ar=F.createContext(void 0),Wr=F.createContext(void 0),_r=typeof document<"u"?F.useLayoutEffect:F.useEffect;function Vt(e){return"self"in e}function Eo(e){return"body"in e}function Vr(e,t,n,s=lt,o,l){const i=F.useRef(null),a=F.useRef(null),c=F.useRef(null),u=F.useCallback(x=>{let v,T,k;const g=x.target;if(Eo(g)||Vt(g)){const h=Vt(g)?g:g.defaultView;k=l?h.scrollX:h.scrollY,v=l?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight,T=l?h.innerWidth:h.innerHeight}else k=l?g.scrollLeft:g.scrollTop,v=l?g.scrollWidth:g.scrollHeight,T=l?g.offsetWidth:g.offsetHeight;const m=()=>{e({scrollHeight:v,scrollTop:Math.max(k,0),viewportHeight:T})};x.suppressFlushSync?m():es.flushSync(m),a.current!==null&&(k===a.current||k<=0||k===v-T)&&(a.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,l]);F.useEffect(()=>{const x=o||i.current;return s(o||i.current),u({suppressFlushSync:!0,target:x}),x.addEventListener("scroll",u,{passive:!0}),()=>{s(null),x.removeEventListener("scroll",u)}},[i,u,n,s,o]);function f(x){const v=i.current;if(!v||(l?"offsetWidth"in v&&v.offsetWidth===0:"offsetHeight"in v&&v.offsetHeight===0))return;const T=x.behavior==="smooth";let k,g,m;Vt(v)?(g=Math.max(Ge(v.document.documentElement,l?"width":"height"),l?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight),k=l?v.innerWidth:v.innerHeight,m=l?window.scrollX:window.scrollY):(g=v[l?"scrollWidth":"scrollHeight"],k=Ge(v,l?"width":"height"),m=v[l?"scrollLeft":"scrollTop"]);const h=g-k;if(x.top=Math.ceil(Math.max(Math.min(h,x.top),0)),zr(k,g)||x.top===m){e({scrollHeight:g,scrollTop:m,viewportHeight:k}),T&&t(!0);return}T?(a.current=x.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=null,t(!0)},1e3)):a.current=null,l&&(x={behavior:x.behavior,left:x.top}),v.scrollTo(x)}function p(x){l&&(x={behavior:x.behavior,left:x.top}),i.current.scrollBy(x)}return{scrollByCallback:p,scrollerRef:i,scrollToCallback:f}}const qt="-webkit-sticky",$n="sticky",vn=Mr(()=>{if(typeof document>"u")return $n;const e=document.createElement("div");return e.style.position=qt,e.style.position===qt?qt:$n});function bn(e){return e}const zo=$(()=>{const e=I(a=>`Item ${a}`),t=I(a=>`Group ${a}`),n=I({}),s=I(bn),o=I("div"),l=I(lt),i=(a,c=null)=>we(w(n,L(u=>u[a]),re()),c);return{components:n,computeItemKey:s,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:o,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),Ho=$(([e,t])=>({...e,...t}),se(Dr,zo)),Lo=({height:e})=>r.jsx("div",{style:{height:e}}),Oo={overflowAnchor:"none",position:vn(),zIndex:1},qr={overflowAnchor:"none"},Bo={...qr,display:"inline-block",height:"100%"},Yn=F.memo(function({showTopList:e=!1}){const t=W("listState"),n=He("sizeRanges"),s=W("useWindowScroll"),o=W("customScrollParent"),l=He("windowScrollContainerState"),i=He("scrollContainerState"),a=o||s?l:i,c=W("itemContent"),u=W("context"),f=W("groupContent"),p=W("trackItemSizes"),x=W("itemSize"),v=W("log"),T=He("gap"),k=W("horizontalDirection"),{callbackRef:g}=$s(n,x,p,e?lt:a,v,T,o,k,W("skipAnimationFrameInResizeObserver")),[m,h]=F.useState(0);wn("deviation",B=>{m!==B&&h(B)});const j=W("EmptyPlaceholder"),H=W("ScrollSeekPlaceholder")||Lo,E=W("ListComponent"),R=W("ItemComponent"),d=W("GroupComponent"),b=W("computeItemKey"),y=W("isSeeking"),z=W("groupIndices").length>0,S=W("alignToBottom"),C=W("initialItemFinalLocationReached"),D=e?{}:{boxSizing:"border-box",...k?{display:"inline-block",height:"100%",marginLeft:m!==0?m:S?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:m!==0?m:S?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...C?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&j?r.jsx(j,{...be(j,u)}):r.jsx(E,{...be(E,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:D,children:(e?t.topItems:t.items).map(B=>{const V=B.originalIndex,Q=b(V+t.firstItemIndex,B.data,u);return y?O.createElement(H,{...be(H,u),height:B.size,index:B.index,key:Q,type:B.type||"item",...B.type==="group"?{}:{groupIndex:B.groupIndex}}):B.type==="group"?O.createElement(d,{...be(d,u),"data-index":V,"data-item-index":B.index,"data-known-size":B.size,key:Q,style:Oo},f(B.index,u)):O.createElement(R,{...be(R,u),...Po(R,B.data),"data-index":V,"data-item-group-index":B.groupIndex,"data-item-index":B.index,"data-known-size":B.size,key:Q,style:k?Bo:qr},z?c(B.index,B.groupIndex,B.data,u):c(B.index,B.data,u))})})}),Fo={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Mo={outline:"none",overflowX:"auto",position:"relative"},Ft=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),Do={position:vn(),top:0,width:"100%",zIndex:1};function be(e,t){if(typeof e!="string")return{context:t}}function Po(e,t){return{item:typeof e=="string"?void 0:t}}const Ao=F.memo(function(){const e=W("HeaderComponent"),t=He("headerHeight"),n=W("HeaderFooterTag"),s=Xe(F.useMemo(()=>l=>{t(Ge(l,"height"))},[t]),!0,W("skipAnimationFrameInResizeObserver")),o=W("context");return e?r.jsx(n,{ref:s,children:r.jsx(e,{...be(e,o)})}):null}),Wo=F.memo(function(){const e=W("FooterComponent"),t=He("footerHeight"),n=W("HeaderFooterTag"),s=Xe(F.useMemo(()=>l=>{t(Ge(l,"height"))},[t]),!0,W("skipAnimationFrameInResizeObserver")),o=W("context");return e?r.jsx(n,{ref:s,children:r.jsx(e,{...be(e,o)})}):null});function Gr({useEmitter:e,useEmitterValue:t,usePublisher:n}){return F.memo(function({children:s,style:o,context:l,...i}){const a=n("scrollContainerState"),c=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),f=t("scrollerRef"),p=t("horizontalDirection")||!1,{scrollByCallback:x,scrollerRef:v,scrollToCallback:T}=Vr(a,u,c,f,void 0,p);return e("scrollTo",T),e("scrollBy",x),r.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...p?Mo:Fo,...o},tabIndex:0,...i,...be(c,l),children:s})})}function Qr({useEmitter:e,useEmitterValue:t,usePublisher:n}){return F.memo(function({children:s,style:o,context:l,...i}){const a=n("windowScrollContainerState"),c=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),f=t("totalListHeight"),p=t("deviation"),x=t("customScrollParent"),v=F.useRef(null),T=t("scrollerRef"),{scrollByCallback:k,scrollerRef:g,scrollToCallback:m}=Vr(a,u,c,T,x);return _r(()=>{var h;return g.current=x||((h=v.current)==null?void 0:h.ownerDocument.defaultView),()=>{g.current=null}},[g,x]),e("windowScrollTo",m),e("scrollBy",k),r.jsx(c,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...f!==0?{height:f+p}:{}},...i,...be(c,l),children:s})})}const _o=({children:e})=>{const t=F.useContext(Ar),n=He("viewportHeight"),s=He("fixedItemHeight"),o=W("alignToBottom"),l=W("horizontalDirection"),i=F.useMemo(()=>pr(n,c=>Ge(c,l?"width":"height")),[n,l]),a=Xe(i,!0,W("skipAnimationFrameInResizeObserver"));return F.useEffect(()=>{t&&(n(t.viewportHeight),s(t.itemHeight))},[t,n,s]),r.jsx("div",{"data-viewport-type":"element",ref:a,style:Ft(o),children:e})},Vo=({children:e})=>{const t=F.useContext(Ar),n=He("windowViewportRect"),s=He("fixedItemHeight"),o=W("customScrollParent"),l=br(n,o,W("skipAnimationFrameInResizeObserver")),i=W("alignToBottom");return F.useEffect(()=>{t&&(s(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,s]),r.jsx("div",{"data-viewport-type":"window",ref:l,style:Ft(i),children:e})},qo=({children:e})=>{const t=W("TopItemListComponent")||"div",n=W("headerHeight"),s={...Do,marginTop:`${n}px`},o=W("context");return r.jsx(t,{style:s,...be(t,o),children:e})},Go=F.memo(function(e){const t=W("useWindowScroll"),n=W("topItemsIndexes").length>0,s=W("customScrollParent"),o=W("context");return r.jsxs(s||t?Ko:Uo,{...e,context:o,children:[n&&r.jsx(qo,{children:r.jsx(Yn,{showTopList:!0})}),r.jsxs(s||t?Vo:_o,{children:[r.jsx(Ao,{}),r.jsx(Yn,{}),r.jsx(Wo,{})]})]})}),{Component:Qo,useEmitter:wn,useEmitterValue:W,usePublisher:He}=Pr(Ho,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Go),Uo=Gr({useEmitter:wn,useEmitterValue:W,usePublisher:He}),Ko=Qr({useEmitter:wn,useEmitterValue:W,usePublisher:He}),$o=Qo,Yo=$(()=>{const e=I(u=>r.jsxs("td",{children:["Item $",u]})),t=I(null),n=I(u=>r.jsxs("td",{colSpan:1e3,children:["Group ",u]})),s=I(null),o=I(null),l=I({}),i=I(bn),a=I(lt),c=(u,f=null)=>we(w(l,L(p=>p[u]),re()),f);return{components:l,computeItemKey:i,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:s,itemContent:e,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});se(Dr,Yo);vn();const Jn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Jo={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Zn,floor:Ht,max:ut,min:Gt,round:Xn}=Math;function er(e,t,n){return Array.from({length:t-e+1}).map((s,o)=>({data:n===null?null:n[o+e],index:o+e}))}function Zo(e){return{...Jo,items:e}}function yt(e,t){return e&&e.width===t.width&&e.height===t.height}function Xo(e,t){return e&&e.column===t.column&&e.row===t.row}const el=$(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:s},{footerHeight:o,headerHeight:l,scrollBy:i,scrollContainerState:a,scrollTo:c,scrollTop:u,smoothScrollTargetReached:f,viewportHeight:p},x,v,{didMount:T,propsReady:k},{customScrollParent:g,useWindowScroll:m,windowScrollContainerState:h,windowScrollTo:j,windowViewportRect:H},E])=>{const R=I(0),d=I(0),b=I(Jn),y=I({height:0,width:0}),z=I({height:0,width:0}),S=U(),C=U(),D=I(0),B=I(null),V=I({column:0,row:0}),Q=U(),Z=U(),ne=I(!1),je=I(0),ge=I(!0),xe=I(!1),Re=I(!1);J(w(T,G(je),A(([N,_])=>!!_)),()=>{q(ge,!1)}),J(w(de(T,ge,z,y,je,xe),A(([N,_,Y,ce,,me])=>N&&!_&&Y.height!==0&&ce.height!==0&&!me)),([,,,,N])=>{q(xe,!0),fn(1,()=>{q(S,N)}),Oe(w(u),()=>{q(t,[0,0]),q(ge,!0)})}),M(w(Z,A(N=>N!=null&&N.scrollTop>0),De(0)),d),J(w(T,G(Z),A(([,N])=>N!=null)),([,N])=>{N&&(q(y,N.viewport),q(z,N.item),q(V,N.gap),N.scrollTop>0&&(q(ne,!0),Oe(w(u,Ze(1)),_=>{q(ne,!1)}),q(c,{top:N.scrollTop})))}),M(w(y,L(({height:N})=>N)),p),M(w(de(P(y,yt),P(z,yt),P(V,(N,_)=>N&&N.column===_.column&&N.row===_.row),P(u)),L(([N,_,Y,ce])=>({gap:Y,item:_,scrollTop:ce,viewport:N}))),Q),M(w(de(P(R),s,P(V,Xo),P(z,yt),P(y,yt),P(B),P(d),P(ne),P(ge),P(je)),A(([,,,,,,,N])=>!N),L(([N,[_,Y],ce,me,ie,ae,fe,,ue,X])=>{const{column:te,row:Ee}=ce,{height:pe,width:Mt}=me,{width:jn}=ie;if(fe===0&&(N===0||jn===0))return Jn;if(Mt===0){const Cn=gn(X,N),Xr=Cn+Math.max(fe-1,0);return Zo(er(Cn,Xr,ae))}const jt=Ur(jn,Mt,te);let tt,Ye;ue?_===0&&Y===0&&fe>0?(tt=0,Ye=fe-1):(tt=jt*Ht((_+Ee)/(pe+Ee)),Ye=jt*Zn((Y+Ee)/(pe+Ee))-1,Ye=Gt(N-1,ut(Ye,jt-1)),tt=Gt(Ye,ut(0,tt))):(tt=0,Ye=-1);const Sn=er(tt,Ye,ae),{bottom:yn,top:In}=tr(ie,ce,me,Sn),Tn=Zn(N/jt),Zr=Tn*pe+(Tn-1)*Ee-yn;return{bottom:yn,itemHeight:pe,items:Sn,itemWidth:Mt,offsetBottom:Zr,offsetTop:In,top:In}})),b),M(w(B,A(N=>N!==null),L(N=>N.length)),R),M(w(de(y,z,b,V),A(([N,_,{items:Y}])=>Y.length>0&&_.height!==0&&N.height!==0),L(([N,_,{items:Y},ce])=>{const{bottom:me,top:ie}=tr(N,ce,_,Y);return[ie,me]}),re(ht)),t);const Se=I(!1);M(w(u,G(Se),L(([N,_])=>_||N!==0)),Se);const Fe=ke(w(de(b,R),A(([{items:N}])=>N.length>0),G(Se),A(([[N,_],Y])=>{const ce=N.items[N.items.length-1].index===_-1;return(Y||N.bottom>0&&N.itemHeight>0&&N.offsetBottom===0&&N.items.length===_)&&ce}),L(([[,N]])=>N-1),re())),$e=ke(w(P(b),A(({items:N})=>N.length>0&&N[0].index===0),De(0),re())),Ve=ke(w(P(b),G(ne),A(([{items:N},_])=>N.length>0&&!_),L(([{items:N}])=>({endIndex:N[N.length-1].index,startIndex:N[0].index})),re(Tr),_e(0)));M(Ve,v.scrollSeekRangeChanged),M(w(S,G(y,z,R,V),L(([N,_,Y,ce,me])=>{const ie=Er(N),{align:ae,behavior:fe,offset:ue}=ie;let X=ie.index;X==="LAST"&&(X=ce-1),X=ut(0,X,Gt(ce-1,X));let te=sn(_,me,Y,X);return ae==="end"?te=Xn(te-_.height+Y.height):ae==="center"&&(te=Xn(te-_.height/2+Y.height/2)),ue&&(te+=ue),{behavior:fe,top:te}})),c);const Me=we(w(b,L(N=>N.offsetBottom+N.bottom)),0);return M(w(H,L(N=>({height:N.visibleHeight,width:N.visibleWidth}))),y),{customScrollParent:g,data:B,deviation:D,footerHeight:o,gap:V,headerHeight:l,increaseViewportBy:e,initialItemCount:d,itemDimensions:z,overscan:n,restoreStateFrom:Z,scrollBy:i,scrollContainerState:a,scrollHeight:C,scrollTo:c,scrollToIndex:S,scrollTop:u,smoothScrollTargetReached:f,totalCount:R,useWindowScroll:m,viewportDimensions:y,windowScrollContainerState:h,windowScrollTo:j,windowViewportRect:H,...v,gridState:b,horizontalDirection:Re,initialTopMostItemIndex:je,totalListHeight:Me,...x,endReached:Fe,propsReady:k,rangeChanged:Ve,startReached:$e,stateChanged:Q,stateRestoreInProgress:ne,...E}},se(xn,Ie,wt,Fr,Ke,pn,Ue));function Ur(e,t,n){return ut(1,Ht((e+n)/(Ht(t)+n)))}function tr(e,t,n,s){const{height:o}=n;if(o===void 0||s.length===0)return{bottom:0,top:0};const l=sn(e,t,n,s[0].index);return{bottom:sn(e,t,n,s[s.length-1].index)+o,top:l}}function sn(e,t,n,s){const o=Ur(e.width,n.width,t.column),l=Ht(s/o),i=l*n.height+ut(0,l-1)*t.row;return i>0?i+t.row:i}const tl=$(()=>{const e=I(p=>`Item ${p}`),t=I({}),n=I(null),s=I("virtuoso-grid-item"),o=I("virtuoso-grid-list"),l=I(bn),i=I("div"),a=I(lt),c=(p,x=null)=>we(w(t,L(v=>v[p]),re()),x),u=I(!1),f=I(!1);return M(P(f),u),{components:t,computeItemKey:l,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:s,ItemComponent:c("Item","div"),itemContent:e,listClassName:o,ListComponent:c("List","div"),readyStateChanged:u,reportReadyState:f,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),nl=$(([e,t])=>({...e,...t}),se(el,tl)),rl=F.memo(function(){const e=oe("gridState"),t=oe("listClassName"),n=oe("itemClassName"),s=oe("itemContent"),o=oe("computeItemKey"),l=oe("isSeeking"),i=Le("scrollHeight"),a=oe("ItemComponent"),c=oe("ListComponent"),u=oe("ScrollSeekPlaceholder"),f=oe("context"),p=Le("itemDimensions"),x=Le("gap"),v=oe("log"),T=oe("stateRestoreInProgress"),k=Le("reportReadyState"),g=Xe(F.useMemo(()=>m=>{const h=m.parentElement.parentElement.scrollHeight;i(h);const j=m.firstChild;if(j){const{height:H,width:E}=j.getBoundingClientRect();p({height:H,width:E})}x({column:nr("column-gap",getComputedStyle(m).columnGap,v),row:nr("row-gap",getComputedStyle(m).rowGap,v)})},[i,p,x,v]),!0,!1);return _r(()=>{e.itemHeight>0&&e.itemWidth>0&&k(!0)},[e]),T?null:r.jsx(c,{className:t,ref:g,...be(c,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(m=>{const h=o(m.index,m.data,f);return l?r.jsx(u,{...be(u,f),height:e.itemHeight,index:m.index,width:e.itemWidth},h):O.createElement(a,{...be(a,f),className:n,"data-index":m.index,key:h},s(m.index,m.data,f))})})}),sl=F.memo(function(){const e=oe("HeaderComponent"),t=Le("headerHeight"),n=oe("headerFooterTag"),s=Xe(F.useMemo(()=>l=>{t(Ge(l,"height"))},[t]),!0,!1),o=oe("context");return e?r.jsx(n,{ref:s,children:r.jsx(e,{...be(e,o)})}):null}),ol=F.memo(function(){const e=oe("FooterComponent"),t=Le("footerHeight"),n=oe("headerFooterTag"),s=Xe(F.useMemo(()=>l=>{t(Ge(l,"height"))},[t]),!0,!1),o=oe("context");return e?r.jsx(n,{ref:s,children:r.jsx(e,{...be(e,o)})}):null}),ll=({children:e})=>{const t=F.useContext(Wr),n=Le("itemDimensions"),s=Le("viewportDimensions"),o=Xe(F.useMemo(()=>l=>{s(l.getBoundingClientRect())},[s]),!0,!1);return F.useEffect(()=>{t&&(s({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,s,n]),r.jsx("div",{ref:o,style:Ft(!1),children:e})},il=({children:e})=>{const t=F.useContext(Wr),n=Le("windowViewportRect"),s=Le("itemDimensions"),o=oe("customScrollParent"),l=br(n,o,!1);return F.useEffect(()=>{t&&(s({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,s]),r.jsx("div",{ref:l,style:Ft(!1),children:e})},al=F.memo(function({...e}){const t=oe("useWindowScroll"),n=oe("customScrollParent"),s=n||t?ul:cl,o=n||t?il:ll,l=oe("context");return r.jsx(s,{...e,...be(s,l),children:r.jsxs(o,{children:[r.jsx(sl,{}),r.jsx(rl,{}),r.jsx(ol,{})]})})}),{useEmitter:Kr,useEmitterValue:oe,usePublisher:Le}=Pr(nl,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},al),cl=Gr({useEmitter:Kr,useEmitterValue:oe,usePublisher:Le}),ul=Qr({useEmitter:Kr,useEmitterValue:oe,usePublisher:Le});function nr(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Ce.WARN),t==="normal"?0:parseInt(t??"0",10)}function dl(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}async function ml(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function hl({entry:e,isSelected:t,density:n,sourceLabel:s,onSelect:o,indent:l=0,stageHint:i,repeatCount:a}){const[c,u]=O.useState(!1),f=dr(e,s),p=hr(e),x=mr(e,{short:!0}),v=()=>o(e.id),T=g=>{g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),v())},k=async g=>{g.stopPropagation(),!(!e.requestId||!await ml(e.requestId))&&(u(!0),window.setTimeout(()=>u(!1),1200))};return r.jsxs("div",{role:"row",tabIndex:0,"aria-selected":t,"data-selected":t,onClick:v,onKeyDown:T,style:{paddingLeft:12+l},className:K("group flex w-full cursor-pointer items-center gap-3 border-b border-border/50 pr-3 text-left",fr[n],gr,ve,t&&"bg-muted/60 shadow-[inset_2px_0_0_var(--ring)]"),children:[r.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),r.jsx("span",{role:"cell",className:K("w-[88px] shrink-0 truncate text-[12px] text-muted-foreground",Ae),children:dl(e.timestamp)}),r.jsx("span",{role:"cell",className:"flex w-[64px] shrink-0 items-center",children:r.jsx(ln,{level:e.level})}),r.jsx("span",{role:"cell",className:"w-[120px] shrink-0 truncate text-[12px] font-medium text-foreground/80",children:f}),r.jsxs("span",{role:"cell",className:"flex min-w-0 flex-1 items-center gap-2 truncate text-[13px] text-foreground/90",children:[i?r.jsx("span",{className:"inline-flex shrink-0 items-center rounded border border-border bg-muted/30 px-1.5 py-0.5 text-[11px] uppercase tracking-wide text-muted-foreground",children:i}):null,r.jsx("span",{className:"min-w-0 truncate",children:e.message}),a&&a>1?r.jsxs("span",{className:"ml-1 inline-flex shrink-0 items-center rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",title:`${a} consecutive identical entries`,children:["×",a]}):null]}),r.jsx("span",{role:"cell",className:K("hidden w-[64px] shrink-0 truncate text-right text-[12px] text-muted-foreground sm:inline-block",Ae),children:p==="—"?"":p}),r.jsx("span",{role:"cell",className:K("hidden w-[100px] shrink-0 items-center justify-end gap-1 text-right text-[12px] text-muted-foreground/80 lg:inline-flex",Ae),children:e.requestId?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"truncate",children:x}),r.jsx("button",{type:"button","aria-label":c?"Copied requestId":"Copy requestId",title:c?"Copied":"Copy requestId",onClick:k,className:K("inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100",ve,c&&"text-emerald-600 opacity-100"),children:r.jsx(Jt,{className:"h-3 w-3","aria-hidden":"true"})})]}):null})]})}const $r=O.memo(hl,(e,t)=>e.entry.id===t.entry.id&&e.isSelected===t.isSelected&&e.density===t.density&&e.indent===t.indent&&e.stageHint===t.stageHint&&e.sourceLabel===t.sourceLabel&&e.repeatCount===t.repeatCount),rr={debug:0,info:1,warn:2,error:3};function fl(e){return[e.event??"",e.message??"",e.stage??"",e.module??e.source??"",e.level,e.requestId??"",e.source??""].join(" ")}function gl(e){if(e.stage&&e.stage.length>0)return e.stage;if(e.event&&e.event.length>0)return(e.event.split(".").pop()??e.event).slice(0,12)}function xl(e){const t=[],n=new Map;let s=-1,o="";for(const l of e)if(l.requestId){const i=n.get(l.requestId);if(i!==void 0)t[i].children.push(l);else{const a={kind:"trace",requestId:l.requestId,module:l.module??l.source,source:l.source,ts:l.timestamp,maxLevel:l.level,totalLatencyMs:0,children:[l]};t.push(a),n.set(l.requestId,t.length-1)}s=-1,o=""}else{const i=fl(l);if(s>=0&&i===o){const a=t[s];a.repeatCount=(a.repeatCount??1)+1,a.collapsedRange={fromTs:a.collapsedRange?.fromTs??a.entry.timestamp,toTs:l.timestamp}}else{const a={kind:"leaf",entry:l};t.push(a),s=t.length-1,o=i}}for(const l of t)if(l.kind==="trace"){l.children.sort((u,f)=>u.timestamp.localeCompare(f.timestamp));let i="debug",a=0;for(const u of l.children)rr[u.level]>rr[i]&&(i=u.level),typeof u.latencyMs=="number"&&(a+=u.latencyMs);l.maxLevel=i,l.totalLatencyMs=a;const c=l.children[0];c&&(l.ts=c.timestamp)}return t.sort((l,i)=>{const a=l.kind==="trace"?l.ts:l.entry.timestamp;return(i.kind==="trace"?i.ts:i.entry.timestamp).localeCompare(a)})}function pl(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function vl({group:e,isExpanded:t,selectedEntryId:n,density:s,sourceLabel:o,onToggle:l,onSelect:i}){const a=t?ur:xs;return r.jsxs("div",{role:"rowgroup",className:"border-b border-border/50",children:[r.jsxs("button",{type:"button",role:"row","aria-expanded":t,onClick:()=>l(e.requestId),className:K("flex w-full items-center gap-3 pl-3 pr-3 text-left",fr[s],gr,ve),children:[r.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center","aria-hidden":"true",children:r.jsx(a,{className:"h-3.5 w-3.5 text-muted-foreground"})}),r.jsx("span",{role:"cell",className:K("w-[88px] shrink-0 truncate text-[12px] text-muted-foreground",Ae),children:pl(e.ts)}),r.jsx("span",{role:"cell",className:"flex w-[64px] shrink-0 items-center",children:r.jsx(ln,{level:e.maxLevel})}),r.jsxs("span",{role:"cell",className:"flex w-[120px] shrink-0 items-center gap-1.5 truncate text-[12px] font-medium text-foreground/80",children:[r.jsx(cr,{className:"h-3 w-3 text-muted-foreground","aria-hidden":"true"}),e.module]}),r.jsx("span",{role:"cell",className:"min-w-0 flex-1 truncate text-[13px] text-foreground/90",children:r.jsxs("span",{className:"text-muted-foreground",children:["trace · ",e.children.length," stages"]})}),r.jsx("span",{role:"cell",className:K("hidden w-[64px] shrink-0 truncate text-right text-[12px] text-muted-foreground sm:inline-block",Ae),children:e.totalLatencyMs>0?`${e.totalLatencyMs}ms`:""}),r.jsx("span",{role:"cell",className:K("hidden w-[100px] shrink-0 truncate text-right text-[12px] text-muted-foreground lg:inline-block",Ae),children:e.requestId.slice(-8)})]}),t?e.children.map(c=>r.jsx($r,{entry:c,isSelected:c.id===n,density:s,sourceLabel:o,onSelect:i,indent:20,stageHint:gl(c)},c.id)):null]})}const bl=O.memo(vl),wl="grid grid-cols-[16px_88px_64px_120px_minmax(0,1fr)_64px_100px] items-center gap-3 px-3";function jl({entries:e,selectedEntryId:t,onSelect:n,sourceLabels:s,isLoading:o,isFetching:l,liveTailSlot:i,density:a="cozy"}){const c=O.useMemo(()=>xl(e),[e]),[u,f]=O.useState(new Set),[p,x]=O.useState(new Set),v=O.useMemo(()=>{if(!t)return null;const m=c.find(h=>h.kind==="trace"&&h.children.some(j=>j.id===t));return m&&m.kind==="trace"?m.requestId:null},[c,t]),T=O.useCallback(m=>{const h=v===m,j=u.has(m),H=p.has(m);j||h&&!H?(f(R=>{if(!R.has(m))return R;const d=new Set(R);return d.delete(m),d}),x(R=>{if(R.has(m))return R;const d=new Set(R);return d.add(m),d})):(f(R=>{if(R.has(m))return R;const d=new Set(R);return d.add(m),d}),x(R=>{if(!R.has(m))return R;const d=new Set(R);return d.delete(m),d}))},[v,u,p]),k=O.useMemo(()=>{const m=new Set(u);return v&&!p.has(v)&&m.add(v),m},[u,p,v]),g=O.useCallback((m,h)=>h.kind==="trace"?r.jsx(bl,{group:h,isExpanded:k.has(h.requestId),selectedEntryId:t,density:a,sourceLabel:s[h.source]??h.source,onToggle:T,onSelect:n}):r.jsx($r,{entry:h.entry,isSelected:h.entry.id===t,density:a,sourceLabel:s[h.entry.source]??h.entry.source,onSelect:n,repeatCount:h.repeatCount}),[a,k,n,t,s,T]);return r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-background",children:[r.jsxs("div",{role:"row",className:K(wl,"h-9 shrink-0 border-b border-border bg-muted/30 text-[12px] font-medium uppercase tracking-wide text-muted-foreground"),children:[r.jsx("span",{role:"columnheader","aria-hidden":"true"}),r.jsx("span",{role:"columnheader",children:"Time"}),r.jsx("span",{role:"columnheader",children:"Level"}),r.jsx("span",{role:"columnheader",children:"Module"}),r.jsx("span",{role:"columnheader",children:"Message"}),r.jsx("span",{role:"columnheader",className:"text-right",children:"Latency"}),r.jsx("span",{role:"columnheader",className:"text-right",children:"Request"})]}),i?r.jsx("div",{className:"flex h-9 shrink-0 items-center justify-between border-b border-border bg-background px-3",children:i}):null,r.jsx("div",{role:"grid",className:"min-h-0 flex-1",children:o?r.jsx("div",{className:"space-y-1 p-2",children:Array.from({length:14}).map((m,h)=>r.jsx("div",{className:"h-9 w-full animate-pulse rounded border border-border/40 bg-muted/30"},h))}):c.length===0?r.jsx(an,{variant:"noResults"}):r.jsx($o,{data:c,itemContent:g,increaseViewportBy:{top:200,bottom:400},followOutput:m=>m?"auto":!1,computeItemKey:(m,h)=>h.kind==="trace"?`t:${h.requestId}`:`l:${h.entry.id}`})})]})}function Sl({error:e,onRetry:t}){const n=e?.message??"Unknown error fetching logs.";return r.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-3 px-6 py-10 text-center",children:[r.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",children:r.jsx(ps,{className:"h-5 w-5","aria-hidden":"true"})}),r.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Could not load logs"}),r.jsx("p",{className:"max-w-sm text-[13px] leading-relaxed text-muted-foreground",children:n}),r.jsxs(ye,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[r.jsx(ir,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Retry"]})]})}function yl(){return!1}const Yr=["logs","config"],Jr=["logs","sources"],Il=150,Tl=1e4,Qt=250;function Ut(e,t){const[n,s]=O.useState(e);return O.useEffect(()=>{const o=window.setTimeout(()=>s(e),t);return()=>window.clearTimeout(o)},[e,t]),n}function Cl(){const[e,t]=O.useState(()=>typeof document>"u"?!0:document.visibilityState!=="hidden");return O.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function Nl(e){switch(e){case"5m":return 5*6e4;case"15m":return 15*6e4;case"1h":return 60*6e4;case"24h":return 1440*6e4;default:return null}}function kl(){const[e,t]=O.useState("all"),[n,s]=O.useState("all"),[o,l]=O.useState(""),[i,a]=O.useState(""),[c,u]=O.useState(""),[f,p]=O.useState(""),[x,v]=O.useState("all"),[T,k]=O.useState(Il),[g,m]=O.useState(null),[h,j]=O.useState(!1),[H,E]=O.useState(!0),R=O.useRef(new Set),d=O.useDeferredValue(o.trim()),b=Ut(i.trim(),Qt),y=Ut(c.trim(),Qt),z=Ut(f.trim(),Qt),S=Cl(),C=At({queryKey:Yr,queryFn:async()=>(await kt.logs.getConfig()).logging,refetchInterval:3e4}),D=At({queryKey:Jr,queryFn:async()=>(await kt.logs.getSources()).sources,refetchInterval:15e3}),B=yl(),Q=At({queryKey:["logs","entries",e,n,d,b,y,z,x,T,H?"hide-internals":"show-internals",B?"mock":"live"],queryFn:async()=>{let N;N=(await kt.logs.getEntries({source:e==="all"?void 0:e,level:n==="all"?void 0:n,search:d||void 0,limit:T})).entries;const _=Nl(x),Y=Date.now(),ce=N.filter(me=>{if(b&&!(me.module??"").includes(b)||y&&(me.stage??"")!==y||z&&!(me.requestId??"").includes(z))return!1;if(_!==null){const ie=Date.parse(me.timestamp);if(Number.isFinite(ie)&&Y-ie>_)return!1}return!(H&&/^web-server:/i.test(me.source))});return ce[0],ce},placeholderData:Rs,refetchInterval:h||!S?!1:Tl,refetchOnWindowFocus:!0}),Z=Q.data,ne=O.useMemo(()=>Z??[],[Z]),je=O.useMemo(()=>{if(!h)return 0;const N=R.current;let _=0;for(const Y of ne)N.has(Y.id)||(_+=1);return _},[ne,h]),ge=O.useCallback(()=>{R.current=new Set(ne.map(N=>N.id)),j(!0)},[ne]),xe=O.useCallback(()=>{R.current=new Set,j(!1),Q.refetch()},[Q]),Re=O.useCallback(()=>{h?xe():ge()},[h,ge,xe]),Se=O.useMemo(()=>ne.length===0?null:g&&ne.some(N=>N.id===g)?g:ne[0]?.id??null,[ne,g]),Fe=O.useMemo(()=>ne.find(N=>N.id===Se)??null,[Se,ne]),$e=!!(g&&!ne.some(N=>N.id===g)),Ve=O.useMemo(()=>(D.data??[]).map(_=>_.lastTimestamp).filter(_=>!!_).sort((_,Y)=>Y.localeCompare(_))[0]??null,[D.data]),Me=O.useCallback(()=>{l(""),s("all"),t("all"),a(""),u(""),p(""),v("all"),E(!0)},[]);return{configQuery:C,sourcesQuery:D,entriesQuery:Q,selectedSource:e,setSelectedSource:t,selectedLevel:n,setSelectedLevel:s,search:o,setSearch:l,moduleFilter:i,setModuleFilter:a,stageFilter:c,setStageFilter:u,requestIdFilter:f,setRequestIdFilter:p,timeWindow:x,setTimeWindow:v,hideDashboardInternals:H,setHideDashboardInternals:E,limit:T,setLimit:k,selectedEntryId:Se,setSelectedEntryId:m,selectedEntry:Fe,isSelectionOutOfScope:$e,latestTimestamp:Ve,isInitialLoading:!C.data&&C.isLoading||!D.data&&D.isLoading||!Q.data&&Q.isLoading,liveTail:{isPaused:h,pendingCount:je,pause:ge,resume:xe,togglePause:Re},clearAdvancedFilters:Me}}function Rl(){const e=Ns(),{t}=lr();return ks({mutationFn:n=>kt.logs.updateConfig(n),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Yr}),e.invalidateQueries({queryKey:Jr}),e.invalidateQueries({queryKey:["logs","entries"]})]),On.success(t("toasts.loggingConfigSaved"))},onError:n=>{On.error(n.message||t("toasts.loggingConfigSaveFailed"))}})}function El(){return[{value:"all",label:"All levels"},{value:"error",label:"Errors"},{value:"warn",label:"Warnings"},{value:"info",label:"Info"},{value:"debug",label:"Debug"}]}function zl(){return[{value:"all",label:"All time"},{value:"5m",label:"Last 5m"},{value:"15m",label:"Last 15m"},{value:"1h",label:"Last 1h"},{value:"24h",label:"Last 24h"}]}function Hl(e){return Object.fromEntries(e.map(t=>[t.source,t.label]))}function Ll({label:e,onRemove:t}){return r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[11px] text-foreground/80",children:[e,r.jsx("button",{type:"button",onClick:t,"aria-label":`Remove ${e}`,className:K("rounded-full p-0.5 hover:bg-muted",ve),children:r.jsx(bs,{className:"h-3 w-3","aria-hidden":"true"})})]})}function Ol({sources:e,selectedSource:t,onSourceChange:n,selectedLevel:s,onLevelChange:o,search:l,onSearchChange:i,limit:a,onLimitChange:c,onRefresh:u,isRefreshing:f,moduleFilter:p="",onModuleChange:x,stageFilter:v="",onStageChange:T,requestIdFilter:k="",onRequestIdChange:g,timeWindow:m="all",onTimeWindowChange:h,hideDashboardInternals:j=!0,onHideDashboardInternalsChange:H,onClearAll:E}){const[R,d]=O.useState(!1),b=El(),y=[50,100,150,250],z=zl(),S=[];if(s!=="all"&&S.push({key:"level",label:`level: ${s}`,clear:()=>o("all")}),t!=="all"){const C=e.find(D=>D.source===t)?.label??t;S.push({key:"source",label:`source: ${C}`,clear:()=>n("all")})}return l.trim()&&S.push({key:"search",label:`search: ${l}`,clear:()=>i("")}),p&&S.push({key:"module",label:`module: ${p}`,clear:()=>x?.("")}),v&&S.push({key:"stage",label:`stage: ${v}`,clear:()=>T?.("")}),k&&S.push({key:"requestId",label:`requestId: ${k}`,clear:()=>g?.("")}),m!=="all"&&S.push({key:"timeWindow",label:`time: ${m}`,clear:()=>h?.("all")}),r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-search",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Search"}),r.jsxs("div",{className:"relative",children:[r.jsx(vs,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"}),r.jsx(nt,{id:"logs-search",value:l,onChange:C=>i(C.target.value),placeholder:"Search message, event, module",className:"h-9 pl-8"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-level",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Level"}),r.jsxs(It,{value:s,onValueChange:C=>o(C),children:[r.jsx(Tt,{id:"logs-level",className:"h-9",children:r.jsx(Ct,{})}),r.jsx(Nt,{children:b.map(C=>r.jsx(qe,{value:C.value,children:C.label},C.value))})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{htmlFor:"logs-source",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Source"}),r.jsxs(It,{value:t,onValueChange:C=>n(C),children:[r.jsx(Tt,{id:"logs-source",className:"h-9",children:r.jsx(Ct,{})}),r.jsxs(Nt,{children:[r.jsx(qe,{value:"all",children:"All sources"}),e.map(C=>r.jsx(qe,{value:C.source,children:C.label},C.source))]})]})]})]}),r.jsxs(ts,{open:R,onOpenChange:d,children:[r.jsx(ns,{asChild:!0,children:r.jsxs(ye,{variant:"ghost",size:"sm",className:K("h-7 w-full justify-between px-2 text-xs font-medium",ve),"aria-expanded":R,children:["Advanced filters",r.jsx(ur,{className:K("h-3.5 w-3.5 transition-transform",R&&"rotate-180"),"aria-hidden":"true"})]})}),r.jsxs(rs,{className:"mt-2 space-y-2",children:[x?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Te,{htmlFor:"logs-module",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Module"}),r.jsx(nt,{id:"logs-module",value:p,onChange:C=>x(C.target.value),placeholder:"e.g. cliproxy.router",className:"h-9"})]}):null,T?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Te,{htmlFor:"logs-stage",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Stage"}),r.jsx(nt,{id:"logs-stage",value:v,onChange:C=>T(C.target.value),placeholder:"e.g. handler",className:"h-9"})]}):null,g?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Te,{htmlFor:"logs-request-id",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Request ID"}),r.jsx(nt,{id:"logs-request-id",value:k,onChange:C=>g(C.target.value),placeholder:"req_…",className:"h-9 font-mono"})]}):null,h?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Te,{htmlFor:"logs-time-window",className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Time window"}),r.jsxs(It,{value:m,onValueChange:C=>h(C),children:[r.jsx(Tt,{id:"logs-time-window",className:"h-9",children:r.jsx(Ct,{})}),r.jsx(Nt,{children:z.map(C=>r.jsx(qe,{value:C.value,children:C.label},C.value))})]})]}):null,H?r.jsxs("div",{className:"flex items-start justify-between gap-3 rounded border border-border/60 bg-muted/20 p-2",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Te,{htmlFor:"logs-hide-internals",className:"block text-[12px] font-medium text-foreground",children:"Hide dashboard internals"}),r.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Suppress ",r.jsx("code",{className:"rounded bg-background px-1",children:"web-server:*"})," ","self-polling."]})]}),r.jsx("input",{id:"logs-hide-internals",type:"checkbox",role:"switch",checked:j,onChange:C=>H(C.target.checked),className:K("mt-0.5 h-4 w-4 cursor-pointer accent-foreground",ve),"aria-label":"Hide dashboard internals"})]}):null]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Te,{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Visible entries"}),r.jsx("div",{className:"grid grid-cols-4 gap-1",children:y.map(C=>r.jsx(ye,{type:"button",variant:a===C?"default":"outline",size:"sm",className:"h-8 text-xs",onClick:()=>c(C),children:C},C))})]}),S.length>0?r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-border pt-3",children:[r.jsx("span",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Active:"}),S.map(C=>r.jsx(Ll,{label:C.label,onRemove:C.clear},C.key)),E?r.jsx(ye,{variant:"ghost",size:"sm",onClick:E,className:"h-7 px-2 text-[11px] text-muted-foreground",children:"Clear all"}):null]}):null]})}function Bl({isFetching:e,hasError:t,capturedCount:n,stats:s,onRefresh:o,onOpenSettings:l,onOpenShortcuts:i}){const a=t?"error":e?"syncing":"live",c=a==="error"?"Disconnected":a==="syncing"?"Syncing":"Live",u=a==="error"?"bg-red-500":a==="syncing"?"bg-amber-500":"bg-emerald-500";return r.jsxs("div",{className:"shrink-0 border-b border-border bg-background",children:[r.jsxs("div",{className:"flex h-14 items-center justify-between gap-4 px-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ws,{className:"h-4 w-4 text-foreground/70","aria-hidden":"true"}),r.jsx("span",{className:"text-[11px] font-mono uppercase tracking-[0.18em] text-muted-foreground",children:"LOGS.STREAM"}),r.jsx("h1",{className:"text-base font-semibold tracking-tight text-foreground",children:"Live activity"}),r.jsxs("span",{role:"status","aria-live":"polite",className:"ml-2 inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/40 px-2.5 py-0.5 text-[12px] font-medium text-foreground/80",children:[r.jsx("span",{className:K("h-1.5 w-1.5 rounded-full",u),"aria-hidden":"true"}),c]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsxs(ye,{variant:"ghost",size:"sm",onClick:o,"aria-label":"Refresh logs",className:K("h-8 gap-2 px-2.5 text-xs font-medium",ve),children:[r.jsx(js,{className:K("h-3.5 w-3.5",e&&"animate-spin"),"aria-hidden":"true"}),"Refresh"]}),r.jsx(ye,{variant:"ghost",size:"icon",onClick:i,"aria-label":"Show keyboard shortcuts",title:"Keyboard shortcuts (?)",className:K("h-8 w-8",ve),children:r.jsx(Ss,{className:"h-4 w-4","aria-hidden":"true"})}),r.jsx(ye,{variant:"ghost",size:"icon",onClick:l,"aria-label":"Open logging settings",className:K("h-8 w-8",ve),children:r.jsx(ys,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),r.jsxs("div",{className:"flex items-center gap-6 border-t border-border/60 bg-muted/20 px-4 py-2",children:[r.jsx(Kt,{label:"Entries",value:n,fallback:`${n}`}),s?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{label:"Traces",value:s.traces,fallback:`${s.traces}`}),r.jsx(Kt,{label:"Errors",value:s.errors,fallback:`${s.errors}`,tone:s.errors>0?"error":"neutral"})]}):null]})]})}function Kt({label:e,value:t,fallback:n,tone:s="neutral"}){return r.jsxs("div",{className:"flex items-baseline gap-2",children:[r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.14em] text-muted-foreground",children:e}),r.jsx("span",{className:K("text-[14px] font-semibold tabular-nums",s==="error"?"text-red-600 dark:text-red-400":"text-foreground",Ae),title:String(t),children:n})]})}function Fl({isPaused:e,pendingCount:t,onTogglePause:n,onJumpToBottom:s}){return r.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(ye,{variant:"ghost",size:"sm","aria-pressed":e,onClick:n,className:K("h-7 gap-1.5 px-2 text-xs font-medium",ve),children:[e?r.jsx(Is,{className:"h-3.5 w-3.5","aria-hidden":"true"}):r.jsx(Ts,{className:"h-3.5 w-3.5","aria-hidden":"true"}),e?"Resume tail":"Pause tail"]}),e&&t>0?r.jsxs("button",{type:"button",onClick:n,"aria-live":"polite",className:K("inline-flex h-7 items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 text-[11px] font-medium text-amber-700 dark:text-amber-300",ve),children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500","aria-hidden":"true"}),t," new ",t===1?"entry":"entries"," · click to resume"]}):null]}),s?r.jsxs(ye,{variant:"ghost",size:"sm",onClick:s,className:K("h-7 gap-1.5 px-2 text-xs",ve),children:[r.jsx(Cs,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Jump to bottom"]}):null]})}const Ml=[{keys:["j","↓"],label:"Next entry"},{keys:["k","↑"],label:"Previous entry"},{keys:["Enter"],label:"Focus detail"},{keys:["Esc"],label:"Close detail (mobile)"},{keys:["/"],label:"Focus search"},{keys:["Space"],label:"Pause / resume tail"},{keys:["?"],label:"Show this help"}];function Dl({children:e}){return r.jsx("kbd",{className:"inline-flex h-5 min-w-[20px] items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-foreground",children:e})}function Pl({open:e,onOpenChange:t}){return r.jsx(ss,{open:e,onOpenChange:t,children:r.jsxs(os,{className:"max-w-md",children:[r.jsxs(ls,{children:[r.jsx(is,{children:"Keyboard shortcuts"}),r.jsx(as,{children:"Logs surface keybindings."})]}),r.jsx("ul",{className:"mt-2 space-y-2",children:Ml.map(n=>r.jsxs("li",{className:"flex items-center justify-between text-sm",children:[r.jsx("span",{className:"text-foreground/90",children:n.label}),r.jsx("span",{className:"flex items-center gap-1",children:n.keys.map(s=>r.jsx(Dl,{children:s},s))})]},n.label))})]})})}function Al(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"?!0:e.isContentEditable}function Wl({entryIds:e,selectedId:t,onSelect:n,onTogglePause:s,onFocusSearch:o,onOpenShortcuts:l,onCloseDetail:i,enabled:a=!0}){O.useEffect(()=>{if(!a)return;const c=u=>{if(!(u.metaKey||u.ctrlKey||u.altKey)){if(u.key==="/"){u.preventDefault(),o();return}if(u.key==="?"){u.preventDefault(),l();return}if(!Al(u.target)){if(u.key==="Escape"&&i){i();return}if(u.key===" "){u.preventDefault(),s();return}if(u.key==="j"||u.key==="ArrowDown"){if(u.preventDefault(),e.length===0)return;const f=t?e.indexOf(t):-1,p=e[Math.min(f+1,e.length-1)]??e[0];p&&n(p);return}if(u.key==="k"||u.key==="ArrowUp"){if(u.preventDefault(),e.length===0)return;const f=t?e.indexOf(t):0,p=e[Math.max(f-1,0)]??e[0];p&&n(p);return}}}};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a,e,t,n,s,o,l,i])}const on="ccs.logs.layout.v1",$t=1200,Yt={filters:22,list:52,detail:26};function _l(){if(typeof window>"u")return Yt;try{const e=window.localStorage.getItem(on);if(!e)return Yt;const t=JSON.parse(e);if(typeof t.filters=="number"&&typeof t.list=="number"&&typeof t.detail=="number")return{filters:t.filters,list:t.list,detail:t.detail}}catch{}return Yt}function Vl(){const[e,t]=O.useState(()=>typeof window>"u"?!0:window.innerWidth>=$t);return O.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(`(min-width: ${$t}px)`),s=()=>t(window.innerWidth>=$t);return s(),n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function ql({workspace:e,updateConfig:t}){const n=Vl(),s=O.useMemo(()=>Hl(e.sourcesQuery.data??[]),[e.sourcesQuery.data]),[o,l]=O.useState(null),[i,a]=O.useState(_l),[c,u]=O.useState(!1),f=O.useRef(null),p=e.configQuery.data,x=O.useCallback(()=>{Promise.all([e.sourcesQuery.refetch(),e.entriesQuery.refetch()])},[e.entriesQuery,e.sourcesQuery]),v=O.useCallback(S=>{if(S.length!==3)return;const[C,D,B]=S,V={filters:C,list:D,detail:B};a(V);try{window.localStorage.setItem(on,JSON.stringify(V))}catch{}},[]),T=O.useCallback(()=>l("settings"),[]),k=O.useCallback(()=>l("detail"),[]),g=O.useCallback(()=>l(null),[]),m=e.setSelectedEntryId,h=O.useCallback(S=>{m(S),!n&&S&&l("detail")},[m,n]),j=O.useCallback(S=>{e.setRequestIdFilter(S),e.setSearch("")},[e]),H=O.useMemo(()=>(e.entriesQuery.data??[]).map(S=>S.id),[e.entriesQuery.data]),E=O.useMemo(()=>{const S=e.entriesQuery.data??[],C=new Set;let D=0;for(const B of S)B.requestId&&C.add(B.requestId),B.level==="error"&&(D+=1);return{entries:S.length,traces:C.size,errors:D}},[e.entriesQuery.data]),R=O.useCallback(()=>{const S=document.getElementById("logs-search");S?(S.focus(),S.select()):f.current&&f.current.focus()},[]);if(Wl({entryIds:H,selectedId:e.selectedEntryId,onSelect:e.setSelectedEntryId,onTogglePause:e.liveTail.togglePause,onFocusSearch:R,onOpenShortcuts:()=>u(!0),onCloseDetail:!n&&o==="detail"?g:void 0}),!p)return null;const d=r.jsx(Ol,{sources:e.sourcesQuery.data??[],selectedSource:e.selectedSource,onSourceChange:e.setSelectedSource,selectedLevel:e.selectedLevel,onLevelChange:e.setSelectedLevel,search:e.search,onSearchChange:e.setSearch,limit:e.limit,onLimitChange:e.setLimit,onRefresh:x,isRefreshing:e.entriesQuery.isFetching||e.sourcesQuery.isFetching,moduleFilter:e.moduleFilter,onModuleChange:e.setModuleFilter,stageFilter:e.stageFilter,onStageChange:e.setStageFilter,requestIdFilter:e.requestIdFilter,onRequestIdChange:e.setRequestIdFilter,timeWindow:e.timeWindow,onTimeWindowChange:e.setTimeWindow,hideDashboardInternals:e.hideDashboardInternals,onHideDashboardInternalsChange:e.setHideDashboardInternals,onClearAll:e.clearAdvancedFilters}),b=r.jsx(Fl,{isPaused:e.liveTail.isPaused,pendingCount:e.liveTail.pendingCount,onTogglePause:e.liveTail.togglePause}),y=e.entriesQuery.error?r.jsx(Sl,{error:e.entriesQuery.error,onRetry:()=>void e.entriesQuery.refetch()}):r.jsx(jl,{entries:e.entriesQuery.data??[],selectedEntryId:e.selectedEntryId,onSelect:h,sourceLabels:s,isLoading:e.entriesQuery.isLoading,isFetching:e.entriesQuery.isFetching,liveTailSlot:b}),z=e.isSelectionOutOfScope?r.jsx(an,{variant:"selectionOutOfScope",onClearFilters:e.clearAdvancedFilters}):r.jsx(Ms,{entry:e.selectedEntry,sourceLabel:e.selectedEntry?s[e.selectedEntry.source]:void 0,onShowTrace:j,redact:!!p.redact});return r.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background text-foreground",children:[r.jsx(Bl,{isFetching:e.entriesQuery.isFetching||e.sourcesQuery.isFetching,hasError:!!e.entriesQuery.error,capturedCount:e.entriesQuery.data?.length??0,stats:E,onRefresh:x,onOpenSettings:T,onOpenShortcuts:()=>u(!0)}),r.jsxs(sr,{defaultValue:"stream",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[r.jsx("div",{className:"flex h-10 shrink-0 items-center border-b border-border bg-background px-4",children:r.jsxs(or,{className:"h-8 bg-muted/40",children:[r.jsx(it,{value:"stream",className:"text-xs",children:"Stream"}),r.jsx(it,{value:"errors",className:"text-xs",children:"Upstream errors"})]})}),r.jsx(at,{value:"stream",className:"m-0 flex min-h-0 flex-1 overflow-hidden focus-visible:outline-none",children:n?r.jsxs(cs,{direction:"horizontal",onLayout:v,className:"flex min-h-0 flex-1",autoSaveId:on,children:[r.jsx(Pt,{defaultSize:i.filters,minSize:16,maxSize:36,order:1,children:r.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto border-r border-border bg-background p-4",children:d})}),r.jsx(kn,{className:"w-px bg-border transition-colors hover:bg-foreground/20 data-[resize-handle-active]:bg-foreground/30"}),r.jsx(Pt,{defaultSize:i.list,minSize:32,order:2,children:r.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:y})}),r.jsx(kn,{className:"w-px bg-border transition-colors hover:bg-foreground/20 data-[resize-handle-active]:bg-foreground/30"}),r.jsx(Pt,{defaultSize:i.detail,minSize:20,maxSize:42,order:3,children:r.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden border-l border-border bg-background",children:z})})]}):r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx("div",{className:"border-b border-border p-3",children:d}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:y})]})}),r.jsx(at,{value:"errors",className:"m-0 flex-1 overflow-y-auto p-4 focus-visible:outline-none",children:r.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[r.jsxs("header",{className:"space-y-1",children:[r.jsx("h2",{className:"text-base font-semibold text-foreground",children:"CLIProxy upstream errors"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Historical failure stream from the upstream proxy. Distinct from the structured stream."})]}),r.jsx(us,{})]})})]}),r.jsx(Rn,{open:o==="settings",onOpenChange:S=>S?T():g(),children:r.jsxs(En,{side:"right",className:"w-full max-w-md",children:[r.jsxs(zn,{children:[r.jsx(Hn,{children:"Logging settings"}),r.jsx(Ln,{children:"Configure retention, redaction, and sampling for the logs surface."})]}),r.jsx("div",{className:"mt-4 px-4 pb-6",children:r.jsx(Es,{config:p,onSave:S=>t.mutate(S),isPending:t.isPending})})]})}),r.jsx(Pl,{open:c,onOpenChange:u}),n?null:r.jsx(Rn,{open:o==="detail",onOpenChange:S=>S?k():g(),children:r.jsxs(En,{side:"bottom",className:"h-[85vh]",children:[r.jsxs(zn,{children:[r.jsx(Hn,{children:"Entry detail"}),r.jsx(Ln,{children:"Selected log entry context and raw payload."})]}),r.jsx("div",{className:"mt-2 flex min-h-0 flex-1 overflow-hidden",children:z})]})})]})}function Gl(){const{t:e}=lr();return r.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background","aria-busy":"true","aria-live":"polite","aria-label":e("logsPageSkeleton.loadingLogs"),children:[r.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4",children:[r.jsx(ze,{className:"h-4 w-24"}),r.jsx(ze,{className:"h-6 w-28"})]}),r.jsx("div",{className:"flex h-10 items-center border-b border-border px-4",children:r.jsx(ze,{className:"h-6 w-40"})}),r.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[22%_52%_26%] gap-px bg-border",children:[r.jsxs("div",{className:"space-y-3 bg-background p-4",children:[r.jsx(ze,{className:"h-8 w-full"}),r.jsx(ze,{className:"h-8 w-full"}),r.jsx(ze,{className:"h-8 w-full"}),r.jsx(ze,{className:"h-32 w-full"})]}),r.jsx("div",{className:"space-y-2 bg-background p-3",children:Array.from({length:12}).map((t,n)=>r.jsx(ze,{className:"h-8 w-full"},n))}),r.jsxs("div",{className:"space-y-3 bg-background p-4",children:[r.jsx(ze,{className:"h-6 w-32"}),r.jsx(ze,{className:"h-4 w-full"}),r.jsx(ze,{className:"h-4 w-3/4"}),r.jsx(ze,{className:"h-40 w-full"})]})]})]})}function ti(){const e=kl(),t=Rl();return e.isInitialLoading?r.jsx(Gl,{}):e.configQuery.data?r.jsx(ql,{workspace:e,updateConfig:t}):null}export{ti as LogsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{g as Ie,r as b}from"./react-vendor-Bjx91N7w.js";import{bG as Ce,bH as Ae,bI as ke,bJ as Le,bK as q,bL as ie,bM as M,bN as Fe,bO as Ue,a as pe,c as I,B as U,d as Z,bC as Ge,aZ as Me,bP as Be,bQ as qe,bR as ze,bS as He,bT as Ke,bU as Ze,bV as Qe,bW as Ye,bX as Xe,aM as Je,M as et,O as tt,r as st,s as nt,t as rt,v as at,w as it,T as ot,p as lt,q as ct,Y as ut}from"./index-BRZp_Csi.js";import{A as dt,a as mt,b as xt,c as pt,d as gt,e as ft,f as ht,g as bt}from"./alert-dialog-DC1l1GRX.js";import{u as Ee,a as yt,b as jt,h as vt}from"./tanstack-bhJxV1h8.js";import{t as oe}from"./notifications-B4_o8bcr.js";import{bf as ye,R as K,t as Nt,s as St,u as wt,A as Ct,bg as At,bh as kt,bi as Et,X as Tt,e as Pt,bj as Vt,bk as $t,U as Ot,v as Rt,m as Dt,w as Wt,aF as _t,T as le,aP as It}from"./icons-DzKUh8vG.js";var ce,je;function Lt(){return je||(je=1,ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ce}var Ft=Lt();const Ut=Ie(Ft);var Gt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ve(t){var s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(s.name=n[1],(Ut[n[1]]||t.charAt(t.length-2)==="/")&&(s.voidElement=!0),s.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var a=new RegExp(Gt),i=null;(i=a.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),u=[o,""];o.indexOf("=")>-1&&(u=o.split("=")),s.attrs[u[0]]=u[1],a.lastIndex--}else i[2]&&(s.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return s}var Mt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,qt=Object.create(null);function Te(t,s){switch(s.type){case"text":return t+s.content;case"tag":return t+="<"+s.name+(s.attrs?(function(n){var r=[];for(var a in n)r.push(a+'="'+n[a]+'"');return r.length?" "+r.join(" "):""})(s.attrs):"")+(s.voidElement?"/>":">"),s.voidElement?t:t+s.children.reduce(Te,"")+"</"+s.name+">";case"comment":return t+"<!--"+s.comment+"-->"}}var zt={parse:function(t,s){s||(s={}),s.components||(s.components=qt);var n,r=[],a=[],i=-1,o=!1;if(t.indexOf("<")!==0){var u=t.indexOf("<");r.push({type:"text",content:u===-1?t:t.substring(0,u)})}return t.replace(Mt,function(f,l){if(o){if(f!=="</"+n.name+">")return;o=!1}var x,v=f.charAt(1)!=="/",A=f.startsWith("<!--"),m=l+f.length,d=t.charAt(m);if(A){var O=ve(f);return i<0?(r.push(O),r):((x=a[i]).children.push(O),r)}if(v&&(i++,(n=ve(f)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:t.slice(m,t.indexOf("<",m))}),i===0&&r.push(n),(x=a[i-1])&&x.children.push(n),a[i]=n),(!v||n.voidElement)&&(i>-1&&(n.voidElement||n.name===f.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&d!=="<"&&d)){x=i===-1?r:a[i].children;var p=t.indexOf("<",m),P=t.slice(m,p===-1?void 0:p);Bt.test(P)&&(P=" "),(p>-1&&i+x.length>=0||P!==" ")&&x.push({type:"text",content:P})}}),r},stringify:function(t){return t.reduce(function(s,n){return s+Te("",n)},"")}};const ee=(t,s)=>{if(!t)return!1;const n=t.props?.children??t.children;return s?n.length>0:!!n},te=t=>{if(!t)return[];const s=t.props?.children??t.children;return t.props?.i18nIsDynamicList?B(s):s},Ht=t=>Array.isArray(t)&&t.every(b.isValidElement),B=t=>Array.isArray(t)?t:[t],Kt=(t,s)=>{const n={...s};return n.props={...s.props,...t.props},n},Zt=t=>{const s={};if(!t)return s;const n=r=>{B(r).forEach(i=>{q(i)||(ee(i)?n(te(i)):M(i)&&!b.isValidElement(i)&&Object.assign(s,i))})};return n(t),s},Pe=(t,s,n,r)=>{if(!t)return"";let a="";const i=B(t),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((u,f)=>{if(q(u)){a+=`${u}`;return}if(b.isValidElement(u)){const{props:l,type:x}=u,v=Object.keys(l).length,A=o.indexOf(x)>-1,m=l.children;if(!m&&A&&!v){a+=`<${x}/>`;return}if(!m&&(!A||v)||l.i18nIsDynamicList){a+=`<${f}></${f}>`;return}if(A&&v===1&&q(m)){a+=`<${x}>${m}</${x}>`;return}const d=Pe(m,s,n,r);a+=`<${f}>${d}</${f}>`;return}if(u===null){ie(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(M(u)){const{format:l,...x}=u,v=Object.keys(x);if(v.length===1){const A=l?`${v[0]}, ${l}`:v[0];a+=`{{${A}}}`;return}ie(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:u});return}ie(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:u})}),a},Qt=(t,s=[],n={})=>{if(!t)return t;const r=Object.keys(n),a=[...s,...r];let i="",o=0;for(;o<t.length;)if(t[o]==="<"){let u=!1;const f=t.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(f){const l=f[1];(/^\d+$/.test(l)||a.includes(l))&&(u=!0,i+=f[0],o+=f[0].length)}if(!u){const l=t.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(l){const x=l[1];(/^\d+$/.test(x)||a.includes(x))&&(u=!0,i+=l[0],o+=l[0].length)}}u||(i+="<",o+=1)}else i+=t[o],o+=1;return i},Yt=(t,s,n,r,a,i,o)=>{if(n==="")return[];const u=a.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(u.map(y=>`<${y}`).join("|")).test(n);if(!t&&!s&&!f&&!o)return[n];const l=s??{},x=y=>{B(y).forEach(N=>{q(N)||(ee(N)?x(te(N)):M(N)&&!b.isValidElement(N)&&Object.assign(l,N))})};x(t);const v=Qt(n,u,l),A=zt.parse(`<0>${v}</0>`),m={...l,...i},d=(y,k,N)=>{const V=te(y),W=p(V,k.children,N);return Ht(V)&&W.length===0||y.props?.i18nIsDynamicList?V:W},O=(y,k,N,V,W)=>{y.dummy?(y.children=k,N.push(b.cloneElement(y,{key:V},W?void 0:k))):N.push(...b.Children.map([y],h=>{const c="data-i18n-is-dynamic-list",S={key:V,[c]:void 0};return h&&h.props&&Object.keys(h.props).forEach($=>{$==="ref"||$==="children"||$==="i18nIsDynamicList"||$===c||(S[$]=h.props[$])}),b.cloneElement(h,S,W?null:k)}))},p=(y,k,N)=>{const V=B(y);return B(k).reduce((h,c,S)=>{const $=c.children?.[0]?.content&&r.services.interpolator.interpolate(c.children[0].content,m,r.language);if(c.type==="tag"){let T=V[parseInt(c.name,10)];!T&&s&&(T=s[c.name]),N.length===1&&!T&&(T=N[0][c.name]),T||(T={});const R={...c.attrs};o&&Object.keys(R).forEach(E=>{const L=R[E];q(L)&&(R[E]=Fe(L))});const w=Object.keys(R).length!==0?Kt({props:R},T):T,D=b.isValidElement(w),g=D&&ee(c,!0)&&!c.voidElement,C=f&&M(w)&&w.dummy&&!D,_=M(s)&&Object.hasOwnProperty.call(s,c.name);if(q(w)){const E=r.services.interpolator.interpolate(w,m,r.language);h.push(E)}else if(ee(w)||g){const E=d(w,c,N);O(w,E,h,S)}else if(C){const E=p(V,c.children,N);O(w,E,h,S)}else if(Number.isNaN(parseFloat(c.name)))if(_){const E=d(w,c,N);O(w,E,h,S,c.voidElement)}else if(a.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)h.push(b.createElement(c.name,{key:`${c.name}-${S}`}));else{const E=p(V,c.children,N);h.push(b.createElement(c.name,{key:`${c.name}-${S}`},E))}else if(c.voidElement)h.push(`<${c.name} />`);else{const E=p(V,c.children,N);h.push(`<${c.name}>${E}</${c.name}>`)}else if(M(w)&&!D){const E=c.children[0]?$:null;E&&h.push(E)}else O(w,$,h,S,c.children.length!==1||!$)}else if(c.type==="text"){const T=a.transWrapTextNodes,R=typeof a.unescape=="function"?a.unescape:ke().unescape,w=o?R(r.services.interpolator.interpolate(c.content,m,r.language)):r.services.interpolator.interpolate(c.content,m,r.language);T?h.push(b.createElement(T,{key:`${c.name}-${S}`},w)):h.push(w)}return h},[])},P=p([{dummy:!0,children:t||[]}],A,B(t||[]));return te(P[0])},Ve=(t,s,n)=>{const r=t.key||s,a=b.cloneElement(t,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return b.createElement(b.Fragment,null,a)}return b.createElement(i,{key:r})},Xt=(t,s)=>t.map((n,r)=>Ve(n,r,s)),Jt=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:Ve(t[r],r,s)})}),n},es=(t,s,n,r)=>t?Array.isArray(t)?Xt(t,s):M(t)?Jt(t,s):(Ce(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,ts=t=>!M(t)||Array.isArray(t)?!1:Object.keys(t).reduce((s,n)=>s&&Number.isNaN(Number.parseFloat(n)),!0);function ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const d=x||Ae();if(!d)return Ce(d,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const O=v||d.t.bind(d)||(Q=>Q),p={...ke(),...d.options?.react};let P=l||O.ns||d.options?.defaultNS;P=q(P)?[P]:P||["translation"];const{transDefaultProps:y}=p,k=y?.tOptions?{...y.tOptions,...i}:i,N=A??y?.shouldUnescape,V=y?.values?{...y.values,...o}:o,W=y?.components?{...y.components,...f}:f,h=Pe(t,p,d,r),c=u||k?.defaultValue||h||p.transEmptyNodeValue||(typeof r=="function"?Le(r):r),{hashTransKey:S}=p,$=r||(S?S(h||c):h||c);d.options?.interpolation?.defaultVariables?o=V&&Object.keys(V).length>0?{...V,...d.options.interpolation.defaultVariables}:{...d.options.interpolation.defaultVariables}:o=V;const T=Zt(t);T&&typeof T.count=="number"&&s===void 0&&(s=T.count);const R=o||s!==void 0&&!d.options?.interpolation?.alwaysFormat||!t?k.interpolation:{interpolation:{...k.interpolation,prefix:"#$?",suffix:"?$#"}},w={...k,context:a||k.context,count:s,...o,...R,defaultValue:c,ns:P};let D=$?O($,w):c;D===$&&c&&(D=c);const g=es(W,D,d,r);let C=g||t,_=null;ts(g)&&(_=g,C=t);const E=Yt(C,_,D,d,p,w,N),L=n??p.defaultTransParent;return L?b.createElement(L,m,E):E}function Ne({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const{i18n:d,defaultNS:O}=b.useContext(Ue)||{},p=x||d||Ae(),P=v||p?.t.bind(p);return ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:u,components:f,ns:l||P?.ns||O||p?.options?.defaultNS,i18n:p,t:v,shouldUnescape:A,...m})}async function ns(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function rs(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let r="Sync failed";try{const a=await n.json();r=a.error||a.message||r}catch{}throw new Error(r)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function as(){return Ee({queryKey:["cliproxy-sync-status"],queryFn:ns,refetchInterval:3e4,retry:1,staleTime:1e4})}function is(){const t=yt(),{t:s}=pe();return jt({mutationFn:rs,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?oe.info(s("toasts.noProfilesToSync")):oe.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{oe.error(s("toasts.syncFailed",{error:n.message}))}})}function Se(t){return t.replace(/-\d+$/,"").split(".").map(Number)}function xe(t,s){const n=Se(t),r=Se(s);for(let a=0;a<3;a+=1){const i=n[a]||0,o=r[a]||0;if(i>o)return 1;if(i<o)return-1}return 0}function ue(t,s){return xe(t,s)>0}function de(t,s,n){return xe(t,s)>=0&&xe(t,n)<=0}const me={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function we({className:t,compact:s=!1,state:n,sessionAffinityState:r,isLoading:a,isSaving:i,error:o,onApply:u,onApplyAffinity:f}){const{t:l}=pe(),x=n?.strategy??"round-robin",v=r?.enabled??!1,A=r?.ttl??"1h",m=r?.manageable??!0,[d,O]=b.useState(x),[p,P]=b.useState(v),[y,k]=b.useState(A),[N,V]=b.useState(!1),W=n?.source==="live"?"Live CLIProxy":"Saved startup default",h=a||i||!n||d===x,c=N?"Hide details":"Show details",S=a||i||!!o||!m,$=l(m?p?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),T=b.useRef(null),R=b.useRef(!1);b.useEffect(()=>{O(x)},[x]),b.useEffect(()=>{P(v),k(A)},[v,A]),b.useEffect(()=>{if(i||!T.current)return;const g=T.current;g.enabled===v&&g.ttl===A||(P(v),k(A)),T.current=null},[i,v,A]);const w=()=>{if(!m)return;const g=!p,C=y.trim()||"1h";T.current={enabled:g,ttl:C},P(g),f({enabled:g,ttl:C})},D=()=>{if(!m||o)return;if(R.current){R.current=!1;return}const g=y.trim()||"1h";g!==A&&(T.current={enabled:p,ttl:g},f({enabled:p,ttl:g}))};if(s){const g=C=>{O(C),C!==x&&u(C)};return e.jsxs("div",{className:I("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ye,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),i&&e.jsx(K,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:I("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",d==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(me).map(([C,_])=>{const E=d===C;return e.jsx("button",{type:"button",className:I("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",E?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>g(C),disabled:a||i||!!o,title:_.description,children:_.title},C)})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:l("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:m?l("routingGuidance.ttlBadge",{ttl:A}):l("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[m?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:y,onChange:C=>k(C.target.value),onBlur:D,disabled:S}):null,e.jsx("button",{type:"button","aria-label":$,className:I("rounded border px-2 py-1 text-[10px] font-medium transition-colors",m?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,title:r?.message,children:l(m?p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:r.message}):null]})}return e.jsx("section",{className:I("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.routingStrategy")}),e.jsx(U,{variant:"secondary",children:x}),n?e.jsx(U,{variant:"outline",children:W}):null,n?e.jsx(U,{variant:"outline",children:n.target}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(me).map(([g,C])=>{const _=d===g;return e.jsx("button",{type:"button",className:I("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>O(g),disabled:a||i||!!o,children:C.title},g)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>V(g=>!g),children:[N?e.jsx(Nt,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(St,{className:"mr-1 h-3.5 w-3.5"}),c]}),e.jsx(Z,{size:"sm",onClick:()=>u(d),disabled:h||!!o,children:i?"Saving...":`Use ${d}`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:l("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:l("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionAffinity")}),e.jsx(U,{variant:"secondary",children:l(p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),r?.ttl?e.jsx(U,{variant:"outline",children:l("routingGuidance.ttlBadge",{ttl:A})}):null,m?null:e.jsx(U,{variant:"outline",children:l("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:y,onChange:g=>k(g.target.value),onBlur:D,disabled:S}),e.jsx(Z,{type:"button",variant:"outline",onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,"aria-label":$,children:$})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:r.message}):null]}),o?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:o.message}):null,!o&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(me).map(([g,C])=>{const _=x===g;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:C.title}),_?e.jsx(U,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:C.description})]},g)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function os(t){if(!t)return"";const s=new Date(t).getTime(),r=Date.now()-s,a=Math.floor(r/(1e3*60*60)),i=Math.floor(r%(1e3*60*60)/(1e3*60));return a>0?`${a}h ${i}m`:`${i}m`}function ls(t,s){if(!t)return"";const n=Date.now()-t,r=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return r<1?s("proxyStatusWidget.justNow"):r<60?s("proxyStatusWidget.minutesAgo",{count:r}):s("proxyStatusWidget.hoursAgo",{count:a})}function J({icon:t,tooltip:s,onClick:n,disabled:r,isPending:a,className:i,variant:o="ghost"}){return e.jsxs(ot,{children:[e.jsx(lt,{asChild:!0,children:e.jsx(Z,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:I("h-7 w-7 p-0",o==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:n,disabled:r,children:a?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(ct,{side:"bottom",className:"text-xs",children:s})]})}function fs(){const{t}=pe(),{data:s,isLoading:n}=Ge(),{data:r}=Me(),{data:a,isLoading:i}=Be(),{data:o,isLoading:u,error:f}=qe(),l=ze(),{data:x,isLoading:v,error:A}=He(),m=Ke(),d=l.isPending||m.isPending,O=f instanceof Error?f:null,p=Ze(),P=Qe(),y=Ye(),k=Xe(),{data:N}=as(),{mutate:V,isPending:W}=is(),[h,c]=b.useState(!1),[S,$]=b.useState(""),[T,R]=b.useState(!1),[w,D]=b.useState(null),[g,C]=b.useState(null),{data:_}=Ee({queryKey:["cliproxy-server-config"],queryFn:()=>ut.cliproxyServer.get(),staleTime:3e4}),E=vt({mutationKey:["update-backend"]})>0,L=_?.remote,Q=L?.enabled&&L?.host,G=x??(A instanceof Error?{source:"unsupported",target:o?.target??(Q?"remote":"local"),reachable:!1,manageable:!1,message:A.message}:void 0),Y=s?.running??!1,se=p.isPending||P.isPending||y.isPending||k.isPending||E||W,$e=r?.hasUpdate??!1,z=r?.isStable===!1,ge=r?.currentVersion,X=N?.configured??!1,Oe=t(X?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ne=z?r?.maxStableVersion||a?.latestStable:r?.latestVersion,fe=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",H=a?.faultyRange,Re=H&&`${H.min.replace(/-\d+$/,"")}-${H.max.replace(/-\d+$/,"")}`,re=(j,F)=>{D(j),C(F),R(!0)},he=async j=>{if(!j)return;const F=ue(j,fe);if(H!==void 0&&de(j,H.min,H.max)){re(j,"faulty");return}if(F){re(j,"experimental");return}try{const be=await k.mutateAsync({version:j});be.requiresConfirmation&&re(j,be.isFaulty?"faulty":"experimental")}catch{}},De=()=>{w&&k.mutate({version:w,force:!0}),R(!1),D(null),C(null)},We=()=>{R(!1),D(null),C(null)},_e=Q?(()=>{const j=L.protocol||"http",F=L.port||(j==="https"?443:80);return j==="https"&&F===443||j==="http"&&F===80?L.host:`${L.host}:${F}`})():null;return Q?e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(U,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(Ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:_e})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`remote:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`)]}):e.jsx(Je,{delayDuration:300,children:e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors",Y?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:I("w-2 h-2 rounded-full",Y?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):Y?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:W?K:At,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>V(),disabled:!X||se,isPending:W}),e.jsx(J,{icon:kt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>y.mutate(),disabled:se,isPending:y.isPending}),e.jsx(J,{icon:Et,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>P.mutate(),disabled:se,isPending:P.isPending,variant:"destructive-ghost"})]}):null,e.jsx(J,{icon:h?Tt:Pt,tooltip:t(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>c(!h),className:h?"bg-muted":void 0})]})]}),ge&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:I("text-xs font-mono text-muted-foreground",z&&"text-amber-600 dark:text-amber-400"),children:["v",ge]}),($e||z)&&ne&&e.jsxs(U,{variant:"secondary",className:I("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",z?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void he(ne),title:t(z?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[z?e.jsx(Vt,{className:"w-2.5 h-2.5"}):e.jsx($t,{className:"w-2.5 h-2.5"}),ne]})]}),Y&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ot,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Rt,{className:"w-3 h-3"}),os(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[X?e.jsx(Dt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Wt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:I("text-xs",X?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Oe})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`local:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`),e.jsx(et,{open:h,onOpenChange:c,children:e.jsxs(tt,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(st,{value:S,onValueChange:$,disabled:i,children:[e.jsx(nt,{className:"h-8 text-xs flex-1",children:e.jsx(rt,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(at,{children:a?.versions.slice(0,20).map(j=>{const F=a?.maxStableVersion&&ue(j,a.maxStableVersion),ae=a?.faultyRange&&de(j,a.faultyRange.min,a.faultyRange.max);return e.jsx(it,{value:j,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",j,j===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(ae||F)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},j)})})]}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void he(S),disabled:k.isPending||!S,children:[k.isPending?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),S&&a?.maxStableVersion&&ue(S,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:a.maxStableVersion})})]}),S&&a?.faultyRange&&de(S,a.faultyRange.min,a.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:S})})]}),r?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:ls(r.checkedAt,t)})})]})}),!Y&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?e.jsx(K,{className:"w-3 h-3 animate-spin"}):e.jsx(It,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(dt,{open:T,onOpenChange:R,children:e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(pt,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"w-5 h-5 text-amber-500"}),t(g==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(gt,{className:"space-y-2",children:[g==="faulty"?e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:w??"",range:Re||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:w??"",maxStable:fe},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(g==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(ft,{children:[e.jsx(ht,{onClick:We,children:t("proxyStatusWidget.cancel")}),e.jsx(bt,{onClick:De,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{fs as P};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as b}from"./react-vendor-Bjx91N7w.js";import{a as O,bv as fe,bw as je,bx as be,Q as Ne,R as ve,U as Pe,B as g,bi as C,bj as $,bk as S,d as L,I as we,n as z,c as q,C as X,b as Y,bc as ye}from"./index-BRZp_Csi.js";import{e as ke}from"./use-accounts-B6AXtlfF.js";import{a3 as Ce,aa as $e,b9 as Se,b4 as Le,aE as ee,T as M,R as I,F as Me,av as Ie,w as Ee}from"./icons-DzKUh8vG.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";function Ze(){const{t:s}=O(),[o,r]=b.useState("commands"),[t,n]=b.useState(!1),l={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents"),plugins:s("sharedPage.plugins"),settings:s("sharedPage.settings")},[a,m]=b.useState(""),[h,u]=b.useState(null),{data:d,isError:w,error:x,refetch:v}=fe(),{data:N}=ke(),c=d&&!t?Te(d):o,{data:A,isLoading:y,isFetching:te,isError:k,error:ae,refetch:re}=je(c),F=A?.items??[],D=a.trim().toLowerCase(),P=a.trim(),f=b.useMemo(()=>{const i=A?.items??[];return D?i.filter(_=>[_.name,_.description,_.path].some(pe=>pe.toLowerCase().includes(D))):i},[A,D]),p=b.useMemo(()=>f.length===0?null:h?f.find(i=>i.path===h)??f[0]:f[0],[f,h]),ne=c==="settings"&&d?.settings?"settings.json":p?.path??null,{data:j,isLoading:V,isError:W,error:le,refetch:H}=be(c,ne),ie=[{id:"commands",label:l.commands,icon:Ce,count:d?.commands??0},{id:"skills",label:l.skills,icon:$e,count:d?.skills??0},{id:"agents",label:l.agents,icon:Se,count:d?.agents??0},{id:"plugins",label:l.plugins,icon:Le,count:d?.plugins??0},{id:"settings",label:l.settings,icon:ee,count:d?.settings?1:0}],ce=d?.total??0,K=d?.settings?1:0,B=c==="settings"?K:F.length,R=c==="settings"?K:f.length,Z=c==="settings"||!y&&!k,de=s(c==="plugins"?"sharedPage.registryDetail":c==="settings"?"sharedPage.maskedSettingsDetail":"sharedPage.markdownDetail"),oe=c==="plugins"?s("sharedPage.noPluginsFound"):s("sharedPage.noSharedFound",{tab:c}),me=!y&&!k&&F.length===0,he=!y&&!k&&F.length>0&&f.length===0,ue=N?.accounts.filter(i=>(i.shared_resource_mode||"shared")==="shared")??[],G=N?.accounts.filter(i=>i.shared_resource_mode==="profile-local")??[],xe=Q(x,"Shared item totals could not be loaded. Listing still works."),ge=Q(ae,`Unable to fetch shared ${c}. Please try again.`),J=Q(le,`Unable to load content for ${p?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-auto lg:overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(Ne,{value:c,onValueChange:i=>{n(!0),r(i),m(""),u(null)},children:e.jsx(ve,{className:"h-auto flex-wrap justify-start",children:ie.map(i=>e.jsxs(Pe,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(U,{label:s("sharedPage.totalShared"),value:ce}),e.jsx(U,{label:l[c],value:B}),e.jsx(U,{label:s("sharedPage.visible"),value:R})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(g,{variant:"secondary",children:de}),P?e.jsxs(g,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",P]}):null]})]})]}),d&&!d.symlinkStatus.valid&&e.jsxs(C,{variant:"warning",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx($,{children:s("sharedPage.configurationRequired")}),e.jsxs(S,{children:[d.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),w&&e.jsxs(C,{variant:"info",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx($,{children:s("sharedPage.countsUnavailable")}),e.jsxs(S,{children:[e.jsx("p",{children:xe}),e.jsx("div",{className:"mt-3",children:e.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{v()},children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]}),N?e.jsx(Ae,{sharedCount:ue.length,profileLocalCount:G.length,profileLocalNames:G.map(i=>i.name)}):null]}),e.jsx("div",{className:"px-6 pb-6 lg:flex-1 lg:min-h-0",children:e.jsx("div",{className:"rounded-lg border overflow-hidden bg-background lg:h-full",children:e.jsxs("div",{className:"grid lg:h-full lg:min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30 lg:min-h-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Me,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:l[c]})]}),Z&&e.jsxs(g,{variant:"outline",className:"text-[10px] h-5",children:[R,"/",B]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ie,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(we,{value:a,onChange:i=>m(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:c}),"aria-label":s("sharedPage.filterPlaceholder",{tab:c}),className:"pl-8 h-9"})]}),Z&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:R,total:B,tab:c}),P?s("sharedPage.showingQuery",{query:P}):"",te?s("sharedPage.refreshing"):""]})]}),e.jsx(z,{className:"max-h-[360px] lg:max-h-none lg:flex-1 lg:min-h-0",children:c==="settings"?e.jsx("div",{className:"p-2 space-y-1",children:e.jsxs("button",{type:"button",onClick:()=>u("settings.json"),className:q("w-full text-left p-3 rounded-md border transition-colors",d?.settings?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent opacity-50"),disabled:!d?.settings,children:[e.jsx("p",{className:"text-sm font-medium truncate",children:"settings.json"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:s("sharedPage.settingsDescription")}),e.jsx(g,{variant:d?.settings?"default":"secondary",className:"mt-2 text-[10px]",children:d?.settings?s("sharedPage.settingsActive"):s("sharedPage.settingsInactive")})]})}):y?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:c})}):k?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(Ee,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:c})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ge})]}),e.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{re()},children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):me?e.jsx("div",{className:"p-4 text-sm text-muted-foreground leading-relaxed",children:oe}):he?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:c,query:P})}):e.jsx("div",{className:"p-2 space-y-1",children:f.map(i=>e.jsxs("button",{type:"button",onClick:()=>u(i.path),className:q("w-full text-left p-3 rounded-md border transition-colors",p?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:se(i.path)})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-[360px] flex flex-col bg-muted/20 lg:min-h-0",children:!p&&c!=="settings"?e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:c.slice(0,-1)})}):c==="settings"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:"settings.json"}),e.jsx(g,{variant:"outline",className:"uppercase text-[10px]",children:s("sharedPage.settings")})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(E,{label:s("sharedPage.settingsTitle"),value:s("sharedPage.settingsDescription")}),j?.contentPath?e.jsx(E,{label:s("sharedPage.resolvedSource"),value:j.contentPath,mono:!0}):null]})}),e.jsx(X,{className:"min-h-0 flex-1",children:e.jsx(Y,{className:"p-0 h-full",children:e.jsx(z,{className:"h-full px-5 py-4",children:d?.settings?V?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingSettings")}):W?e.jsxs(C,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx($,{children:s("sharedPage.failedLoadContent")}),e.jsxs(S,{children:[e.jsx("p",{children:J}),e.jsx("div",{className:"mt-3",children:e.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{H()},children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(ye,{value:j?.content??"",onChange:()=>{},language:"json",readonly:!0,minHeight:"320px"}):e.jsxs("div",{className:"min-h-[260px] flex flex-col items-center justify-center text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-muted-foreground/40 mb-4"}),e.jsx("h3",{className:"text-lg font-semibold",children:s("sharedPage.settingsTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mt-2",children:s("sharedPage.settingsDescription")}),e.jsx("div",{className:"mt-6 p-3 rounded-md bg-muted/50 border font-mono text-xs",children:s("sharedPage.settingsInactive")})]})})})})]})]}):p?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:p.name}),e.jsx(g,{variant:"outline",className:"uppercase text-[10px]",children:p.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(E,{label:s("sharedPage.pathLabel"),value:se(p.path),mono:!0}),j?.contentPath&&j.contentPath!==p.path&&e.jsx(E,{label:s("sharedPage.resolvedSource"),value:j.contentPath,mono:!0})]})}),e.jsx(X,{className:"min-h-0 flex-1",children:e.jsx(Y,{className:"p-0 h-full",children:e.jsx(z,{className:"h-full px-5 py-4",children:V?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):W?e.jsxs(C,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(M,{className:"h-4 w-4"}),e.jsx($,{children:s("sharedPage.failedLoadContent")}),e.jsxs(S,{children:[e.jsx("p",{children:J}),e.jsx("div",{className:"mt-3",children:e.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{H()},children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(Fe,{content:j?.content??""})})})})]})]}):null})]})})})]})}function Te(s){return s.commands>0?"commands":s.skills>0?"skills":s.agents>0?"agents":s.plugins>0?"plugins":s.settings?"settings":"commands"}function Ae({sharedCount:s,profileLocalCount:o,profileLocalNames:r}){const{t}=O(),n=r.slice(0,4),l=Math.max(r.length-n.length,0);return e.jsx("div",{className:"rounded-md border bg-muted/25 px-4 py-3",children:e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold",children:t("sharedPage.resourcePolicies")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("sharedPage.resourcePoliciesDescription")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(g,{variant:"outline",className:"border-emerald-300/60 bg-emerald-50/50 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/20 dark:text-emerald-300",children:t("sharedPage.sharedAccounts",{count:s})}),e.jsx(g,{variant:"secondary",children:t("sharedPage.profileLocalAccounts",{count:o})}),n.map(a=>e.jsx(g,{variant:"outline",className:"font-mono text-[10px]",children:a},a)),l>0?e.jsx(g,{variant:"outline",className:"text-[10px]",children:t("sharedPage.moreProfileLocalAccounts",{count:l})}):null]})]})})}function U({label:s,value:o}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:o})]})}function E({label:s,value:o,mono:r=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:q("text-xs mt-1 break-words",r?"font-mono":"text-sm"),children:o})]})}function Q(s,o){if(!(s instanceof Error))return o;const r=s.message.toLowerCase();return r.includes("failed to fetch")||r.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||o}function se(s){return s.startsWith("plugin-registry:")?"installed_plugins.json":s}function Fe({content:s}){const{t:o}=O(),r=b.useMemo(()=>Be(s),[s]);return r.blocks.length===0&&r.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:o("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[r.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:r.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:De(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,r.blocks.map((t,n)=>{if(t.type==="heading"){const l=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:l,children:T(t.text,`heading-${n}`)},`heading-${n}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:T(t.text,`paragraph-${n}`)},`paragraph-${n}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((l,a)=>e.jsx("li",{children:T(l,`ul-item-${n}-${a}`)},`ul-item-${n}-${a}`))},`ul-${n}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((l,a)=>e.jsx("li",{children:T(l,`ol-item-${n}-${a}`)},`ol-item-${n}-${a}`))},`ol-${n}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${n}`)})]})}function De(s){return s.replace(/[-_]/g," ")}function T(s,o){const r=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let n=0,l=0;for(const a of s.matchAll(r)){const m=a[0],h=a.index??0;if(h>n&&t.push(s.slice(n,h)),a[2])t.push(e.jsx("strong",{className:"font-semibold",children:a[2]},`${o}-strong-${l}`));else if(a[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:a[3]},`${o}-code-${l}`));else if(a[4])t.push(e.jsx("em",{className:"italic",children:a[4]},`${o}-em-${l}`));else if(a[5]&&a[6]){const u=a[6].trim();/^(https?:\/\/|mailto:)/i.test(u)?t.push(e.jsx("a",{href:u,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:a[5]},`${o}-link-${l}`)):t.push(a[5])}else t.push(m);n=h+m.length,l+=1}return n<s.length&&t.push(s.slice(n)),t.length===0?[s]:t}function Be(s){const o=s.replace(/\r\n/g,`
|
|
2
|
-
`).trim();if(!o)return{blocks:[],frontmatter:[]};let r=o;const t=[];if(r.startsWith(`---
|
|
3
|
-
`)){const n=r.indexOf(`
|
|
4
|
-
---
|
|
5
|
-
`,4);if(n!==-1){const l=r.slice(4,n).trim();for(const a of l.split(`
|
|
6
|
-
`)){const m=a.match(/^([A-Za-z0-9_-]+)\s*:\s*(.+)$/);m&&t.push({key:m[1],value:m[2].trim().replace(/^['"]|['"]$/g,"")})}r=r.slice(n+5).trim()}}return{blocks:Re(r),frontmatter:t}}function Re(s){if(!s.trim())return[];const o=s.split(`
|
|
7
|
-
`),r=[];let t=[],n=[],l=[],a="",m=null;const h=()=>{t.length!==0&&(r.push({type:"paragraph",text:t.join(" ")}),t=[])},u=()=>{n.length!==0&&(r.push({type:"unordered-list",items:n}),n=[])},d=()=>{l.length!==0&&(r.push({type:"ordered-list",items:l}),l=[])},w=()=>{m&&(r.push({type:"code",language:a,content:m.join(`
|
|
8
|
-
`)}),a="",m=null)};for(const x of o){if(m){x.trim().startsWith("```")?w():m.push(x);continue}if(x.trim().startsWith("```")){h(),u(),d(),a=x.trim().replace(/^```/,"").trim(),m=[];continue}if(x.trim().length===0){h(),u(),d();continue}const v=x.match(/^(#{1,6})\s+(.*)$/);if(v){h(),u(),d(),r.push({type:"heading",level:v[1].length,text:v[2].trim()});continue}const N=x.match(/^\s*[-*]\s+(.*)$/);if(N){h(),d(),n.push(N[1].trim());continue}const c=x.match(/^\s*\d+\.\s+(.*)$/);if(c){h(),u(),l.push(c[1].trim());continue}u(),d(),t.push(x.trim())}return h(),u(),d(),w(),r}export{Ze as SharedPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{L,r as c}from"./react-vendor-Bjx91N7w.js";import{a as x,B as P,c as S,W as M,d as u,x as U,C,j as v,k as N,_ as w,b as j,n as b,I as B}from"./index-BRZp_Csi.js";import{a1 as F,$ as z,ba as W,x as H,E as Q,Q as G,aa as K,C as q,bb as J,av as V}from"./icons-DzKUh8vG.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const Y={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function Z({status:s,className:t}){const{t:r}=x(),i={new:r("updates.statusNew"),stable:r("updates.statusStable"),planned:r("updates.statusPlanned")};return e.jsx(P,{variant:"outline",className:S("font-medium",Y[s],t),children:i[s]})}const g={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},X=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for native Codex with the cliproxy provider shortcut.","Use ccs codex --target codex when you want the explicit CCS-managed Codex bridge.","Codex remains runtime-only for saved defaults; use runtime aliases or --target codex at launch time."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run native Codex with cliproxy",description:"Use the native Codex cliproxy shortcut through CCS.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run the managed Codex bridge explicitly",description:"Use the explicit CCS-managed Codex bridge on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],ee=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Codex is still runtime-only for saved defaults; use --target codex or the runtime aliases at launch time."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want native Codex with the cliproxy shortcut; use ccs codex --target codex for the explicit managed bridge."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}];function l(s,t,r){return M.t(s,{defaultValue:t,...r})}function se(){return{target:l("supportCatalog.scope.target",g.target),cliproxy:l("supportCatalog.scope.cliproxy",g.cliproxy),"api-profiles":l("supportCatalog.scope.apiProfiles",g["api-profiles"]),websearch:l("supportCatalog.scope.websearch",g.websearch)}}function te(s){return{...s,title:l(`supportCatalog.notice.${s.id}.title`,s.title),summary:l(`supportCatalog.notice.${s.id}.summary`,s.summary),primaryAction:l(`supportCatalog.notice.${s.id}.primaryAction`,s.primaryAction),highlights:s.highlights.map((t,r)=>l(`supportCatalog.notice.${s.id}.highlight.${r}`,t)),actions:s.actions.map(t=>({...t,label:l(`supportCatalog.notice.${s.id}.action.${t.id}.label`,t.label),description:l(`supportCatalog.notice.${s.id}.action.${t.id}.description`,t.description)})),routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.notice.${s.id}.route.${r}.label`,t.label)}))}}function re(s){return{...s,name:l(`supportCatalog.entry.${s.id}.name`,s.name),summary:l(`supportCatalog.entry.${s.id}.summary`,s.summary),pillars:{baseUrl:l(`supportCatalog.entry.${s.id}.pillar.baseUrl`,s.pillars.baseUrl),auth:l(`supportCatalog.entry.${s.id}.pillar.auth`,s.pillars.auth),model:l(`supportCatalog.entry.${s.id}.pillar.model`,s.pillars.model)},routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.entry.${s.id}.route.${r}.label`,t.label)})),notes:s.notes?l(`supportCatalog.entry.${s.id}.notes`,s.notes):s.notes}}function ae(){return X.map(te)}function oe(){return ee.map(re)}function ie(s){const t=new Map(oe().map(r=>[r.id,r]));return s.entryIds.map(r=>t.get(r)).filter(r=>!!r)}function O(s){const t=new Date(`${s}T00:00:00Z`);return Number.isNaN(t.getTime())?s:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(t)}const $="ccs:updates:notice-progress:v1";function de(s){return s==="new"?"new":"seen"}function m(s,t){return t[s.id]??de(s.status)}function A(s){return s!=="done"&&s!=="dismissed"}function le(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem($);if(!s)return{};const t=JSON.parse(s);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[i,d]of Object.entries(t))typeof i=="string"&&(d==="new"||d==="seen"||d==="done"||d==="dismissed")&&(r[i]=d);return r}catch{return{}}}function ne(s){typeof window>"u"||window.localStorage.setItem($,JSON.stringify(s))}function D({state:s,className:t}){const{t:r}=x(),i={new:{label:r("updates.progressNeedsAction"),className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:r("updates.progressInReview"),className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:r("updates.progressDone"),className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:r("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[s];return e.jsxs(P,{variant:"outline",className:S("gap-1.5 border text-[10px] font-medium",i.className,t),children:[i.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),i.label]})}function ce({action:s}){const{t}=x();return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(u,{size:"sm",asChild:!0,children:e.jsxs(L,{to:s.path,children:[t("updates.open"),e.jsx(F,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(U,{value:s.command})]})]})}function pe({notice:s,progress:t,relatedEntries:r,onUpdateProgress:i}){const{t:d}=x(),f=se();return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsx(D,{state:t}),e.jsx(Z,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:d("updates.published",{date:O(s.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(u,{size:"sm",onClick:()=>i("done"),children:[e.jsx(H,{className:"h-4 w-4"}),d("updates.markDone")]}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>i("dismissed"),children:[e.jsx(Q,{className:"h-4 w-4"}),d("updates.dismiss")]}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>i("new"),children:[e.jsx(G,{className:"h-4 w-4"}),d("updates.reopen")]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(C,{className:"h-full overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:d("updates.doNext")})]}),e.jsx(w,{children:s.primaryAction})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(o=>e.jsx(ce,{action:o},`${s.id}-${o.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.impactedIntegrations")}),e.jsx(w,{children:d("updates.impactedDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:o.name}),e.jsx(P,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:f[o.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.routes[0]&&e.jsx(u,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(L,{to:o.routes[0].path,children:o.routes[0].label})}),o.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:o.commands[0]}),e.jsx(U,{value:o.commands[0]})]})]})]},o.id))})})})]}),e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.whyMatters")}),e.jsx(w,{children:d("updates.whyMattersDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(o=>e.jsxs("li",{children:["- ",o]},`${s.id}-${o}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:d("updates.noUpdates")})})}function me({notice:s,progress:t,selected:r,onSelect:i}){return e.jsxs("button",{type:"button",onClick:i,className:S("w-full rounded-lg border px-3 py-3 text-left transition-colors",r?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:O(s.publishedAt)}),e.jsx(D,{state:t})]})]})}function ue(s,t){return t?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(i=>`${i.label} ${i.description} ${i.command||""}`),...s.routes.map(i=>i.label)].join(" ").toLowerCase().includes(t):!0}function je(){const{t:s}=x(),t=[...ae()].sort((a,n)=>n.publishedAt.localeCompare(a.publishedAt)),[r,i]=c.useState("inbox"),[d,f]=c.useState(""),[o,k]=c.useState(()=>le()),[I,E]=c.useState(null);c.useEffect(()=>{ne(o)},[o]);const h=c.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(n=>{const y=m(n,o);return ue(n,a)?r==="done"?y==="done":r==="inbox"?A(y):!0:!1})},[t,o,d,r]),p=c.useMemo(()=>{const a=r==="all"?t:h;return a.find(n=>n.id===I)??a[0]??null},[t,I,r,h]),R=a=>{E(a.id),k(n=>m(a,n)!=="new"?n:{...n,[a.id]:"seen"})},T=c.useMemo(()=>t.filter(a=>A(m(a,o))).length,[t,o]),_=c.useMemo(()=>t.filter(a=>m(a,o)==="done").length,[t,o]);return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("updates.inboxSubtitle")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:T})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:a=>f(a.target.value),placeholder:s("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:s("updates.actionRequired")},{id:"done",label:s("updates.done")},{id:"all",label:s("updates.all")}].map(a=>e.jsx(u,{size:"sm",variant:r===a.id?"default":"outline",onClick:()=>i(a.id),children:a.label},a.id))})]}),e.jsx(b,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:h.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:s("updates.noNotices")}):h.map(a=>e.jsx(me,{notice:a,progress:m(a,o),selected:p?.id===a.id,onSelect:()=>R(a)},a.id))})})]}),e.jsx(pe,{notice:p,progress:p?m(p,o):null,relatedEntries:p?ie(p):[],onUpdateProgress:a=>{p&&k(n=>({...n,[p.id]:a}))}})]})}export{je as UpdatesPage};
|