omniroute 1.7.13 → 1.7.14
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/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +45 -45
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +2 -2
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +2 -2
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +2 -2
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +2 -2
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +2 -2
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route.js +2 -2
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -2
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -2
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +2 -2
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +2 -2
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -2
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +3 -3
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +45 -45
- package/app/.next/server/chunks/2180.js +1 -1
- package/app/.next/server/chunks/2767.js +3 -3
- package/app/.next/server/chunks/2910.js +1 -1
- package/app/.next/server/chunks/3498.js +1 -1
- package/app/.next/server/chunks/4488.js +1 -1
- package/app/.next/server/chunks/5248.js +1 -0
- package/app/.next/server/chunks/5393.js +2 -0
- package/app/.next/server/chunks/7109.js +1 -1
- package/app/.next/server/chunks/8020.js +3 -3
- package/app/.next/server/chunks/9824.js +2 -2
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +3 -3
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{5846-0ee1f53245d92ec3.js → 5846-07d81ca18232b21d.js} +1 -1
- package/app/.next/static/chunks/{993-9f36b0b069ca090e.js → 993-035473765d7d1871.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-6f1750506292c630.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/{page-20786f2c7fdbab57.js → page-52f76c7c91444ec2.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-1dd4d0c348a7b0a6.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-e5bf8955e7b9a4f5.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-77ab26722f5c56c7.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-85a3e6a423aceded.js → page-3dce7fccfcf177dd.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-cdb8071441476da9.js → page-3ed2a7685adf9b91.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-84be54df40abf969.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/{page-b480b3cb318782d7.js → page-9a6519bf1468f16e.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-f4a2d6d07df5ddc4.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/{page-ffdc1dcf074c7528.js → page-833d24f322a20f5a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-1d0ca9b5d3eaf7cd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/{page-5378e9473a20cd6a.js → page-d424641c7e428be9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-388840686801f3f5.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9c8ffb212f855704.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{error-f0730d6d62d02e82.js → error-2f0177a2197dd556.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{loading-59cbccd6d5185ca9.js → loading-99ab4d478260d53b.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-31cdb6e15134d8c2.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-40dc5ac82df708e9.js → page-1f022385b812b987.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{error-cc85c3ff1f63aea6.js → error-e844916e39172c8b.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{loading-19fc771a287bcb4c.js → loading-bb068659ee679ff4.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{page-2442cf2a6452a899.js → page-cea3403400ee20c8.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-69eb8b0eb0e9de00.js → page-a4b8b03ffb39da1d.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-534e13a69cb60a4f.js → page-83b07523f81d6282.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-86a076d820931a30.js → page-9cc99ab874fc36e7.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/{layout-16302e54f9ef3d0e.js → layout-00d5d56af65098a9.js} +1 -1
- package/app/.next/static/chunks/app/callback/{page-0f0ebc0820dd18a5.js → page-585a53f7dc6a30f1.js} +1 -1
- package/app/.next/static/chunks/app/docs/{page-3658b3f15df3a19e.js → page-2fe9dcbeb3f738c0.js} +1 -1
- package/app/.next/static/chunks/app/{error-f918d9961a2368d3.js → error-0d59fc4efafbc38c.js} +1 -1
- package/app/.next/static/chunks/app/forbidden/page-df886dfa2d5bd9fa.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-2a495f0b0c653ab4.js +1 -0
- package/app/.next/static/chunks/app/global-error-41eef2a698918fc1.js +1 -0
- package/app/.next/static/chunks/app/landing/page-9d540ab1716f8e3e.js +1 -0
- package/app/.next/static/chunks/app/{layout-070972eb026af319.js → layout-108592eafb959363.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-6c769465e407368f.js → page-121c612ee459e7c2.js} +1 -1
- package/app/.next/static/chunks/app/not-found-1dbd8c3e506fe00f.js +1 -0
- package/app/.next/static/chunks/app/privacy/{page-3658b3f15df3a19e.js → page-2fe9dcbeb3f738c0.js} +1 -1
- package/app/.next/static/chunks/app/terms/{page-3658b3f15df3a19e.js → page-2fe9dcbeb3f738c0.js} +1 -1
- package/app/.next/static/chunks/{main-app-ae230f6bf51a5edb.js → main-app-c9da11a8061df107.js} +1 -1
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.env +0 -122
- package/app/.next/server/chunks/3801.js +0 -2
- package/app/.next/server/chunks/9548.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-ce5214cdf489c9df.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-12d772841a253032.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c9b98846b8479f3f.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-5e34630a5dc32825.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-3f3a5f45e045051f.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-0ae1d6cc5fc4671f.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-72b768421394b42c.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-5c87e49261a22fd5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b38f2d03bae8166a.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-a7fb36872be60fe0.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-77657dfa95e61cd8.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-be3bacc125c30a6b.js +0 -1
- package/app/.next/static/chunks/app/global-error-504ff9093e2a997d.js +0 -1
- package/app/.next/static/chunks/app/landing/page-75b0c988db383cfc.js +0 -1
- package/app/.next/static/chunks/app/not-found-11b712c853d93172.js +0 -1
- /package/app/.next/static/{aCT5wOLH_n6lt0LkCh2w7 → 75GpGu25G2S3zpsEKAfV7}/_buildManifest.js +0 -0
- /package/app/.next/static/{aCT5wOLH_n6lt0LkCh2w7 → 75GpGu25G2S3zpsEKAfV7}/_ssgManifest.js +0 -0
package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-5e34630a5dc32825.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{22611:(e,t,s)=>{"use strict";s.d(t,{default:()=>S});var a=s(95155),l=s(12115),r=s(40993);let i={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-5-20251101"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-5-20250929"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresCloud:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant CLI",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant CLI",configType:"custom"},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
2
|
-
"apiBase": "{{baseUrl}}",
|
|
3
|
-
"title": "{{model}}",
|
|
4
|
-
"model": "{{model}}",
|
|
5
|
-
"provider": "openai",
|
|
6
|
-
"apiKey": "{{apiKey}}"
|
|
7
|
-
}`}},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3.1-pro-high","gemini-3.1-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat — VS Code Extension",configType:"custom"}};var n=s(81135),o=s(5772),c=s(50910),d=s(33418);function x({effectiveConfigStatus:e,batchStatus:t,lastConfiguredAt:s=null}){let l=(0,c.c)("cliTools"),r=(0,d.Ym)(),i=e||t?.configStatus||null,n={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:l("configured")},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:l("notConfigured")},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("notInstalled")},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:l("custom")},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("unknown")}},o=i?n[i]||n.unknown:null;return(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${o.badgeClass}`,children:[(0,a.jsx)("span",{className:`size-1.5 rounded-full ${o.dotClass}`}),o.text]}),s?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",title:l("lastSavedAt",{date:new Date(s).toLocaleString(r)}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),function(e,t){let s=Date.now()-new Date(e).getTime();if(s<0)return t("justNow");let a=Math.floor(s/1e3);if(a<60)return t("justNow");let l=Math.floor(a/60);if(l<60)return t("minutesAgoShort",{count:l});let r=Math.floor(l/60);if(r<24)return t("hoursAgoShort",{count:r});let i=Math.floor(r/24);if(i<30)return t("daysAgoShort",{count:i});let n=Math.floor(i/30);return n<12?t("monthsAgoShort",{count:n}):t("yearsAgoShort",{count:Math.floor(n/12)})}(s,l)]}):i&&"not_installed"!==i?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),l("never")]}):null]})}let m="https://cloud.omniroute.online";function u({tool:e,isExpanded:t,onToggle:s,activeProviders:i,modelMappings:n,onModelMappingChange:d,baseUrl:u,hasActiveProviders:p,apiKeys:h,cloudEnabled:g,batchStatus:f,lastConfiguredAt:y}){let b,j,N,v=(0,c.c)("cliTools"),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(!1),[_,A]=(0,l.useState)(!1),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)(null),[$,z]=(0,l.useState)(!1),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)(null),[D,F]=(0,l.useState)(""),[U,L]=(0,l.useState)({}),[B,H]=(0,l.useState)(!1),[J,W]=(0,l.useState)(""),q=(0,l.useRef)(!1),[G,V]=(0,l.useState)([]),[Y,Z]=(0,l.useState)(!1),[Q,X]=(0,l.useState)(null),ee=!!(k?.installed&&k?.runnable),et=(()=>{if(!ee)return null;let e=k.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=g&&m&&e.startsWith(m);return t||s?"configured":"other"})()||f?.configStatus||null;(0,l.useEffect)(()=>{h?.length>0&&!D&&F(h[0].key)},[h,D]),(0,l.useEffect)(()=>{t&&!k&&(ea(),es(),en())},[t,k]);let es=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(k?.installed&&!q.current){q.current=!0;let t=k.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&h?.some(e=>e.key===s)&&F(s)}},[k,h,e.defaultModels,d]);let ea=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();w(t)}catch(e){w({installed:!1,error:e.message})}finally{S(!1)}},el=()=>{let e=J||u;return e.endsWith("/v1")?e:`${e}/v1`},er=async()=>{A(!0),P(null);try{let t={ANTHROPIC_BASE_URL:el()},s=D?.trim()||(h?.length>0?h[0].key:null)||(g?null:"sk_omniroute");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=n[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let a=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),l=await a.json();a.ok?(P({type:"success",text:v("settingsApplied")}),w(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):P({type:"error",text:l.error||v("failedApplySettings")})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ei=async()=>{E(!0),P(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(P({type:"success",text:v("settingsReset")}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),F("")):P({type:"error",text:s.error||v("failedResetSettings")})}catch(e){P({type:"error",text:e.message})}finally{E(!1)}},en=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=claude"),t=await e.json();e.ok&&V(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},eo=async e=>{X(e),P(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:e})}),s=await t.json();t.ok?(P({type:"success",text:v("backupRestored")}),ea(),en()):P({type:"error",text:s.error||v("failedRestore")})}catch(e){P({type:"error",text:e.message})}finally{X(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:et,batchStatus:f,lastConfiguredAt:y})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:v("toolDescriptions.claude")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:v("checkingCli",{tool:"Claude"})})]}),!C&&k&&!ee&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.installed?v("cliNotRunnable",{tool:"Claude"}):v("cliNotInstalled",{tool:"Claude"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:k.installed?v("cliFoundFailedHealthcheck",{tool:"Claude",reason:k.reason?` (${k.reason})`:""}):v("installCliPrompt",{tool:"Claude"})})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>z(!$),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:$?"expand_less":"help"}),$?v("hide"):v("howToInstall")]})]}),$&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:v("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:v("platforms")}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[v("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," ",v("toVerify")]})]})]})]}),!C&&ee&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.settings?.env?.ANTHROPIC_BASE_URL&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:k.settings.env.ANTHROPIC_BASE_URL})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(b=J||u).endsWith("/v1")?b:`${b}/v1`,onChange:e=>W(e.target.value),placeholder:v("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),J&&J!==u&&(0,a.jsx)("button",{onClick:()=>W(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:v("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),h.length>0?(0,a.jsx)("select",{value:D,onChange:e=>F(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:h.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:g?v("noApiKeysCreateOne"):v("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:n[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:v("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{I(e.alias),M(!0)},disabled:!p,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${p?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:v("selectModel")}),n[e.alias]&&(0,a.jsx)("button",{onClick:()=>d(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:v("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))]}),T&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===T.type?"check_circle":"error"}),(0,a.jsx)("span",{children:T.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:er,disabled:!p,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),v("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ei,disabled:!k?.hasOmniRoute,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),v("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>H(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),v("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||en()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),v("backups"),G.length>0&&` (${G.length})`]})]}),Y&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),v("configBackups")]}),0===G.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:v("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:G.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>eo(e.id),disabled:Q===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Q===e.id?"...":v("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>M(!1),onSelect:e=>{K&&d(K,e.value)},selectedModel:K?n[K]:null,activeProviders:i,modelAliases:U,title:v("selectModelForAlias",{alias:K||""})}),(0,a.jsx)(r.uR,{isOpen:B,onClose:()=>H(!1),title:v("claudeManualConfiguration"),configs:(j=D&&D.trim()?D:g?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",N={ANTHROPIC_BASE_URL:el(),ANTHROPIC_AUTH_TOKEN:j},e.defaultModels.forEach(e=>{let t=n[e.alias];t&&e.envKey&&(N[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:N},null,2)}])})]})}function p({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,cloudEnabled:m,batchStatus:u,lastConfiguredAt:p}){let h,g,f,y=(0,c.c)("cliTools"),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,A]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)(""),[$,z]=(0,l.useState)(""),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)({}),[D,F]=(0,l.useState)(!1),[U,L]=(0,l.useState)(""),[B,H]=(0,l.useState)([]),[J,W]=(0,l.useState)(!1),[q,G]=(0,l.useState)(""),[V,Y]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(null),[X,ee]=(0,l.useState)([]),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(null),er=!!(b?.installed&&b?.runnable);(0,l.useEffect)(()=>{n?.length>0&&!T&&P(n[0].key)},[n,T]),(0,l.useEffect)(()=>{t&&!b&&(ec(),ei(),em(),eg())},[t,b]);let ei=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&I(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(b?.config){let e=b.config.match(/^model\s*=\s*"([^"]+)"/m);e&&z(e[1])}},[b]);let en=(er?b.config?b.config.includes(i)||b.config.includes("localhost")||b.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||u?.configStatus||null,eo=()=>{let e=U||`${i}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},ec=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},ed=async()=>{w(!0),A(null);try{let e=T&&T.trim()||m?T:"sk_omniroute",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:eo(),apiKey:e,model:$})}),s=await t.json();t.ok?(A({type:"success",text:y("settingsApplied")}),ec()):A({type:"error",text:s.error||y("failedApplySettings")})}catch(e){A({type:"error",text:e.message})}finally{w(!1)}},ex=async()=>{S(!0),A(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(A({type:"success",text:y("settingsReset")}),z(""),ec()):A({type:"error",text:t.error||y("failedResetSettings")})}catch(e){A({type:"error",text:e.message})}finally{S(!1)}},em=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&H(t.profiles||[])}catch(e){console.log("Error fetching profiles:",e)}},eu=async()=>{if(q.trim()){Y(!0),A(null);try{let e=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q.trim()})}),t=await e.json();e.ok?(A({type:"success",text:y("profileSaved",{name:q})}),G(""),em()):A({type:"error",text:t.error||y("failedSaveProfile")})}catch(e){A({type:"error",text:e.message})}finally{Y(!1)}}},ep=async e=>{Q(e),A(null);try{let t=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})}),s=await t.json();t.ok?(A({type:"success",text:s.message||y("profileActivated")}),ec(),eg()):A({type:"error",text:s.error||y("failedActivateProfile")})}catch(e){A({type:"error",text:e.message})}finally{Q(null)}},eh=async e=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})})).ok&&em()}catch(e){console.log("Error deleting profile:",e)}},eg=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=codex"),t=await e.json();e.ok&&ee(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ef=async e=>{el(e),A(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:e})}),s=await t.json();t.ok?(A({type:"success",text:y("backupRestored")}),ec(),eg()):A({type:"error",text:s.error||y("failedRestore")})}catch(e){A({type:"error",text:e.message})}finally{el(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:en,batchStatus:u,lastConfiguredAt:p})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y("toolDescriptions.codex")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:y("checkingCli",{tool:"Codex"})})]}),!N&&b&&!er&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:b.installed?y("cliNotRunnable",{tool:"Codex"}):y("cliNotInstalled",{tool:"Codex"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:b.installed?y("cliFoundFailedHealthcheck",{tool:"Codex",reason:b.reason?` (${b.reason})`:""}):y("installCodexPrompt")})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!O),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?y("hide"):y("howToInstall")]})]}),O&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:y("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:y("platforms")}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," ",y("toVerify")]}),(0,a.jsx)("div",{className:"pt-2 border-t border-border",children:(0,a.jsxs)("p",{className:"text-text-muted text-xs",children:[y("codexAuthNotePrefix")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ",y("codexAuthNoteMiddle")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),". ",y("codexAuthNoteSuffix")]})})]})]})]}),!N&&er&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.config&&((g=(h=b.config.match(/base_url\s*=\s*"([^"]+)"/))?h[1]:null)?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:g})]}):null),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:U||`${i}/v1`,onChange:e=>L(e.target.value),placeholder:y("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),U&&U!==`${i}/v1`&&(0,a.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:y("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:T,onChange:e=>P(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?y("noApiKeysCreateOne"):y("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:$,onChange:e=>z(e.target.value),placeholder:y("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>M(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:y("selectModel")}),$&&(0,a.jsx)("button",{onClick:()=>z(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:y("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ed,disabled:!T||!$,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ex,disabled:!b.hasOmniRoute,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),y("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),y("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{W(!J),J||em()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),y("profiles")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{es(!et),et||eg()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),y("backups"),X.length>0&&` (${X.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),y("savedProfiles")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noProfilesYet")}):(0,a.jsx)("div",{className:"space-y-1.5 mb-3",children:B.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,a.jsx)("span",{className:"font-medium flex-1 truncate",children:e.name}),(0,a.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:e.authLabel,children:e.authLabel}),(0,a.jsx)("button",{onClick:()=>ep(e.id),disabled:Z===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Z===e.id?"...":y("activate")}),(0,a.jsx)("button",{onClick:()=>eh(e.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:y("deleteProfile"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},e.id))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:q,onChange:e=>G(e.target.value),placeholder:y("profileNamePlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&eu()}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eu,disabled:!q.trim(),loading:V,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("saveCurrent")]})]})]}),et&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),y("configBackups")]}),0===X.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:X.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ef(e.id),disabled:ea===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ea===e.id?"...":y("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>M(!1),onSelect:e=>{z(e.value),M(!1)},selectedModel:$,activeProviders:d,modelAliases:K,title:y("selectModelForTool",{tool:"Codex"})}),(0,a.jsx)(r.uR,{isOpen:D,onClose:()=>F(!1),title:y("codexManualConfiguration"),configs:(f=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.codex/config.toml",content:`# OmniRoute Configuration for Codex CLI
|
|
8
|
-
model = "${$}"
|
|
9
|
-
model_provider = "omniroute"
|
|
10
|
-
|
|
11
|
-
[model_providers.omniroute]
|
|
12
|
-
name = "OmniRoute"
|
|
13
|
-
base_url = "${eo()}"
|
|
14
|
-
wire_api = "responses"
|
|
15
|
-
`},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:f},null,2)}])})]})}let h="https://cloud.omniroute.online";function g({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:g}){let f,y,b,j,N=(0,c.c)("cliTools"),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[A,O]=(0,l.useState)(!1),[E,T]=(0,l.useState)(null),[P,$]=(0,l.useState)(""),[z,R]=(0,l.useState)(""),[M,K]=(0,l.useState)(!1),[I,D]=(0,l.useState)({}),[F,U]=(0,l.useState)(!1),[L,B]=(0,l.useState)(""),H=(0,l.useRef)(!1),[J,W]=(0,l.useState)([]),[q,G]=(0,l.useState)(!1),[V,Y]=(0,l.useState)(null),Z=!!(v?.installed&&v?.runnable),Q=(()=>{if(!Z)return null;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=u&&h&&e.baseUrl?.startsWith(h);return t||s?"configured":"other"})()||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!P&&$(d[0].key)},[d,P]),(0,l.useEffect)(()=>{t&&!v&&(ee(),X(),el())},[t,v]);let X=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(v?.installed&&!H.current){H.current=!0;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&R(e.model),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&$(e.apiKey))}},[v,d]);let ee=async()=>{C(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();k(t)}catch(e){k({installed:!1,error:e.message})}finally{C(!1)}},et=()=>{let e=L||i;return e.endsWith("/v1")?e:`${e}/v1`},es=async()=>{_(!0),T(null);try{let e=P?.trim()||(d?.length>0?d[0].key:null)||(u?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:et(),apiKey:e,model:z})}),s=await t.json();t.ok?(T({type:"success",text:N("settingsApplied")}),ee()):T({type:"error",text:s.error||N("failedApplySettings")})}catch(e){T({type:"error",text:e.message})}finally{_(!1)}},ea=async()=>{O(!0),T(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(T({type:"success",text:N("settingsReset")}),R(""),$(""),ee()):T({type:"error",text:t.error||N("failedResetSettings")})}catch(e){T({type:"error",text:e.message})}finally{O(!1)}},el=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&W(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},er=async e=>{Y(e),T(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(T({type:"success",text:N("backupRestored")}),ee(),el()):T({type:"error",text:s.error||N("failedRestore")})}catch(e){T({type:"error",text:e.message})}finally{Y(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Q,batchStatus:p,lastConfiguredAt:g})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:N("toolDescriptions.droid")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:N("checkingCli",{tool:"Factory Droid"})})]}),!w&&v&&!Z&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:v.installed?N("cliNotRunnable",{tool:"Factory Droid"}):N("cliNotInstalled",{tool:"Factory Droid"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:v.installed?N("cliFoundFailedHealthcheck",{tool:"Factory Droid",reason:v.reason?` (${v.reason})`:""}):N("installCliPrompt",{tool:"Factory Droid"})})]})]}),!w&&Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[v?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:v.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(f=L||i).endsWith("/v1")?f:`${f}/v1`,onChange:e=>B(e.target.value),placeholder:N("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),L&&L!==i&&(0,a.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:N("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:P,onChange:e=>$(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:u?N("noApiKeysCreateOne"):N("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:z,onChange:e=>R(e.target.value),placeholder:N("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>K(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:N("selectModel")}),z&&(0,a.jsx)("button",{onClick:()=>R(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:N("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),E&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,a.jsx)("span",{children:E.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:!z,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),N("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ea,disabled:!v?.hasOmniRoute,loading:A,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),N("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),N("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{G(!q),q||el()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),N("backups"),J.length>0&&` (${J.length})`]})]}),q&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),N("configBackups")]}),0===J.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:N("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:J.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>er(e.id),disabled:V===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:V===e.id?"...":N("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:M,onClose:()=>K(!1),onSelect:e=>{R(e.value),K(!1)},selectedModel:z,activeProviders:m,modelAliases:I,title:N("selectModelForTool",{tool:"Factory Droid"})}),(0,a.jsx)(r.uR,{isOpen:F,onClose:()=>U(!1),title:N("droidManualConfiguration"),configs:(y=P&&P.trim()?P:u?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",b={customModels:[{model:z||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:et(),apiKey:y,displayName:z||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},j="u">typeof navigator&&navigator.platform,[{filename:j?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(b,null,2)}])})]})}let f="https://cloud.omniroute.online";function y({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g,y,b=(0,c.c)("cliTools"),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[E,T]=(0,l.useState)(""),[P,$]=(0,l.useState)(""),[z,R]=(0,l.useState)(!1),[M,K]=(0,l.useState)({}),[I,D]=(0,l.useState)(!1),[F,U]=(0,l.useState)(""),L=(0,l.useRef)(!1),[B,H]=(0,l.useState)([]),[J,W]=(0,l.useState)(!1),[q,G]=(0,l.useState)(null),V=!!(j?.installed&&j?.runnable),Y=(()=>{if(!V)return null;let e=j.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=u&&f&&e.baseUrl?.startsWith(f);return t||s?"configured":"other"})()||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!E&&T(d[0].key)},[d,E]),(0,l.useEffect)(()=>{t&&!j&&(Q(),Z(),es())},[t,j]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(j?.installed&&!L.current){L.current=!0;let e=j.settings?.models?.providers?.omniroute;if(e){let t=j.settings?.agents?.defaults?.model?.primary;t&&$(t.replace("omniroute/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&T(e.apiKey)}}},[j,d]);let Q=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},X=()=>{let e=F||i;return e.endsWith("/v1")?e:`${e}/v1`},ee=async()=>{C(!0),O(null);try{let e=E?.trim()||(d?.length>0?d[0].key:null)||(u?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:X(),apiKey:e,model:P})}),s=await t.json();t.ok?(O({type:"success",text:b("settingsApplied")}),Q()):O({type:"error",text:s.error||b("failedApplySettings")})}catch(e){O({type:"error",text:e.message})}finally{C(!1)}},et=async()=>{_(!0),O(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:b("settingsReset")}),$(""),T(""),Q()):O({type:"error",text:t.error||b("failedResetSettings")})}catch(e){O({type:"error",text:e.message})}finally{_(!1)}},es=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&H(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ea=async e=>{G(e),O(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(O({type:"success",text:b("backupRestored")}),Q(),es()):O({type:"error",text:s.error||b("failedRestore")})}catch(e){O({type:"error",text:e.message})}finally{G(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Y,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:b("toolDescriptions.openclaw")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:b("checkingCli",{tool:"Open Claw"})})]}),!v&&j&&!V&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:j.installed?b("cliNotRunnable",{tool:"Open Claw"}):b("cliNotInstalled",{tool:"Open Claw"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j.installed?b("cliFoundFailedHealthcheck",{tool:"Open Claw",reason:j.reason?` (${j.reason})`:""}):b("installCliPrompt",{tool:"Open Claw"})})]})]}),!v&&V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[j?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:j.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(g=F||i).endsWith("/v1")?g:`${g}/v1`,onChange:e=>U(e.target.value),placeholder:b("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),F&&F!==i&&(0,a.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:b("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:E,onChange:e=>T(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:u?b("noApiKeysCreateOne"):b("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:P,onChange:e=>$(e.target.value),placeholder:b("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>R(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:b("selectModel")}),P&&(0,a.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:b("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!P,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),b("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,disabled:!j?.hasOmniRoute,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),b("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>D(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),b("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{W(!J),J||es()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),b("backups"),B.length>0&&` (${B.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),b("configBackups")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:b("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:B.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ea(e.id),disabled:q===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:q===e.id?"...":b("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:z,onClose:()=>R(!1),onSelect:e=>{$(e.value),R(!1)},selectedModel:P,activeProviders:m,modelAliases:M,title:b("selectModelForTool",{tool:"Open Claw"})}),(0,a.jsx)(r.uR,{isOpen:I,onClose:()=>D(!1),title:b("openClawManualConfiguration"),configs:(y=E&&E.trim()?E:u?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${P||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:X(),apiKey:y,api:"openai-completions",models:[{id:P||"provider/model-id",name:(P||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let b="https://cloud.omniroute.online";function j({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[j,N]=(0,l.useState)(!1),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(null),[A,O]=(0,l.useState)(""),[E,T]=(0,l.useState)(""),[P,$]=(0,l.useState)(!1),[z,R]=(0,l.useState)({}),[M,K]=(0,l.useState)(!1),[I,D]=(0,l.useState)(""),F=(0,l.useRef)(!1),[U,L]=(0,l.useState)([]),[B,H]=(0,l.useState)(!1),[J,W]=(0,l.useState)(null),q=!!(f?.installed&&f?.runnable),G=(()=>{if(!q)return null;if(!f.hasOmniRoute)return"not_configured";let e=f.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=u&&b&&e.startsWith(b);return t||s?"configured":"other"})(),V=G||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!A&&O(d[0].key)},[d,A]),(0,l.useEffect)(()=>{t&&!f&&(X(),Y(),Z())},[t,f]),(0,l.useEffect)(()=>{if(f?.settings&&!F.current){let e=f.settings.openAiModelId;e&&(T(e),F.current=!0)}},[f]);let Y=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();R(t.aliases||{})}}catch{}},Z=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=cline");if(e.ok){let t=await e.json();L(t.backups||[])}}catch{}},Q=async e=>{W(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:e})});if(t.ok)_({type:"success",text:g("backupRestoredReloading")}),await X(),await Z();else{let e=await t.json();_({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){_({type:"error",text:e.message})}finally{W(null)}},X=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{N(!1)}},ee=async()=>{k(!0),_(null);try{let e=I||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:A||"sk_omniroute",model:E})}),a=await s.json();s.ok?(_({type:"success",text:a.message||g("applied")}),await X(),await Z()):_({type:"error",text:a.error||g("failed")})}catch(e){_({type:"error",text:e.message})}finally{k(!1)}},et=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:t.message||g("resetDone")}),T(""),F.current=!1,await X(),await Z()):_({type:"error",text:t.error||g("failed")})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:V,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.cline")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Cline"})})]}),f&&!j&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${q?"text-green-500":"text-yellow-500"}`,children:q?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:q?g("cliDetectedReady",{tool:"Cline"}):f.installed?g("cliNotRunnable",{tool:"Cline"}):g("cliNotDetected",{tool:"Cline"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("configPathShort"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.globalStatePath})]})]})]}),q&&(0,a.jsxs)(a.Fragment,{children:["configured"===G&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("provider"),": ",(0,a.jsx)("strong",{children:"openai"})," • ",g("model"),":"," ",(0,a.jsx)("strong",{children:f.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:E,onChange:e=>T(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>$(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:A,onChange:e=>O(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!E,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===G?g("updateConfig"):g("applyConfig")]}),"configured"===G&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),S&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===S.type?"check_circle":"error"}),(0,a.jsx)("span",{children:S.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>H(!B),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${B?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",U.length>0&&`(${U.length})`]}),B&&U.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:U.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Q(e.id),loading:J===e.id,children:g("restore")})]},e.id))}),B&&0===U.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{T(e.value),$(!1)},selectedModel:E,activeProviders:m,title:g("selectModelForTool",{tool:"Cline"})}),M&&(0,a.jsx)(r.uR,{isOpen:M,onClose:()=>K(!1),title:g("clineManualConfiguration"),...{onApply:e=>{e.model&&T(e.model),e.apiKey&&O(e.apiKey),e.baseUrl&&D(e.baseUrl),K(!1)},currentConfig:{model:E,apiKey:A,baseUrl:I||i}}})]})}function N({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[_,A]=(0,l.useState)(""),[O,E]=(0,l.useState)(""),[T,P]=(0,l.useState)(!1),[$,z]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)(""),D=(0,l.useRef)(!1),[F,U]=(0,l.useState)([]),[L,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),W=!!(f?.installed&&f?.runnable),q=W?f.hasOmniRoute?"configured":"not_configured":null,G=q||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!_&&A(d[0].key)},[d,_]),(0,l.useEffect)(()=>{t&&!f&&(Q(),V(),Y())},[t,f]);let V=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();z(t.aliases||{})}}catch{}},Y=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=kilo");if(e.ok){let t=await e.json();U(t.backups||[])}}catch{}},Z=async e=>{J(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:e})});if(t.ok)S({type:"success",text:g("backupRestoredReloading")}),await Q(),await Y();else{let e=await t.json();S({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){S({type:"error",text:e.message})}finally{J(null)}},Q=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{j(!1)}},X=async()=>{v(!0),S(null);try{let e=K||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:_||"sk_omniroute",model:O})}),a=await s.json();s.ok?(S({type:"success",text:a.message||g("applied")}),await Q(),await Y()):S({type:"error",text:a.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},ee=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:t.message||g("resetDone")}),E(""),D.current=!1,await Q(),await Y()):S({type:"error",text:t.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:G,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.kilo")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Kilo Code"})})]}),f&&!b&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${W?"text-green-500":"text-yellow-500"}`,children:W?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:W?g("cliDetectedReady",{tool:"Kilo Code"}):f.installed?g("cliNotRunnable",{tool:"Kilo Code"}):g("cliNotDetected",{tool:"Kilo Code"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("auth"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.authPath})]})]})]}),W&&(0,a.jsxs)(a.Fragment,{children:["configured"===q&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("providers"),":"," ",(0,a.jsx)("strong",{children:f.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:O,onChange:e=>E(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>P(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:_,onChange:e=>A(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!O,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===q?g("updateConfig"):g("applyConfig")]}),"configured"===q&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ee,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>B(!L),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${L?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",F.length>0&&`(${F.length})`]}),L&&F.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(e.id),loading:H===e.id,children:g("restore")})]},e.id))}),L&&0===F.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:T,onClose:()=>P(!1),onSelect:e=>{E(e.value),P(!1)},selectedModel:O,activeProviders:m,title:g("selectModelForTool",{tool:"Kilo Code"})}),R&&(0,a.jsx)(r.uR,{isOpen:R,onClose:()=>M(!1),title:g("kiloManualConfiguration"),...{onApply:e=>{e.model&&E(e.model),e.apiKey&&A(e.apiKey),e.baseUrl&&I(e.baseUrl),M(!1)},currentConfig:{model:O,apiKey:_,baseUrl:K||i}}})]})}function v({toolId:e,tool:t,isExpanded:s,onToggle:i,baseUrl:n,apiKeys:d,activeProviders:x=[],cloudEnabled:m=!1,batchStatus:u}){let p,h,g,f=(0,c.c)("cliTools"),y=(0,l.useCallback)((e,t,s)=>{try{return f(e,s)}catch{return t}},[f]),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),[_,A]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),T=(0,l.useRef)(!1),[P,$]=(0,l.useState)(()=>d?.length>0?d[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&w(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&d?.some(e=>e.key===s)&&$(s)},[e,d]);let z=(0,l.useCallback)(t=>{w(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),R=(0,l.useCallback)(t=>{$(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||C||T.current||(T.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>S(e)).catch(e=>S({error:e?.message||f("runtimeCheckFailed")})))},[s,C,e]);let M=e=>{let t=P&&P.trim()?P:m?f("yourApiKeyPlaceholder"):"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,k||f("modelPlaceholder"))},K=async(e,t)=>{await navigator.clipboard.writeText(M(e)),j(t),setTimeout(()=>j(null),2e3)},I=x.length>0,D=s&&null===C,F=async()=>{E(!0),A(null);try{let t=P&&P.trim()?P:m?"":"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:k})}),r=await l.json();l.ok?A({type:"success",text:r.message||f("configurationSaved")}):A({type:"error",text:r.error||f("failedToSave")})}catch(e){A({type:"error",text:e.message})}finally{E(!1)}},U=["continue"].includes(e),L=()=>!t.requiresCloud||!!m;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:i,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(p=C?.reason==="not_required"||"guide"===t.configType,h=C?C.installed&&C.runnable:u?.installed&&u?.runnable,g=C?C.installed:u?.installed,p?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),f("guide")]}):h?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),f("detected")]}):!1===g&&(C||u)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),f("notInstalled")]}):g&&!h&&(C||u)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),f("notReady")]}):null)]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y(`toolDescriptions.${e}`,t.description)})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[D&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:f("checkingRuntime")})]}),!D&&C&&!C.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===C.reason?"info":C.installed&&C.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===C.reason?f("guideOnlyIntegration"):C.installed&&C.runnable?f("cliRuntimeDetected"):C.installed?f("cliFoundNotRunnable",{reason:C.reason?`: ${C.reason}`:""}):f("cliRuntimeNotDetected")}),C.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.commandPath})]}),C.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("configPath"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.configPath})]})]})]}),!D&&C?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:f("failedCheckRuntimeStatus")})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((t,s)=>{if("cloudCheck"===t.type&&m)return null;let l="warning"===t.type,r="cloudCheck"===t.type&&!m,i="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",o="text-blue-500",c="info";return l?(i="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",o="text-yellow-500",c="warning"):r&&(i="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",o="text-red-500",c="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${i}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${o}`,children:c}),(0,a.jsx)("p",{className:`text-sm ${n}`,children:y(`guides.${e}.notes.${s}`,t.text)})]},s)})}):null,L()&&t.guideSteps.map(s=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:s.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:y(`guides.${e}.steps.${s.step}.title`,s.title)}),s.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:y(`guides.${e}.steps.${s.step}.desc`,s.desc)}),"apiKeySelector"===s.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:P,onChange:e=>R(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>K(P,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===b?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:m?f("noApiKeysCreateOne"):"sk_omniroute"})}),"modelSelector"===s.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:k,onChange:e=>z(e.target.value),placeholder:f("modelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>v(!0),disabled:!I,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${I?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:f("selectModel")}),k&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>K(k,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===b?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>z(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:f("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),s.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:M(s.value)}),s.copyable&&(0,a.jsx)("button",{onClick:()=>K(s.value,`${s.step}-${s.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:b===`${s.step}-${s.title}`?"check":"content_copy"})})]})]})]},s.step)),L()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>K(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copy")]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:M(t.codeBlock.code)})})]}),L()&&(0,a.jsxs)("div",{className:"mt-2",children:[_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[U&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:F,disabled:!k,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),f("saveConfig")]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:U?"outline":"primary",size:"sm",onClick:()=>K(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copyConfig")]}),k&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),f("selectionSaved")]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:f("comingSoon")})}),(0,a.jsx)(r.rq,{isOpen:N,onClose:()=>v(!1),onSelect:e=>{z(e.value)},selectedModel:k,activeProviders:x,title:f("selectModel")})]})}function k({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,hasActiveProviders:x,cloudEnabled:m}){let u=(0,c.c)("cliTools"),[p,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(""),[w,C]=(0,l.useState)(null),[S,_]=(0,l.useState)({}),[A,O]=(0,l.useState)(!1),[E,T]=(0,l.useState)(null);(0,l.useEffect)(()=>{n?.length>0&&!v&&k(n[0].key)},[n,v]),(0,l.useEffect)(()=>{t&&!p&&($(),P())},[t,p]);let P=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&_(t)}}catch(e){console.log("Error loading saved mappings:",e)}},$=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();h(t)}}catch(e){console.log("Error fetching status:",e),h({running:!1})}},z="u">typeof navigator&&navigator.userAgent?.includes("Windows"),R=async e=>{f(!0),C(null);try{let t=v?.trim()||(n?.length>0?n[0].key:null)||(m?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(C({type:"success",text:u("mitmStarted")}),b(!1),N(""),$()):C({type:"error",text:a.error||u("failedStart")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},M=async e=>{f(!0),C(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(C({type:"success",text:u("mitmStopped")}),b(!1),N(""),$()):C({type:"error",text:s.error||u("failedStop")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},K=()=>{j.trim()?p?.running?M(j):R(j):C({type:"error",text:u("sudoPasswordRequiredError")})},I=(e,t)=>{_(s=>({...s,[e]:t}))},D=async()=>{f(!0),C(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:S})});if(!e.ok){let t=await e.json();throw Error(t.error||u("failedSaveMappings"))}C({type:"success",text:u("mappingsSaved")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},F=p?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),F?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:u("active")}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:u("inactive")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:u("toolDescriptions.antigravity")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:F?(0,a.jsxs)("button",{onClick:()=>{z||p?.hasCachedPassword?M(""):(b(!0),C(null))},disabled:g,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),u("stopMitm")]}):(0,a.jsxs)("button",{onClick:()=>{z||p?.hasCachedPassword?R(""):(b(!0),C(null))},disabled:g||!x,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),u("startMitm")]})}),w?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:w.text})]}),F&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:u("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:v,onChange:e=>k(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?u("noApiKeysCreateOne"):u("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>I(e.alias,t.target.value),placeholder:u("modelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{T(e.alias),O(!0)},disabled:!x,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${x?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:u("select")}),S[e.alias]&&(0,a.jsx)("button",{onClick:()=>I(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:u("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:D,disabled:g||0===Object.keys(S).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),u("saveMappings")]})})]}),!F&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:u("howItWorks")})," ",u("antigravityHowWorksDesc")]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:u("antigravityStep1")}),(0,a.jsxs)("span",{children:[u("antigravityStep2Prefix")," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ",u("antigravityStep2Suffix")]}),(0,a.jsx)("span",{children:u("antigravityStep3")})]})]})]}),(0,a.jsx)(r.aF,{isOpen:y,onClose:()=>{b(!1),N(""),C(null)},title:u("sudoPasswordRequiredTitle"),size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("sudoPasswordHint")})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:u("enterSudoPassword"),value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||g||K()}}),w&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,a.jsx)("span",{children:w.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{b(!1),N(""),C(null)},disabled:g,children:u("cancel")}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:K,loading:g,children:u("confirm")})]})]})}),(0,a.jsx)(r.rq,{isOpen:A,onClose:()=>O(!1),onSelect:e=>{E&&_(t=>({...t,[E]:e.value}))},selectedModel:E?S[E]:null,activeProviders:d,title:u("selectModelForAlias",{alias:E||""})})]})}function w({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d=[],hasActiveProviders:x=!1,cloudEnabled:m=!1,batchStatus:u}){let p=(0,c.c)("cliTools"),[h,g]=(0,l.useState)(null),[f,y]=(0,l.useState)(()=>{try{let e=localStorage.getItem("omniroute-copilot-selected-models");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}),[b,j]=(0,l.useState)(()=>{{let e=localStorage.getItem("omniroute-cli-key-copilot");if(e&&n?.some(t=>t.key===e))return e}return n?.length>0?n[0].key:""}),[N,v]=(0,l.useState)(128e3),[k,w]=(0,l.useState)(16e3),[C,S]=(0,l.useState)(!0),[_,A]=(0,l.useState)(!1),[O,E]=(0,l.useState)([]),[T,P]=(0,l.useState)(!1),[$,z]=(0,l.useState)("");(0,l.useEffect)(()=>{if(!t||T)return;let e=!1;return fetch("/v1/models").then(e=>e.json()).then(t=>{e||(E((t.data||[]).filter(e=>e&&!e.type&&!e.parent&&e.id).map(e=>({value:e.id,label:e.id}))),P(!0))}).catch(()=>{e||P(!0)}),()=>{e=!0}},[t,T]);let R=$?O.filter(e=>e.label.toLowerCase().includes($.toLowerCase())):O;(0,l.useEffect)(()=>{f.size>0&&localStorage.setItem("omniroute-copilot-selected-models",JSON.stringify([...f]))},[f]);let M=()=>JSON.stringify({name:"OmniRoute",vendor:"azure",apiKey:"${input:chat.lm.secret.omniroute}",models:[...f].map(e=>({id:e,name:e,url:`${i}/v1/chat/completions#models.ai.azure.com`,toolCalling:C,vision:_,maxInputTokens:N,maxOutputTokens:k}))},null,2),K=async(e,t)=>{await navigator.clipboard.writeText(e),g(t),setTimeout(()=>g(null),2e3)};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:e.image||"/providers/copilot.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),p("guide")]})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,a.jsxs)("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[(0,a.jsx)("p",{className:"font-medium",children:"GitHub Copilot Config Generator"}),(0,a.jsxs)("p",{className:"mt-1 text-xs opacity-80",children:["Generates the"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"chatLanguageModels.json"})," ","block for VS Code GitHub Copilot using the Azure vendor pattern. Select the models you want, then copy the JSON into your config file."]})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,a.jsxs)("p",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:["This configuration uses the Azure vendor workaround for custom model lists. Tested with ",(0,a.jsx)("strong",{children:"VS Code ≥ 1.109"})," and"," ",(0,a.jsx)("strong",{children:"GitHub Copilot Chat ≥ v0.37"}),". Future extension updates may change this behavior."]})]}),m&&n?.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:"1"}),(0,a.jsx)("span",{className:"font-medium text-sm",children:"API Key"})]}),(0,a.jsx)("select",{value:b,onChange:e=>{var t;j(t=e.target.value),t&&localStorage.setItem("omniroute-cli-key-copilot",t)},className:"w-full px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:m&&n?.length>0?"2":"1"}),(0,a.jsxs)("span",{className:"font-medium text-sm",children:["Select Models (",f.size,"/",R.length,")"]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>{y(new Set(O.map(e=>e.value)))},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Select All"}),(0,a.jsx)("button",{onClick:()=>{y(new Set)},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Clear"})]})]}),(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsx)("input",{type:"text",value:$,onChange:e=>z(e.target.value),placeholder:"Filter models...",className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})}),T||0!==O.length?0===R.length&&0===O.length?(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,a.jsx)("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:p("noActiveProviders")})]}):(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border bg-bg-secondary",children:R.map(e=>(0,a.jsxs)("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-bg-tertiary cursor-pointer border-b border-border last:border-0 transition-colors",children:[(0,a.jsx)("input",{type:"checkbox",checked:f.has(e.value),onChange:()=>{var t;return t=e.value,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"rounded border-border text-primary accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm font-mono truncate",children:e.label})]},e.value))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Loading models..."})]})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base group-open:rotate-90 transition-transform",children:"chevron_right"}),"Advanced Options"]}),(0,a.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 pl-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Input Tokens"}),(0,a.jsx)("input",{type:"number",value:N,onChange:e=>v(Number(e.target.value)||128e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Output Tokens"}),(0,a.jsx)("input",{type:"number",value:k,onChange:e=>w(Number(e.target.value)||16e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>S(e.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm",children:"Tool Calling"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:_,onChange:e=>A(e.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm",children:"Vision"})]})]})]}),f.size>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:m&&n?.length>0?"3":"2"}),(0,a.jsxs)("span",{className:"font-medium text-sm",children:["Copy Config (",f.size," model",1!==f.size?"s":"",")"]})]}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:()=>K(M(),"config"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"config"===h?"check":"content_copy"}),p("config"===h?"copied":"copyConfig")]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto max-h-80",children:(0,a.jsx)("code",{className:"text-xs font-mono whitespace-pre text-text-main",children:M()})}),(0,a.jsxs)("div",{className:"mt-3 p-3 bg-bg-secondary rounded-lg border border-border",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Paste into: "}),(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"~/.config/Code/User/chatLanguageModels.json"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Then reload VS Code and set the API key in the input prompt."})]})]})]})})]})}let C="https://cloud.omniroute.online";function S({machineId:e}){let t,s,o,d=(0,c.c)("cliTools"),[x,m]=(0,l.useState)([]),[h,f]=(0,l.useState)(!0),[b,S]=(0,l.useState)(null),[_,A]=(0,l.useState)({}),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)([]),[$,z]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1);(0,l.useEffect)(()=>{F(),K(),I(),D()},[]);let K=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();E(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},I=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();P(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},D=async()=>{try{let e=new AbortController,t=setTimeout(()=>e.abort(),8e3),s=await fetch("/api/cli-tools/status",{signal:e.signal});if(clearTimeout(t),s.ok){let e=await s.json();z(e||{})}}catch(e){console.log("CLI tool status check timed out or failed:",e)}finally{M(!0)}},F=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},U=()=>x.filter(e=>!1!==e.isActive),L=(0,l.useCallback)((e,t,s)=>{A(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(h||!R)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let B=(t=U(),s=[],o=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider;(0,n.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!B&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:d("noActiveProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:d("noActiveProvidersDesc")})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:b===e,onToggle:()=>S(b===e?null:e),baseUrl:O&&C?C:window.location.origin,apiKeys:T,batchStatus:$[e]||null,lastConfiguredAt:$[e]?.lastConfiguredAt||null};switch(e){case"claude":return(0,a.jsx)(u,{...s,activeProviders:U(),modelMappings:_[e]||{},onModelMappingChange:(t,s)=>L(e,t,s),hasActiveProviders:B,cloudEnabled:O},e);case"codex":return(0,a.jsx)(p,{...s,activeProviders:U(),cloudEnabled:O},e);case"droid":return(0,a.jsx)(g,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"openclaw":return(0,a.jsx)(y,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"antigravity":return(0,a.jsx)(k,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"cline":return(0,a.jsx)(j,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"kilo":return(0,a.jsx)(N,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"copilot":return(0,a.jsx)(w,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);default:return(0,a.jsx)(v,{toolId:e,...s,activeProviders:U(),cloudEnabled:O},e)}})(e,t))})]})}},44058:(e,t,s)=>{Promise.resolve().then(s.bind(s,22611))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=44058)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{33049:(e,s,t)=>{Promise.resolve().then(t.bind(t,40877))},40877:(e,s,t)=>{"use strict";t.d(s,{default:()=>x});var i=t(95155),l=t(12115),r=t(14051),a=t.n(r),n=t(40993),o=t(30949),d=t(20909),c=t(50910);let m=15e3;function x({machineId:e}){let s=(0,c.c)("endpoint"),t=(0,c.c)("common"),[r,a]=(0,l.useState)([]),[x,g]=(0,l.useState)(!0),[h,b]=(0,l.useState)([]),[f,y]=(0,l.useState)(null),[j,v]=(0,l.useState)(!1),[N,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[T,S]=(0,l.useState)(!1),[_,$]=(0,l.useState)(null),[E,R]=(0,l.useState)(""),[q,U]=(0,l.useState)(!1),[B,M]=(0,l.useState)(null),[D,O]=(0,l.useState)("https://cloud.omniroute.online"),{copied:P,copy:A}=(0,o.C)();(0,l.useEffect)(()=>{Q(),z(),F()},[]);let F=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let s=await e.json();b(s.data||[])}}catch(e){console.log("Error fetching models:",e)}},W=(0,l.useMemo)(()=>{let e=h.filter(e=>!e.type&&!e.parent),s=h.filter(e=>"embedding"===e.type&&!e.parent),t=h.filter(e=>"image"===e.type&&!e.parent),i=h.filter(e=>"rerank"===e.type&&!e.parent),l=h.filter(e=>"audio"===e.type&&"transcription"===e.subtype&&!e.parent);return{chat:e,embeddings:s,images:t,rerank:i,audioTranscription:l,audioSpeech:h.filter(e=>"audio"===e.type&&"speech"===e.subtype&&!e.parent),moderation:h.filter(e=>"moderation"===e.type&&!e.parent)}},[h]);(0,l.useMemo)(()=>Object.entries(d.Q2).map(([e,s])=>{let t=r.filter(s=>s.provider===e),i=t.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,l=t.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length;return{id:e,provider:s,total:t.length,connected:i,errors:l}}),[r]);let I=async(e,t=m)=>{let i=new AbortController,l=setTimeout(()=>i.abort(),t);try{let s=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e}),signal:i.signal}),t=await s.json().catch(()=>({}));return{ok:s.ok,status:s.status,data:t}}catch(e){if(e?.name==="AbortError")return{ok:!1,status:408,data:{error:s("cloudRequestTimeout")}};return{ok:!1,status:500,data:{error:e.message||s("cloudRequestFailed")}}}finally{clearTimeout(l)}},z=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();v(s.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},Q=async()=>{try{let e=await fetch("/api/providers"),s=await e.json();e.ok&&a(s.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{g(!1)}},L=e=>{e?k(!0):C(!0)};(0,l.useEffect)(()=>{if(_){let e=setTimeout(()=>$(null),5e3);return()=>clearTimeout(e)}},[_]);let V=()=>{globalThis.dispatchEvent(new Event("cloud-status-changed"))},G=async()=>{S(!0),U(!1),R("syncing");try{let{ok:e,status:t,data:i}=await I("enable");if(e)R("verifying"),await new Promise(e=>setTimeout(e,600)),v(!0),R("done"),U(!0),S(!1),V(),await new Promise(e=>setTimeout(e,1200)),k(!1),U(!1),i.verified?$({type:"success",message:s("cloudConnectedVerified")}):$({type:"warning",message:i.verifyError?s("connectedVerificationPendingWithError",{error:i.verifyError}):s("connectedVerificationPending")}),i.createdKey&&await Q(),i.cloudUrl&&O(i.cloudUrl),await z();else{let e=i.error||s("failedEnable");(502===t||408===t)&&(e=s("cloudWorkerUnreachable")),$({type:"error",message:e}),k(!1)}}catch(e){$({type:"error",message:e.message||s("connectionFailed")}),k(!1)}finally{S(!1),R("")}},Z=async()=>{S(!0),R("syncing");try{await I("sync"),R("disabling");let{ok:e,data:t}=await I("disable");e?(v(!1),$({type:"success",message:s("cloudDisabledSuccess")}),C(!1),V(),await z()):$({type:"error",message:t.error||s("failedDisable")})}catch(e){console.log("Error disabling cloud:",e),$({type:"error",message:s("failedDisable")})}finally{S(!1),R("")}},[J,K]=(0,l.useState)("/v1"),Y=D?`${D}/v1`:null;if((0,l.useEffect)(()=>{K(`${window.location.origin}/v1`)},[]),x)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(n.Qv,{}),(0,i.jsx)(n.Qv,{})]});let H=j&&Y?Y:J;return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsxs)(n.Zp,{className:"",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:s("title")}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:j?s("usingCloudProxy"):s("usingLocalServer")}),e&&(0,i.jsx)("p",{className:"text-xs text-text-muted mt-1",children:s("machineId",{id:e.slice(0,8)})})]}),(0,i.jsx)("div",{className:"flex items-center gap-2",children:j?(0,i.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>L(!1),disabled:T,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:s("disableCloud")}):(0,i.jsx)(n.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>L(!0),disabled:T,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:s("enableCloud")})})]}),_&&(0,i.jsxs)("div",{className:`flex items-center gap-2 px-4 py-2.5 rounded-lg mb-4 text-sm font-medium animate-in fade-in slide-in-from-top-2 duration-300 ${"success"===_.type?"bg-green-500/10 border border-green-500/30 text-green-400":"warning"===_.type?"bg-amber-500/10 border border-amber-500/30 text-amber-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"success"===_.type?"check_circle":"warning"===_.type?"warning":"error"}),(0,i.jsx)("span",{className:"flex-1",children:_.message}),(0,i.jsx)("button",{onClick:()=>$(null),className:"p-0.5 hover:bg-white/10 rounded transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}),(0,i.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,i.jsx)(n.pd,{value:H,readOnly:!0,className:`flex-1 font-mono text-sm ${j?"animate-border-glow":""}`}),(0,i.jsx)(n.$n,{variant:"secondary",icon:"endpoint_url"===P?"check":"content_copy",onClick:()=>A(H,"endpoint_url"),children:t("endpoint_url"===P?"copied":"copy")})]})]}),(0,i.jsxs)(n.Zp,{children:[(0,i.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:s("available")}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:s("modelsAcrossEndpoints",{models:Object.values(W).reduce((e,s)=>e+s.length,0),endpoints:[W.chat,W.embeddings,W.images,W.rerank,W.audioTranscription,W.audioSpeech,W.moderation].filter(e=>e.length>0).length+2})})]})}),(0,i.jsxs)("div",{className:"mb-6",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm text-primary",children:"hub"}),(0,i.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryCore")||"Core APIs"}),(0,i.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(u,{icon:"chat",iconColor:"text-blue-500",iconBg:"bg-blue-500/10",title:s("chatCompletions"),path:"/v1/chat/completions",description:s("chatDesc"),models:W.chat,expanded:"chat"===f,onToggle:()=>y("chat"===f?null:"chat"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"code",iconColor:"text-indigo-500",iconBg:"bg-indigo-500/10",title:s("responses")||"Responses API",path:"/v1/responses",description:s("responsesDesc")||"OpenAI Responses API for Codex and advanced agentic workflows",models:W.chat,expanded:"responses"===f,onToggle:()=>y("responses"===f?null:"responses"),copy:A,copied:P,baseUrl:H})]})]}),(0,i.jsxs)("div",{className:"mb-6",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm text-purple-400",children:"perm_media"}),(0,i.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryMedia")||"Media & Multi-Modal"}),(0,i.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(u,{icon:"data_array",iconColor:"text-emerald-500",iconBg:"bg-emerald-500/10",title:s("embeddings"),path:"/v1/embeddings",description:s("embeddingsDesc"),models:W.embeddings,expanded:"embeddings"===f,onToggle:()=>y("embeddings"===f?null:"embeddings"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"image",iconColor:"text-purple-500",iconBg:"bg-purple-500/10",title:s("imageGeneration"),path:"/v1/images/generations",description:s("imageDesc"),models:W.images,expanded:"images"===f,onToggle:()=>y("images"===f?null:"images"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"mic",iconColor:"text-rose-500",iconBg:"bg-rose-500/10",title:s("audioTranscription"),path:"/v1/audio/transcriptions",description:s("audioTranscriptionDesc"),models:W.audioTranscription,expanded:"audioTranscription"===f,onToggle:()=>y("audioTranscription"===f?null:"audioTranscription"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"record_voice_over",iconColor:"text-cyan-500",iconBg:"bg-cyan-500/10",title:s("textToSpeech"),path:"/v1/audio/speech",description:s("textToSpeechDesc"),models:W.audioSpeech,expanded:"audioSpeech"===f,onToggle:()=>y("audioSpeech"===f?null:"audioSpeech"),copy:A,copied:P,baseUrl:H})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm text-amber-400",children:"build"}),(0,i.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryUtility")||"Utility & Management"}),(0,i.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(u,{icon:"sort",iconColor:"text-amber-500",iconBg:"bg-amber-500/10",title:s("rerank"),path:"/v1/rerank",description:s("rerankDesc"),models:W.rerank,expanded:"rerank"===f,onToggle:()=>y("rerank"===f?null:"rerank"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"shield",iconColor:"text-orange-500",iconBg:"bg-orange-500/10",title:s("moderations"),path:"/v1/moderations",description:s("moderationsDesc"),models:W.moderation,expanded:"moderation"===f,onToggle:()=>y("moderation"===f?null:"moderation"),copy:A,copied:P,baseUrl:H}),(0,i.jsx)(u,{icon:"list",iconColor:"text-teal-500",iconBg:"bg-teal-500/10",title:s("listModels")||"List Models",path:"/v1/models",description:s("listModelsDesc")||"List all available models across all connected providers",models:[],expanded:"models"===f,onToggle:()=>y("models"===f?null:"models"),copy:A,copied:P,baseUrl:H})]})]})]}),(0,i.jsx)(n.aF,{isOpen:N,title:s("enableCloudTitle"),onClose:()=>k(!1),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:s("whatYouGet")}),(0,i.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,i.jsxs)("li",{children:["• ",s("cloudBenefitAccess")]}),(0,i.jsxs)("li",{children:["• ",s("cloudBenefitShare")]}),(0,i.jsxs)("li",{children:["• ",s("cloudBenefitPorts")]}),(0,i.jsxs)("li",{children:["• ",s("cloudBenefitEdge")]})]})]}),(0,i.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:t("note")}),(0,i.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,i.jsxs)("li",{children:["• ",s("cloudSessionNote")]}),(0,i.jsxs)("li",{children:["• ",s("cloudUnstableNote")]})]})]}),(T||q)&&(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border transition-all duration-300 ${q?"bg-green-500/10 border-green-500/30":"bg-primary/10 border-primary/30"}`,children:[q?(0,i.jsx)("span",{className:"material-symbols-outlined text-green-500 text-xl",children:"check_circle"}):(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,i.jsx)("div",{className:"flex-1",children:(0,i.jsxs)("p",{className:`text-sm font-medium ${q?"text-green-500":"text-primary"}`,children:[q&&s("cloudConnected"),!q&&"syncing"===E&&s("connectingToCloud"),!q&&"verifying"===E&&s("verifyingConnection")]})})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(n.$n,{onClick:G,fullWidth:!0,disabled:T||q,children:T?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===E?s("connecting"):s("verifying")]}):q?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"}),s("connected")]}):s("enableCloud")}),(0,i.jsx)(n.$n,{onClick:()=>k(!1),variant:"ghost",fullWidth:!0,disabled:T||q,children:t("cancel")})]})]})}),(0,i.jsx)(n.aF,{isOpen:w,title:s("disableCloudTitle"),onClose:()=>!T&&C(!1),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:t("warning")}),(0,i.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:s("disableWarning")})]})]})}),T&&(0,i.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,i.jsx)("div",{className:"flex-1",children:(0,i.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===E&&s("syncingData"),"disabling"===E&&s("disablingCloud")]})})]}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:s("disableConfirm")}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(n.$n,{onClick:Z,fullWidth:!0,disabled:T,className:"bg-red-500! hover:bg-red-600! text-white!",children:T?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===E?s("syncing"):s("disabling")]}):s("disableCloud")}),(0,i.jsx)(n.$n,{onClick:()=>C(!1),variant:"ghost",fullWidth:!0,disabled:T,children:t("cancel")})]})]})}),B&&(0,i.jsx)(p,{provider:B,models:h,copy:A,copied:P,onClose:()=>M(null)})]})}function p({provider:e,models:s,copy:t,copied:r,onClose:a}){let o=(0,c.c)("endpoint"),d=(0,c.c)("common"),m=e.provider.alias||e.id,x=(0,l.useMemo)(()=>s.filter(s=>!s.parent&&(s.owned_by===m||s.owned_by===e.id)),[s,m,e.id]),p=x.filter(e=>!e.type),u=x.filter(e=>"embedding"===e.type),g=x.filter(e=>"image"===e.type),h=(e,s,l)=>0===l.length?null:(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsxs)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s}),e," (",l.length,")"]}),(0,i.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>{let s=`modal-${e.id}`;return(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface/60 group",children:[(0,i.jsx)("code",{className:"text-sm font-mono flex-1 truncate",children:e.id}),e.custom&&(0,i.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:o("custom")}),(0,i.jsx)("button",{onClick:()=>t(e.id,s),className:"p-1 hover:bg-sidebar rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-opacity",title:d("copy"),children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===s?"check":"content_copy"})})]},e.id)})})]});return(0,i.jsx)(n.aF,{isOpen:!0,onClose:a,title:o("providerModelsTitle",{provider:e.provider.name}),children:(0,i.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:0===x.length?(0,i.jsx)("p",{className:"text-sm text-text-muted py-4 text-center",children:o("noModelsForProvider")}):(0,i.jsxs)(i.Fragment,{children:[h(o("chat"),"chat",p),h(o("embedding"),"data_array",u),h(o("image"),"image",g)]})})})}function u({icon:e,iconColor:s,iconBg:t,title:r,path:a,description:n,models:o,expanded:m,onToggle:x,copy:p,copied:u,baseUrl:g}){let h=(0,c.c)("endpoint"),b=(0,l.useMemo)(()=>{let e={};for(let s of o){let t=s.owned_by||"unknown";e[t]||(e[t]=[]),e[t].push(s)}return Object.entries(e).sort((e,s)=>s[1].length-e[1].length)},[o]),f=e=>d.Q2[e]||(0,d.zt)(e),y=`endpoint_${a}`;return(0,i.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,i.jsxs)("button",{onClick:x,className:"w-full flex items-center gap-3 p-4 hover:bg-surface/50 transition-colors text-left",children:[(0,i.jsx)("div",{className:`flex items-center justify-center size-10 rounded-lg ${t} shrink-0`,children:(0,i.jsx)("span",{className:`material-symbols-outlined text-xl ${s}`,children:e})}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"font-semibold text-sm",children:r}),(0,i.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-surface text-text-muted font-medium",children:h("modelsCount",{count:o.length})})]}),(0,i.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:n})]}),(0,i.jsx)("span",{className:`material-symbols-outlined text-text-muted text-lg transition-transform ${m?"rotate-180":""}`,children:"expand_more"})]}),m&&(0,i.jsxs)("div",{className:"border-t border-border px-4 pb-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-3 mb-3",children:[(0,i.jsxs)("code",{className:"flex-1 text-xs font-mono text-text-muted bg-surface/80 px-3 py-1.5 rounded-lg truncate",children:[g.replace(/\/v1$/,""),a]}),(0,i.jsx)("button",{onClick:()=>p(`${g.replace(/\/v1$/,"")}${a}`,y),className:"p-1.5 hover:bg-surface rounded-lg text-text-muted hover:text-primary transition-colors shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:u===y?"check":"content_copy"})})]}),(0,i.jsx)("div",{className:"flex flex-col gap-2",children:b.map(([e,s])=>(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,i.jsx)("div",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:f(e)?.color||"#888"}}),(0,i.jsx)("span",{className:"text-xs font-semibold text-text-main",children:f(e)?.name||e}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["(",s.length,")"]})]}),(0,i.jsx)("div",{className:"ml-5 flex flex-wrap gap-1.5",children:s.map(e=>(0,i.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-md bg-surface/80 text-text-muted font-mono",title:e.id,children:e.root||e.id.split("/").pop()},e.id))})]},e))})]})]})}x.propTypes={machineId:a().string.isRequired},p.propTypes={provider:a().object.isRequired,models:a().array.isRequired,copy:a().func.isRequired,copied:a().string,onClose:a().func.isRequired},u.propTypes={icon:a().string.isRequired,iconColor:a().string.isRequired,iconBg:a().string.isRequired,title:a().string.isRequired,path:a().string.isRequired,description:a().string.isRequired,models:a().array.isRequired,expanded:a().bool.isRequired,onToggle:a().func.isRequired,copy:a().func.isRequired,copied:a().string,baseUrl:a().string.isRequired}}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=33049)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1066],{73732:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(95155),r=s(12115),l=s(40993),n=s(50910),i=s(5772),c=s(35144);function o(e){let t="string"==typeof e?e.trim():"";if(!t)return{key:"unknown",label:"Unknown",variant:"default",rank:0,raw:null};let s=t.toUpperCase();return s.includes("ENTERPRISE")||s.includes("CORP")||s.includes("ORG")?{key:"enterprise",label:"Enterprise",variant:"info",rank:7,raw:t}:s.includes("TEAM")||s.includes("CHATGPTTEAM")?{key:"team",label:"Team",variant:"info",rank:6,raw:t}:s.includes("BUSINESS")||s.includes("STANDARD")||s.includes("BIZ")?{key:"business",label:"Business",variant:"warning",rank:5,raw:t}:s.includes("ULTRA")?{key:"ultra",label:"Ultra",variant:"success",rank:4,raw:t}:s.includes("PRO")||s.includes("PREMIUM")?{key:"pro",label:"Pro",variant:"primary",rank:3,raw:t}:s.includes("PLUS")||s.includes("PAID")?{key:"plus",label:"Plus",variant:"secondary",rank:2,raw:t}:s.includes("FREE")||s.includes("INDIVIDUAL")||s.includes("BASIC")||s.includes("TRIAL")||s.includes("LEGACY")?{key:"free",label:"Free",variant:"default",rank:1,raw:t}:{key:"unknown",label:t.toLowerCase().split(/[\s_-]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||"Unknown",variant:"default",rank:0,raw:t}}var d=s(81060),u=s(80927),x=s(92542),m=s(20909);let p={antigravity:{label:"Antigravity",color:"#F59E0B"},github:{label:"GitHub Copilot",color:"#333"},kiro:{label:"Kiro AI",color:"#FF6B35"},codex:{label:"OpenAI Codex",color:"#10A37F"},claude:{label:"Claude Code",color:"#D97757"}},h=[{key:"all",labelKey:"tierAll"},{key:"enterprise",labelKey:"tierEnterprise"},{key:"team",labelKey:"tierTeam"},{key:"business",labelKey:"tierBusiness"},{key:"ultra",labelKey:"tierUltra"},{key:"pro",labelKey:"tierPro"},{key:"plus",labelKey:"tierPlus"},{key:"free",labelKey:"tierFree"},{key:"unknown",labelKey:"tierUnknown"}];function f(){let e=(0,n.c)("usage"),[t,s]=(0,r.useState)([]),[l,f]=(0,r.useState)({}),[b,g]=(0,r.useState)({}),[y,j]=(0,r.useState)({}),[v,k]=(0,r.useState)(!0),[N,w]=(0,r.useState)(null),[S,E]=(0,r.useState)(!1),[A,C]=(0,r.useState)(120),[I,M]=(0,r.useState)(!0),[P,T]=(0,r.useState)("all"),q=(0,r.useRef)(null),F=(0,r.useRef)(null),_=(0,r.useRef)({}),K=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed");let t=(await e.json()).connections||[];return s(t),t}catch{return s([]),[]}},[]),L=(0,r.useCallback)(async(e,t)=>{let s=Date.now();if(!(s-(_.current[e]||0)<3e4)){_.current[e]=s,g(t=>({...t,[e]:!0})),j(t=>({...t,[e]:null}));try{let s=await fetch(`/api/usage/${e}`);if(!s.ok){let t=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return;if(401===s.status)return void f(s=>({...s,[e]:{quotas:[],message:t}}));throw Error(`HTTP ${s.status}: ${t}`)}let a=await s.json(),r=function(e,t){if(!t||"object"!=typeof t)return[];let s=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"claude":t.message?s.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,c.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));s.sort((t,s)=>{let a=t.modelKey||t.name,r=s.modelKey||s.name;return(e.get(a)??999)-(e.get(r)??999)})}return s}(t,a);f(t=>({...t,[e]:{quotas:r,plan:a.plan||null,message:a.message||null,raw:a}}))}catch(t){j(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{g(t=>({...t,[e]:!1}))}}},[]),R=(0,r.useCallback)(async(e,t)=>{await L(e,t),w(new Date)},[L]),D=(0,r.useCallback)(async()=>{if(!S){E(!0),C(120);try{let e=(await K()).filter(e=>m.wb.includes(e.provider)&&"oauth"===e.authType);await Promise.all(e.map(e=>L(e.id,e.provider))),w(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{E(!1)}}},[S,K,L]);(0,r.useEffect)(()=>{(async()=>{M(!0),await D(),M(!1)})()},[]),(0,r.useEffect)(()=>{if(!v){q.current&&clearInterval(q.current),F.current&&clearInterval(F.current);return}return q.current=setInterval(D,12e4),F.current=setInterval(()=>{C(e=>e<=1?120:e-1)},1e3),()=>{q.current&&clearInterval(q.current),F.current&&clearInterval(F.current)}},[v,D]),(0,r.useEffect)(()=>{let e=()=>{document.hidden?(q.current&&clearInterval(q.current),F.current&&clearInterval(F.current)):v&&(q.current=setInterval(D,12e4),F.current=setInterval(()=>{C(e=>e<=1?120:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[v,D]);let O=(0,r.useMemo)(()=>t.filter(e=>m.wb.includes(e.provider)&&"oauth"===e.authType),[t]),U=(0,r.useMemo)(()=>{let e={antigravity:1,github:2,codex:3,claude:4,kiro:5};return[...O].sort((t,s)=>(e[t.provider]||9)-(e[s.provider]||9))},[O]),$=(0,r.useMemo)(()=>{let e={};for(let t of U)e[t.id]=o(l[t.id]?.plan);return e},[U,l]),B=(0,r.useMemo)(()=>{let e={all:U.length,enterprise:0,team:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of U){let s=$[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[U,$]),G=(0,r.useMemo)(()=>"all"===P?U:U.filter(e=>($[e.id]?.key||"unknown")===P),[U,$,P]);return I?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(x.CardSkeleton,{}),(0,a.jsx)(x.CardSkeleton,{})]}):0===U.length?(0,a.jsx)(d.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] opacity-15",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-main",children:e("noProviders")}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-[400px] mx-auto",children:e("connectProvidersForQuota")})]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main m-0",children:e("providerLimits")}),(0,a.jsxs)("span",{className:"text-[13px] text-text-muted",children:[e("accountsCount",{count:G.length}),G.length!==U.length&&` ${e("filteredFromCount",{count:U.length})}`]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>k(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/[0.08] bg-transparent cursor-pointer text-text-main text-[13px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:v?"#22c55e":"var(--text-muted)"},children:v?"toggle_on":"toggle_off"}),e("autoRefresh"),v&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["(",A,"s)"]})]}),(0,a.jsxs)("button",{onClick:D,disabled:S,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-white/[0.06] border border-white/10 text-text-main text-[13px] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${S?"animate-spin":""}`,children:"refresh"}),e("refreshAll")]})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:h.map(t=>{if("all"!==t.key&&!B[t.key])return null;let s=P===t.key;return(0,a.jsxs)("button",{onClick:()=>T(t.key),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold cursor-pointer",style:{border:s?"1px solid var(--primary, #E54D5E)":"1px solid rgba(255,255,255,0.12)",background:s?"rgba(249,120,21,0.14)":"transparent",color:s?"var(--primary, #E54D5E)":"var(--text-muted)"},children:[(0,a.jsx)("span",{children:e(t.labelKey)}),(0,a.jsx)("span",{className:"opacity-85",children:B[t.key]||0})]},t.key)})}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] overflow-hidden bg-black/15",children:[(0,a.jsxs)("div",{className:"items-center px-4 py-2.5 border-b border-white/[0.06] text-[11px] font-semibold uppercase tracking-wider text-text-muted",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px"},children:[(0,a.jsx)("div",{children:e("account")}),(0,a.jsx)("div",{children:e("modelQuotas")}),(0,a.jsx)("div",{className:"text-center",children:e("lastUsed")}),(0,a.jsx)("div",{className:"text-center",children:e("actions")})]}),G.map((t,s)=>{let r=l[t.id],n=b[t.id],c=y[t.id],d=p[t.provider]||{label:t.provider,color:"#666"},x=$[t.id]||o(null);return(0,a.jsxs)("div",{className:"items-center px-4 py-3.5 transition-[background] duration-150 hover:bg-white/[0.02]",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px",borderBottom:s<G.length-1?"1px solid rgba(255,255,255,0.04)":"none"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden shrink-0",children:(0,a.jsx)(i.default,{src:`/providers/${t.provider}.png`,alt:t.provider,width:32,height:32,className:"object-contain",sizes:"32px"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[13px] font-semibold text-text-main truncate",children:t.name||d.label}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,a.jsx)("span",{title:r?.plan?e("rawPlanWithValue",{plan:r.plan}):e("noPlanFromProvider"),children:(0,a.jsx)(u.default,{variant:x.variant,size:"sm",dot:!0,children:x.label})}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:d.label})]})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 pr-3",children:n?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),e("loadingQuotas")]}):c?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[300px]",children:c})]}):r?.message&&(!r.quotas||0===r.quotas.length)?(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:r.message}):r?.quotas?.length>0?r.quotas.map((e,t)=>{var s,r,l;let n=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):(s=e.used,(r=e.total)&&0!==r?!s||s<0?100:s>=r?0:Math.round((r-s)/r*100):0),i=n>70?{bar:"#22c55e",text:"#22c55e",bg:"rgba(34,197,94,0.12)"}:n>=30?{bar:"#eab308",text:"#eab308",bg:"rgba(234,179,8,0.12)"}:{bar:"#ef4444",text:"#ef4444",bg:"rgba(239,68,68,0.12)"},c=function(e){if(!e)return null;try{let t=new Date(e)-new Date;if(t<=0)return null;let s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);if(s>=24){let e=Math.floor(s/24);return`${e}d ${s%24}h`}return`${s}h ${a}m`}catch{return null}}(e.resetAt),o={"gemini-3-pro-high":"G3 Pro","gemini-3-pro-low":"G3 Pro Low","gemini-3-flash":"G3 Flash","gemini-2.5-flash":"G2.5 Flash","claude-opus-4-6-thinking":"Opus 4.6 Tk","claude-opus-4-5-thinking":"Opus 4.5 Tk","claude-opus-4-5":"Opus 4.5","claude-sonnet-4-5-thinking":"Sonnet 4.5 Tk","claude-sonnet-4-5":"Sonnet 4.5",chat:"Chat",completions:"Completions",premium_interactions:"Premium",session:"Session",weekly:"Weekly",agentic_request:"Agentic",agentic_request_freetrial:"Agentic (Trial)"}[l=e.name]||l;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-[200px] shrink-0",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold py-0.5 px-2 rounded whitespace-nowrap min-w-[60px] text-center",style:{background:i.bg,color:i.text},children:o}),c&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:["⏱ ",c]}),(0,a.jsx)("div",{className:"flex-1 h-1.5 rounded-sm bg-white/[0.06] min-w-[60px] overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-sm transition-[width] duration-300 ease-out",style:{width:`${Math.min(n,100)}%`,background:i.bar}})}),(0,a.jsxs)("span",{className:"text-[11px] font-semibold min-w-[32px] text-right",style:{color:i.text},children:[n,"%"]})]},t)}):(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:e("noQuotaData")})}),(0,a.jsx)("div",{className:"text-center text-[11px] text-text-muted",children:N?(0,a.jsx)("span",{children:N.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}):"-"}),(0,a.jsx)("div",{className:"flex justify-center gap-0.5",children:(0,a.jsx)("button",{onClick:()=>R(t.id,t.provider),disabled:n,title:e("refreshQuota"),className:"p-1 rounded-md border-none bg-transparent cursor-pointer disabled:cursor-not-allowed disabled:opacity-30 opacity-60 hover:opacity-100 flex items-center justify-center transition-opacity duration-150",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] text-text-muted ${n?"animate-spin":""}`,children:"refresh"})})})]},t.id)}),0===G.length&&(0,a.jsxs)("div",{className:"py-6 px-4 text-center text-text-muted text-[13px]",children:[e("noAccountsForTierFilter")," ",(0,a.jsx)("strong",{children:e(h.find(e=>e.key===P)?.labelKey||"tierUnknown")}),"."]})]})]})}function b(){let e=(0,n.c)("usage"),t=(0,n.c)("common"),[s,i]=(0,r.useState)({lockouts:[],cacheStats:null}),[c,o]=(0,r.useState)(!0),d=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/rate-limits");e.ok&&i(await e.json())}catch{}finally{o(!1)}},[]);return(0,r.useEffect)(()=>{d();let e=setInterval(d,1e4);return()=>clearInterval(e)},[d]),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"lock_clock"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e("modelLockouts")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:e("lockoutsAutoRefreshHint")})]}),s.lockouts.length>0&&(0,a.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold bg-orange-500/10 text-orange-400 border border-orange-500/20",children:e("lockedCount",{count:s.lockouts.length})})]}),0===s.lockouts.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"lock_open"}),(0,a.jsx)("p",{className:"text-sm",children:e("noLockouts")})]}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s.lockouts.map((s,r)=>{var l;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-orange-500/5 border border-orange-500/15",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-orange-400","aria-hidden":"true",children:"lock"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:s.model}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[e("account"),":"," ",(0,a.jsx)("span",{className:"font-mono",children:s.accountId?.slice(0,12)||t("none")}),s.reason&&(0,a.jsxs)(a.Fragment,{children:[e("reasonSeparator"),s.reason]})]})]})]}),(0,a.jsx)("span",{className:"text-xs font-mono tabular-nums text-orange-400",children:e("timeLeft",{time:(l=s.remainingMs)<1e3?e("durationMillisecondsShort",{value:l}):l<6e4?e("durationSecondsShort",{value:Math.ceil(l/1e3)}):e("durationMinutesShort",{value:Math.ceil(l/6e4)})})})]},r)})})]})})}function g(){let e=(0,n.c)("usage"),[t,s]=(0,r.useState)({count:0,sessions:[]}),[i,c]=(0,r.useState)(!0),o=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/sessions");e.ok&&s(await e.json())}catch{}finally{c(!1)}},[]);return(0,r.useEffect)(()=>{o();let e=setInterval(o,5e3);return()=>clearInterval(e)},[o]),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e("activeSessions")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:e("sessionsTrackedHint")})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/20",children:[(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),(0,a.jsx)("span",{className:"text-sm font-semibold tabular-nums text-cyan-400",children:t.count})]})})]}),0===t.sessions.length?(0,a.jsxs)("div",{className:"text-center py-8 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[40px] mb-2 block opacity-40","aria-hidden":"true",children:"fingerprint"}),(0,a.jsx)("p",{className:"text-sm",children:e("noSessions")}),(0,a.jsx)("p",{className:"text-xs mt-1",children:e("sessionsHint")})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-border/30",children:[(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("session")}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("age")}),(0,a.jsx)("th",{className:"text-right py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("requests")}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("connection")})]})}),(0,a.jsx)("tbody",{children:t.sessions.map(t=>{var s;return(0,a.jsxs)("tr",{className:"border-b border-border/10 hover:bg-surface/20 transition-colors",children:[(0,a.jsx)("td",{className:"py-2.5 px-3",children:(0,a.jsxs)("span",{className:"font-mono text-xs px-2 py-1 rounded bg-surface/40 text-text-muted",children:[t.sessionId.slice(0,12),"…"]})}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-text-muted tabular-nums",children:(s=t.ageMs)<6e4?e("durationSecondsShort",{value:Math.floor(s/1e3)}):s<36e5?e("durationMinutesShort",{value:Math.floor(s/6e4)}):e("durationHoursShort",{value:Math.floor(s/36e5)})}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-right",children:(0,a.jsx)("span",{className:"font-semibold tabular-nums",children:t.requestCount})}),(0,a.jsx)("td",{className:"py-2.5 px-3",children:t.connectionId?(0,a.jsx)("span",{className:"text-xs font-mono text-cyan-400",children:t.connectionId.slice(0,10)}):(0,a.jsx)("span",{className:"text-text-muted/40",children:e("notAvailableSymbol")})})]},t.sessionId)})})]})})]})}function y(){return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)(l.Qv,{}),children:(0,a.jsx)(f,{})}),(0,a.jsx)(b,{}),(0,a.jsx)(g,{})]})}},86879:(e,t,s)=>{Promise.resolve().then(s.bind(s,73732))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=86879)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1606],{20433:(e,t,s)=>{Promise.resolve().then(s.bind(s,38701))},38701:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var a=s(95155),r=s(12115),l=s(50910);let i={image:{icon:"image",endpoint:"/api/v1/images/generations",label:"Image Generation",placeholder:"A serene landscape with mountains at sunset...",color:"from-purple-500 to-pink-500"},video:{icon:"videocam",endpoint:"/api/v1/videos/generations",label:"Video Generation",placeholder:"A timelapse of a flower blooming...",color:"from-blue-500 to-cyan-500"},music:{icon:"music_note",endpoint:"/api/v1/music/generations",label:"Music Generation",placeholder:"Upbeat electronic music with synth pads...",color:"from-orange-500 to-yellow-500"}};function n(){let e=(0,l.c)("media"),[t,s]=(0,r.useState)("image"),[n,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,x]=(0,r.useState)([]),[u,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),N=async e=>{b(!0);try{let t=await fetch(i[e].endpoint);if(t.ok){let e=(await t.json()).data||[];x(e),e.length>0&&c(e[0].id)}}catch{x([])}b(!1)},v=async()=>{if(n.trim()){p(!0),y(null),f(null);try{let e=i[t],s=await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d||void 0,prompt:n.trim(),..."image"===t?{size:"1024x1024",n:1}:{}})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||`Generation failed (${s.status})`)}let a=await s.json();f({type:t,data:a,timestamp:Date.now()})}catch(e){y(e.message||"Generation failed")}p(!1)}};(0,r.useState)(()=>{N("image")});let w=i[t];return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:e("title")}),(0,a.jsx)("p",{className:"text-text-muted text-sm mt-1",children:e("subtitle")})]}),(0,a.jsx)("div",{className:"flex gap-2 p-1 bg-surface/50 rounded-xl border border-black/5 dark:border-white/5",children:Object.keys(i).map(e=>{let r=i[e],l=e===t;return(0,a.jsxs)("button",{onClick:()=>{s(e),o(""),f(null),y(null),N(e)},className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all ${l?"bg-primary/10 text-primary shadow-sm border border-primary/20":"text-text-muted hover:text-text-main hover:bg-surface/80"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r.icon}),r.label]},e)})}),(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-6 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-text-main mb-2",children:e("model")}),h?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}),e("loadingModels")]}):m.length>0?(0,a.jsx)("select",{value:d,onChange:e=>c(e.target.value),className:"w-full px-3 py-2 rounded-lg bg-surface border border-black/10 dark:border-white/10 text-text-main text-sm focus:outline-none focus:ring-2 focus:ring-primary/30",children:m.map(e=>(0,a.jsx)("option",{value:e.id,children:e.id},e.id))}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:e("noModels")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-text-main mb-2",children:e("prompt")}),(0,a.jsx)("textarea",{rows:3,value:n,onChange:e=>o(e.target.value),placeholder:w.placeholder,className:"w-full px-3 py-2 rounded-lg bg-surface border border-black/10 dark:border-white/10 text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/30 resize-none"})]}),(0,a.jsx)("button",{onClick:v,disabled:u||!n.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg text-white font-medium transition-all bg-gradient-to-r ${w.color} ${u||!n.trim()?"opacity-50 cursor-not-allowed":"hover:opacity-90 hover:shadow-lg"}`,children:u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),e("generating")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"auto_awesome"}),e("generate")," ",w.label]})})]}),j&&(0,a.jsxs)("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-4 flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[20px] mt-0.5",children:"error"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-red-500",children:e("error")}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:j})]})]}),g&&(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] bg-gradient-to-r ${w.color} bg-clip-text text-transparent`,children:w.icon}),(0,a.jsx)("h3",{className:"text-sm font-medium text-text-main",children:e("result")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:new Date(g.timestamp).toLocaleTimeString()})]}),(0,a.jsx)("pre",{className:"bg-surface rounded-lg p-4 text-xs text-text-muted overflow-auto max-h-96 custom-scrollbar",children:JSON.stringify(g.data,null,2)})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Object.keys(i).map(t=>{let s=i[t];return(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center size-8 rounded-lg bg-gradient-to-r ${s.color}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-white text-[16px]",children:s.icon})}),(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:s.label})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e(`${t}Description`)}),(0,a.jsxs)("code",{className:"block mt-2 text-xs text-primary/70 bg-primary/5 rounded px-2 py-1",children:["POST ",s.endpoint]})]},t)})})]})}},50910:(e,t,s)=>{"use strict";s.d(t,{c:()=>l});var a=s(33418);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=r(0,a.c3);r(0,a.kc)}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=20433)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{14005:(e,s,t)=>{Promise.resolve().then(t.bind(t,49433))},49433:(e,s,t)=>{"use strict";t.d(s,{default:()=>h});var r=t(95155),l=t(50910),a=t(12115),i=t(14051),n=t.n(i),o=t(5772),d=t(98500),c=t.n(d),x=t(73321),m=t(40993),u=t(20909),p=t(67671);function h({machineId:e}){let s=(0,l.c)("home"),t=(0,l.c)("common"),i=(0,l.c)("sidebar"),[n,o]=(0,a.useState)([]),[d,x]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,j]=(0,a.useState)("/v1"),[v,N]=(0,a.useState)(null),[y,k]=(0,a.useState)({});(0,a.useEffect)(()=>{j(`${window.location.origin}/v1`)},[]);let w=(0,a.useCallback)(async()=>{try{let[e,s,t]=await Promise.all([fetch("/api/providers"),fetch("/api/models"),fetch("/api/provider-metrics")]);if(e.ok){let s=await e.json();o(s.connections||[])}if(s.ok){let e=await s.json();x(e.models||[])}if(t.ok){let e=await t.json();k(e.metrics||{})}}catch(e){console.log("Error fetching data:",e)}finally{h(!1)}},[]);(0,a.useEffect)(()=>{w()},[w]);let S=(0,a.useMemo)(()=>Object.entries(u.Q2).map(([e,s])=>{let t=n.filter(s=>s.provider===e),r=t.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,l=t.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length,a=new Set([e,s.alias].filter(Boolean)),i=d.filter(e=>a.has(e.provider)),o=u.IS[e]?"free":u.zN[e]?"oauth":"apikey";return{id:e,provider:s,total:t.length,connected:r,errors:l,modelCount:i.length,authType:o}}),[n,d]),R=(0,a.useMemo)(()=>{if(!v)return[];let e=new Set([v.id,v.provider?.alias].filter(Boolean));return d.filter(s=>e.has(s.provider))},[v,d]),q=[{label:s("documentation"),href:"/docs",icon:"menu_book"},{label:i("providers"),href:"/dashboard/providers",icon:"dns"},{label:i("combos"),href:"/dashboard/combos",icon:"layers"},{label:i("analytics"),href:"/dashboard/analytics",icon:"analytics"},{label:s("healthMonitor"),href:"/dashboard/health",icon:"health_and_safety"},{label:i("cliTools"),href:"/dashboard/cli-tools",icon:"terminal"},{label:s("reportIssue"),href:"https://github.com/diegosouzapw/OmniRoute/issues",external:!0,icon:"bug_report"}];return p?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(m.Qv,{}),(0,r.jsx)(m.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(m.Zp,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:s("quickStart")}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s("quickStartDesc")})]}),(0,r.jsxs)(c(),{href:"/docs",className:"hidden sm:inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"menu_book"}),s("fullDocs")]})]}),(0,r.jsxs)("ol",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"key"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:s("step1Title")}),(0,r.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step1Desc",{endpoint:e=>(0,r.jsx)(c(),{href:"/dashboard/endpoint",className:"text-primary hover:underline",children:e})})})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-green-500/10 text-green-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:s("step2Title")}),(0,r.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step2Desc",{providers:e=>(0,r.jsx)(c(),{href:"/dashboard/providers",className:"text-primary hover:underline",children:e})})})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"link"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:s("step3Title")}),(0,r.jsx)("p",{className:"text-text-muted mt-0.5",children:s("step3Desc",{url:g})})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"analytics"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:s("step4Title")}),(0,r.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step4Desc",{logs:e=>(0,r.jsx)(c(),{href:"/dashboard/usage",className:"text-primary hover:underline",children:e}),analytics:e=>(0,r.jsx)(c(),{href:"/dashboard/analytics",className:"text-primary hover:underline",children:e})})})]})]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:q.map(e=>(0,r.jsxs)("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon||(e.external?"open_in_new":"arrow_forward")}),e.label]},e.href))})]})}),(0,r.jsxs)(m.Zp,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:s("providersOverview")}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s("configuredOf",{configured:S.filter(e=>e.total>0).length,total:S.length})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"hidden sm:flex items-center gap-3 text-[11px] text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," ",t("free")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-blue-500"})," ",s("oauthLabel")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," ",s("apiKeyLabel")]})]}),(0,r.jsxs)(c(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"settings"}),t("manage")]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:S.map(e=>(0,r.jsx)(b,{item:e,metrics:y[e.provider.alias]||y[e.id],onClick:()=>N(e)},e.id))})]}),v&&(0,r.jsx)(f,{provider:v,models:R,onClose:()=>N(null)})]})}function b({item:e,metrics:s,onClick:t}){let[i,n]=(0,a.useState)(!1),d=(0,l.c)("home"),c=(0,l.c)("common"),x=e.errors>0?"text-red-500":e.connected>0?"text-green-500":"text-text-muted",m={free:{color:"bg-green-500",label:c("free")},oauth:{color:"bg-blue-500",label:d("oauthLabel")},apikey:{color:"bg-amber-500",label:d("apiKeyLabel")}},u=m[e.authType]||m.apikey;return(0,r.jsx)("button",{onClick:t,className:"border border-border rounded-lg p-3 hover:bg-surface/40 transition-colors text-left cursor-pointer w-full",children:(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.provider.color||"#888"}15`},children:i?(0,r.jsx)("span",{className:"text-[10px] font-bold",style:{color:e.provider.color||"#888"},children:e.provider.textIcon||e.provider.id.slice(0,2).toUpperCase()}):(0,r.jsx)(o.default,{src:`/providers/${e.provider.id}.png`,alt:e.provider.name,width:26,height:26,className:"object-contain rounded-lg",sizes:"26px",onError:()=>n(!0)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm font-semibold truncate",children:e.provider.name}),(0,r.jsx)("span",{className:`size-2 rounded-full ${u.color} shrink-0`,title:u.label})]}),(0,r.jsx)("p",{className:`text-xs ${x}`,children:0===e.total?c("notConfigured"):d("activeError",{active:e.connected,errors:e.errors})}),s&&s.totalRequests>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,r.jsx)("span",{className:"text-emerald-500",children:s.totalSuccesses}),"/",d("requestsShort",{count:s.totalRequests})]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[s.successRate,"%"]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",s.avgLatencyMs,"ms"]})]})]}),(0,r.jsxs)("div",{className:"text-right shrink-0",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-text-main",children:e.modelCount}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted",children:c("models")})]})]})})}function f({provider:e,models:s,onClose:t}){let[i,n]=(0,a.useState)(null),o=(0,p.i)(),d=(0,x.useRouter)(),c=(0,l.c)("home"),u=(0,l.c)("common"),h=(0,l.c)("sidebar");return(0,r.jsx)(m.aF,{isOpen:!0,title:c("providerModelsTitle",{provider:e.provider.name}),onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"token"}),1===s.length?c("modelAvailable",{count:s.length}):c("modelsAvailable",{count:s.length}),e.total>0&&(0,r.jsxs)("span",{className:"ml-auto text-xs text-green-500",children:["●"," ",1===e.connected?c("connectionsActive",{count:e.connected}):c("connectionsActivePlural",{count:e.connected})]})]}),0===s.length?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:c("noModelsAvailable")}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:c("configureFirst",{providers:h("providers")})})]}):(0,r.jsx)("div",{className:"flex flex-col gap-1 max-h-[400px] overflow-y-auto",children:s.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-surface/50 transition-colors group",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-mono text-sm text-text-main truncate",children:e.fullModel}),e.alias!==e.model&&(0,r.jsxs)("p",{className:"text-[10px] text-text-muted",children:[c("aliasLabel"),": ",e.alias]})]}),(0,r.jsx)("button",{onClick:()=>{var s;return s=e.fullModel,void(navigator.clipboard.writeText(s),n(s),o.success(c("copiedModel",{model:s})),setTimeout(()=>n(null),2e3))},className:"shrink-0 ml-2 p-1.5 rounded-lg text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors opacity-0 group-hover:opacity-100",title:c("copyModelName"),children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:i===e.fullModel?"check":"content_copy"})})]},e.fullModel))}),(0,r.jsxs)("div",{className:"flex gap-2 pt-2 border-t border-border",children:[(0,r.jsxs)(m.$n,{variant:"secondary",fullWidth:!0,size:"sm",onClick:()=>{var s;return s=`/dashboard/providers/${e.id}`,void(t(),d.push(s))},className:"flex-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"settings"}),c("configureProvider")]}),(0,r.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:t,children:u("close")})]})]})})}h.propTypes={machineId:n().string},b.propTypes={item:n().shape({id:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string,alias:n().string}).isRequired,total:n().number.isRequired,connected:n().number.isRequired,errors:n().number.isRequired,modelCount:n().number.isRequired,authType:n().string.isRequired}).isRequired,metrics:n().shape({totalRequests:n().number,totalSuccesses:n().number,successRate:n().number,avgLatencyMs:n().number}),onClick:n().func.isRequired},f.propTypes={provider:n().object.isRequired,models:n().array.isRequired,onClose:n().func.isRequired}}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=14005)),_N_E=e.O()}]);
|