@jheavenknows/bluerouter 1.0.45 → 1.0.47
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-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ollama-nodes/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ollama-nodes/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/virtual-combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/virtual-combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/virtual-combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/!KGRhc2hib2FyZCk/dashboard/ollama-nodes/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/!KGRhc2hib2FyZCk/dashboard/ollama-nodes.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/ollama-nodes.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/!KGRhc2hib2FyZCk/dashboard/virtual-combos/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/!KGRhc2hib2FyZCk/dashboard/virtual-combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/virtual-combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +1 -1
- package/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/476.js +1 -1
- package/app/.next-cli-build/server/chunks/7153.js +1 -1
- package/app/.next-cli-build/server/chunks/9526.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-3450c89780ef4660.js → 1321-73107f2f559a6ebc.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-90dfe11dd01a459e.js → 5497-1047d219f0698864.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/ollama-nodes/page-e01cac7f44e26bf3.js +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/ollama-nodes/page-a706ab3ab82a1964.js +0 -1
- /package/app/.next-cli-build/static/{N-Vk_eAvhMIv2P86lbGeM → 17mH5-xKVKebtvcgllFse}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{N-Vk_eAvhMIv2P86lbGeM → 17mH5-xKVKebtvcgllFse}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.40-to-1.0.41-1.0.41-20260526-210056 → upgrade-1.0.45-to-1.0.46-1.0.46-20260526-222129}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.41-to-1.0.42-1.0.42-20260526-211828 → upgrade-1.0.46-to-1.0.47-1.0.47-20260526-224538}/data.sqlite +0 -0
package/app/.next-cli-build/static/chunks/{5497-90dfe11dd01a459e.js → 5497-1047d219f0698864.js}
RENAMED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`,children:[b.includes(e.name)&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(M).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 z-10 bg-white py-1 dark:bg-zinc-950",children:[(0,s.jsx)(i.A,{src:(0,d.mq)(e)||(0,d.gb)(e)?null:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=n===e.value,r=e.isPlaceholder;return(0,s.jsx)("button",{onClick:()=>z(e),title:r?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
5
5
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
6
|
${r?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-white border-primary":b.includes(e.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
-
`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[b.includes(e.value)&&!r&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,s.jsxs)(s.Fragment,{children:[e.name,(0,s.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):e.name]})},e.value)})})]},e)),0===Object.keys(M).length&&0===L.length&&(0,s.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,s.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}x.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,onDeselect:n().func,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object,kindFilter:n().string,addedModelValues:n().arrayOf(n().string),closeOnSelect:n().bool}},73579:(e,t,r)=>{r.d(t,{default:()=>x});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(81127),o=r(11910),d=r(92542),c=r(56061),m=r(52679);function x({isOpen:e,connection:t,proxyPools:r,onSave:l,onClose:n}){let[u,p]=(0,a.useState)({name:"",priority:1,apiKey:""}),[h,f]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,g]=(0,a.useState)({accountId:""}),[y,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[T,R]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(p({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&g({accountId:t.providerSpecificData.accountId||""}),N(null),S(null))},[t]);let $=t?.authType==="oauth",P=t?.provider==="azure",O=t?.provider==="cloudflare-ai",I=!!t&&((0,m.mq)(t.provider)||(0,m.gb)(t.provider)),_=async()=>{if(t?.provider){j(!0),N(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),r=await e.json();N(r.valid?"success":"failed")}catch{N("failed")}finally{j(!1)}}},A=async()=>{if(t?.provider&&u.apiKey){k(!0),S(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:u.apiKey,...P?{providerSpecificData:h}:{},...O?{providerSpecificData:b}:{}})}),r=await e.json();S(r.valid?"success":"failed")}catch{S("failed")}finally{k(!1)}}},E=async()=>{if(t){R(!0);try{let e={name:u.name,priority:u.priority};if(!$&&u.apiKey){e.apiKey=u.apiKey;let r="success"===C;if(!r)try{k(!0),S(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:u.apiKey,...P?{providerSpecificData:h}:{},...O?{providerSpecificData:b}:{}})});r=!!(await e.json()).valid,S(r?"success":"failed")}catch{S("failed")}finally{k(!1)}r&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}P&&(e.providerSpecificData={azureEndpoint:h.azureEndpoint,apiVersion:h.apiVersion,deployment:h.deployment,organization:h.organization}),O&&(e.providerSpecificData={accountId:b.accountId}),await l(e)}finally{R(!1)}}};return t?(0,s.jsx)(i.default,{isOpen:e,title:"Edit Connection",onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(o.default,{label:"Name",value:u.name,onChange:e=>p({...u,name:e.target.value}),placeholder:$?"Account name":"Production Key"}),$&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(o.default,{label:"Priority",type:"number",value:u.priority,onChange:e=>p({...u,priority:Number.parseInt(e.target.value,10)||1})}),!$&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.default,{label:"API Key",type:"password",value:u.apiKey,onChange:e=>p({...u,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.default,{onClick:A,disabled:!u.apiKey||w||T,variant:"secondary",children:w?"Checking...":"Check"})})]}),C&&(0,s.jsx)(c.default,{variant:"success"===C?"success":"error",children:"success"===C?"Valid":"Invalid"})]}),P&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(o.default,{label:"Azure Endpoint",value:h.azureEndpoint,onChange:e=>f({...h,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,s.jsx)(o.default,{label:"Deployment Name",value:h.deployment,onChange:e=>f({...h,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,s.jsx)(o.default,{label:"API Version",value:h.apiVersion,onChange:e=>f({...h,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,s.jsx)(o.default,{label:"Organization",value:h.organization,onChange:e=>f({...h,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),!I&&!P&&!O&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(d.default,{onClick:_,variant:"secondary",disabled:y,children:y?"Testing...":"Test Connection"}),v&&(0,s.jsx)(c.default,{variant:"success"===v?"success":"error",children:"success"===v?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.default,{onClick:E,fullWidth:!0,disabled:T,children:T?"Saving...":"Save"}),(0,s.jsx)(d.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:n().bool.isRequired,connection:n().shape({id:n().string,name:n().string,email:n().string,priority:n().number,authType:n().string,provider:n().string,providerSpecificData:n().object}),proxyPools:n().arrayOf(n().shape({id:n().string,name:n().string})),onSave:n().func.isRequired,onClose:n().func.isRequired}},74891:(e,t,r)=>{r.d(t,{default:()=>b});var s=r(95155),a=r(12115),l=r(73321),n=r(98500),i=r.n(n),o=r(14051),d=r.n(o),c=r(57250),m=r(80752),x=r(38587),u=r(38003),p=r(90620),h=r(52679),f=r(73006);function b({onMenuClick:e,showMenuButton:t=!0}){let r=(0,l.usePathname)(),n=(0,l.useRouter)(),[o,d]=(0,a.useState)(""),[u,y]=(0,a.useState)(""),{title:j,description:v,icon:N,breadcrumbs:w}=(0,a.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(t){let e=t[1],r=t[2],s=h.rj.find(t=>t.id===e),a=h.Q2[r];return{title:a?.name||r,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:s?.label||e,href:`/dashboard/media-providers/${e}`},{label:a?.name||r,image:`/providers/${r}.png`}]}}let r=e.match(/\/media-providers\/([^/]+)$/);if(r){let e=r[1],t=h.rj.find(t=>t.id===e);return{title:t?.label||e,description:`Manage your ${t?.label||e} providers`,icon:t?.icon||"perm_media",breadcrumbs:[]}}let s=e.match(/\/providers\/([^/]+)$/);if(s){let e=s[1],t=p.zN[e]||p.fg[e];if(t)return{title:t.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:t.name,image:`/providers/${t.id}.png`}]}}return e.includes("/providers")&&!e.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:e.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:e.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:e.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:e.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:e.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(r),[r]);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let r=await t.json();e||(d(r?.displayName||r?.oidcName||r?.oidcEmail||""),y(r?.loginMethod||""))}catch{e||(d(""),y(""))}}(),()=>{e=!0}},[]);let k=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(n.push("/login"),n.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,s.jsxs)("header",{className:"shrink-0 flex items-center justify-between gap-3 px-4 lg:px-8 pt-3 pb-2 border-b border-border-subtle bg-surface/60 backdrop-blur-xl lg:bg-transparent lg:backdrop-blur-none z-20",children:[(0,s.jsx)("div",{className:"flex items-center gap-3 lg:hidden shrink-0",children:t&&(0,s.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,s.jsx)("div",{className:"flex flex-col min-w-0 flex-1",children:w.length>0?(0,s.jsx)("div",{className:"flex items-center gap-2",children:w.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,s.jsx)(i(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,s.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,s.jsx)("h1",{className:"text-base lg:text-2xl font-semibold text-text-main tracking-tight truncate",children:(0,f.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):j?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[N&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-xl lg:text-2xl",children:N}),(0,s.jsx)("h1",{className:"text-base lg:text-2xl font-semibold tracking-tight truncate",children:(0,f.Tl)(j)})]}),v&&(0,s.jsx)("p",{className:"hidden lg:block text-sm text-text-muted truncate",children:(0,f.Tl)(v)})]}):null}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[o&&"OIDC"===u&&(0,s.jsxs)("div",{className:"hidden sm:flex items-center max-w-[220px] px-3 py-1.5 rounded-full border border-border bg-surface/70 text-xs text-text-muted truncate",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1.5 text-primary",children:"person"}),(0,s.jsx)("span",{className:"truncate",children:o}),(0,s.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:"OIDC"})]}),(0,s.jsx)(g,{}),(0,s.jsx)(x.default,{}),(0,s.jsx)(m.default,{onLogout:k})]})]})}function g(){let e=(0,u.C)(e=>e.visible),t=(0,u.C)(e=>e.query),r=(0,u.C)(e=>e.placeholder),a=(0,u.C)(e=>e.setQuery);return e?(0,s.jsxs)("div",{className:"relative w-[160px] sm:w-[220px]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[16px] pointer-events-none",children:"search"}),(0,s.jsx)("input",{type:"text",value:t,onChange:e=>a(e.target.value),placeholder:r,className:"w-full h-8 pl-7 pr-7 rounded-lg border border-border bg-surface/60 text-sm focus:outline-none focus:border-primary/50 transition-colors"}),t&&(0,s.jsx)("button",{type:"button",onClick:()=>a(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded","aria-label":"Clear search",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}):null}b.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},80752:(e,t,r)=>{r.d(t,{default:()=>u});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(93308),o=r(1620),d=r(40197);r(14932);var c=r(21931);let m={en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (BR)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (PT)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}};function x({icon:e,label:t,onClick:r,trailing:a,danger:l}){return(0,s.jsxs)("button",{onClick:r,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${l?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[20px] ${l?"":"text-text-muted"}`,children:e}),(0,s.jsx)("span",{className:"flex-1 text-left",children:t}),a&&(0,s.jsx)("span",{className:"text-base",children:a})]})}function u({onLogout:e}){let[t,r]=(0,a.useState)(!1),[l,n]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)("en"),{toggleTheme:g,isDark:y}=(0,o.D)(),j=(0,a.useRef)(null);return(0,a.useEffect)(()=>{b(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[p]),(0,a.useEffect)(()=>{let e=e=>{j.current&&!j.current.contains(e.target)&&r(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative",ref:j,children:[(0,s.jsx)("button",{onClick:()=>r(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,s.jsx)(x,{icon:"history",label:"Change Log",onClick:()=>{r(!1),n(!0)}}),(0,s.jsx)(x,{icon:"language",label:m[f]?.name||f,trailing:m[f]?.flag||"\uD83C\uDF10",onClick:()=>{r(!1),h(!0)}}),(0,s.jsx)(x,{icon:y?"light_mode":"dark_mode",label:"Theme",onClick:()=>{g(),r(!1)}}),(0,s.jsx)(x,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{r(!1),e()}})]})]}),(0,s.jsx)(d.default,{isOpen:l,onClose:()=>n(!1)}),(0,s.jsx)(c.default,{hideTrigger:!0,isOpen:p,onClose:e=>{h(!1),b(e)}})]})}x.propTypes={icon:n().string.isRequired,label:n().string.isRequired,onClick:n().func.isRequired,trailing:n().node,danger:n().bool},u.propTypes={onLogout:n().func.isRequired}},81127:(e,t,r)=>{r.d(t,{ConfirmModal:()=>d,default:()=>o});var s=r(95155),a=r(12115),l=r(31474),n=r(92542),i=r(97677);function o({isOpen:e,onClose:t,title:r,children:n,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:x=!0,className:u}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,s.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],u),children:[(r||x)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[x&&(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,s.jsx)(i.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,s.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),r&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:r})]}),(0,s.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:n}),d&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:r,title:a="Confirm",message:l,confirmText:i="Confirm",cancelText:c="Cancel",variant:m="danger",loading:x=!1}){return(0,s.jsx)(o,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,s.jsx)(n.default,{variant:m,onClick:r,loading:x,children:i})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:l})})}},84588:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(95155),a=r(31474);function l({children:e,title:t,subtitle:r,icon:n,action:i,padding:o="md",hover:d=!1,elev:c=!1,className:m,...x}){return(0,s.jsxs)("div",{className:(0,a.cn)("bg-surface border border-border-subtle",c?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[var(--shadow-soft)]",d&&"hover:shadow-[var(--shadow-warm)] hover:border-brand-500/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[o],m),...x,children:[(t||i)&&(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[n&&(0,s.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:n})}),(0,s.jsxs)("div",{children:[t&&(0,s.jsx)("h3",{className:"text-text-main font-semibold",children:t}),r&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:r})]})]}),i]}),e]})}l.Section=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",t),...r,children:e})},l.Row=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",t),...r,children:e})},l.ListItem=function({children:e,actions:t,className:r,...l}){return(0,s.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50 transition-colors",r),...l,children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,s.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},90882:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497),o=r(11059);function d({isOpen:e,provider:t,providerInfo:r,onSuccess:l,onClose:n,oauthMeta:c,idcConfig:m}){let[x,u]=(0,a.useState)("waiting"),[p,h]=(0,a.useState)(null),[f,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(null),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(!1),S=(0,a.useRef)(null),T=(0,a.useRef)(!1),{copied:R,copy:$}=(0,o.C)(),[P,O]=(0,a.useState)(!1),[I,_]=(0,a.useState)("/callback?code=..."),A=(0,a.useRef)(!1);(0,a.useEffect)(()=>{O("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),_(`${window.location.origin}/callback?code=...`)},[]);let E=(0,a.useCallback)(async(e,r)=>{if(p)try{let s=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:p.redirectUri,codeVerifier:p.codeVerifier,state:r,...c?{meta:c}:{}})}),a=await s.json();if(!s.ok)throw Error(a.error);u("success"),l?.()}catch(e){y(e.message),u("error")}},[p,t,l]),L=(0,a.useCallback)(async e=>{if(p?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:p.state})}),r=await t.json();if(!t.ok)throw Error(r.error);u("success"),l?.()}catch(e){y(e.message),u("error")}},[p,l]),M=(0,a.useCallback)(async(e,r,s,a)=>{T.current=!1,C(!0);for(let n=0;n<60;n++){if(T.current){console.log("[OAuthModal] Polling aborted"),C(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),T.current){console.log("[OAuthModal] Polling aborted after sleep"),C(!1);return}try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:r,extraData:a})}),i=await n.json();if(i.success){T.current=!0,u("success"),C(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(s=Math.min(s+5,30))}catch(e){y(e.message),u("error"),C(!1);return}}y("Authorization timeout"),u("error"),C(!1)},[t,l]),z=(0,a.useCallback)(async()=>{if(t)try{let e;if(y(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy"].includes(t)){v(!0),u("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&m?.startUrl&&(e.searchParams.set("start_url",m.startUrl),m.region&&e.searchParams.set("region",m.region),e.searchParams.set("auth_method","idc"));let r=await fetch(e.toString()),s=await r.json();if(!r.ok)throw Error(s.error);w(s);let a=s.verification_uri_complete||s.verification_uri;a&&window.open(a,"_blank","noopener,noreferrer");let l="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl}:null;M(s.device_code,s.codeVerifier,s.interval||5,l);return}let r=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${r}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",e),c&&Object.entries(c).forEach(([e,t])=>{t&&s.searchParams.set(e,t)});let a=await fetch(s.toString()),l=await a.json();if(!a.ok)throw Error(l.error);let n=!1,i=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",r),t.searchParams.set("state",l.state),t.searchParams.set("code_verifier",l.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),a=await s.json();n=a.success,i=!!a.serverSide}catch{n=!1}let o=!1,d=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",r),t.searchParams.set("state",l.state),t.searchParams.set("code_verifier",l.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),a=await s.json();if(o=a.success,d=!!a.serverSide,!o&&"port_busy"===a.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}h({...l,redirectUri:e,codexServerSide:i,xaiServerSide:d}),"codex"===t&&n||"xai"===t&&o||P&&"codex"!==t&&"xai"!==t?(u("waiting"),S.current=window.open(l.authUrl,"oauth_popup","width=600,height=700"),S.current||u("input")):(u("input"),window.open(l.authUrl,"_blank"))}catch(e){y(e.message),u("error")}},[t,P,M,c,m]);(0,a.useEffect)(()=>{e&&t?(h(null),b(""),y(null),v(!1),w(null),C(!1),T.current=!1,z()):e||(T.current=!0,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,z]),(0,a.useEffect)(()=>{let e=p?.codexServerSide?"codex":p?.xaiServerSide?"xai":null;if(!e||!p?.state||A.current)return;let t=!1,r=0,s=async()=>{if(!t&&!A.current){r+=1;try{let r=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(p.state)}`),s=await r.json();if(t||A.current)return;if("done"===s.status){A.current=!0,u("success"),l?.();return}if("error"===s.status){A.current=!0,y(s.error||"Authentication failed"),u("error");return}}catch{}if(r>=200){A.current=!0,y("Authentication timeout"),u("error");return}setTimeout(s,1500)}};return setTimeout(s,1500),()=>{t=!0}},[p,l]),(0,a.useEffect)(()=>{let e;if(!p)return;A.current=!1;let t=async e=>{if(A.current)return;let{code:t,state:r,error:s,errorDescription:a}=e;if(s){A.current=!0,y(a||s),u("error");return}t&&(A.current=!0,await E(t,r))},r=e=>{let r=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(r||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",r);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let r=JSON.parse(e.newValue);t(r),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let r=JSON.parse(e);r.timestamp&&Date.now()-r.timestamp<3e4&&t(r),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",r),window.removeEventListener("storage",s),e&&e.close()}},[p,E]);let q=async()=>{try{y(null);let e=f.trim();if(e.startsWith("eyJ")&&e.includes("."))return void await E(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await L(e);let r=new URL(e),s=r.searchParams.get("code"),a=r.searchParams.get("state"),l=r.searchParams.get("error");if(l)throw Error(r.searchParams.get("error_description")||l);if(!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await E(s,a)}catch(e){y(e.message),u("error")}},U=(0,a.useCallback)(()=>{"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),n()},[n,t]);if(!t||!r)return null;let D="xai"===t,F=N?.verification_uri_complete||N?.verification_uri||"",W=D?"Connect Grok Build OAuth":`Connect ${r.name}`;return(0,s.jsx)(i.aF,{isOpen:e,title:W,onClose:U,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===x||"input"===x)&&!j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,s.jsx)("span",{className:"text-sm",children:D?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",D?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.pd,{value:p?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===R?"check":"content_copy",onClick:()=>$(p?.authUrl,"auth_url"),disabled:!p?.authUrl,children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":"callback URL"," here"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,s.jsx)(i.pd,{value:f,onChange:e=>b(e.target.value),placeholder:D?"http://127.0.0.1:56121/callback?code=... or copied code":I,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:q,fullWidth:!0,disabled:!f,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===x&&j&&N&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:F}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"login_url"===R?"check":"content_copy",onClick:()=>$(F,"login_url"),disabled:!F}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(F,"_blank","noopener,noreferrer"),disabled:!F,children:"Open"})]})]}),(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:N.user_code}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===R?"check":"content_copy",onClick:()=>$(N.user_code,"user_code")})]})]})]}),k&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===x&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",r.name," account has been connected."]}),(0,s.jsx)(i.$n,{onClick:U,fullWidth:!0,children:"Done"})]}),"error"===x&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:g}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:z,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(i.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired,oauthMeta:n().object,idcConfig:n().shape({startUrl:n().string,region:n().string})}},91450:(e,t,r)=>{r.d(t,{default:()=>i});var s=r(95155),a=r(14051),l=r.n(a),n=r(38587);function i({children:e}){return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,s.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,s.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(n.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},92173:(e,t,r)=>{r.d(t,{default:()=>c});var s=r(95155),a=r(98500),l=r.n(a),n=r(90620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,s.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,r)=>{r.d(t,{default:()=>i});var s=r(95155),a=r(31474);let l={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},n={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function i({children:e,variant:t="primary",size:r="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...p}){return(0,s.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[r],x&&"w-full",u),disabled:c||m,...p,children:[m?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,r)=>{r.d(t,{default:()=>v});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(98500),o=r.n(i),d=r(73321),c=r(31474),m=r(90620),x=r(52679),u=r(11059),p=r(81127);let h=["embedding","image","tts","stt"],f={id:"web",label:"Web Fetch & Search",icon:"travel_explore",href:"/dashboard/media-providers/web"},b=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/virtual-combos",label:"Virtual Combos",icon:"hub"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"AI Traffic Gateway",icon:"security"},{href:"/dashboard/prompt-logs",label:"Prompt Logs",icon:"manage_search"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],g=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],y=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function j({href:e,label:t,icon:r,active:a,onClick:l,compact:n=!1}){return(0,s.jsxs)(o(),{href:e,onClick:l,className:(0,c.cn)("group flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",a?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main",n&&"py-1.5 text-xs"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r}),(0,s.jsx)("span",{className:"truncate",children:t})]})}function v({onClose:e}){let t=(0,d.usePathname)(),r=(0,d.useRouter)(),[l,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[T,R]=(0,a.useState)(!1),[$,P]=(0,a.useState)(!1),[O,I]=(0,a.useState)(!1),[_,A]=(0,a.useState)(!1),[E,L]=(0,a.useState)(0),[M,z]=(0,a.useState)(!1),[q,U]=(0,a.useState)(""),[D,F]=(0,a.useState)(""),[W,K]=(0,a.useState)(null),{copied:B,copy:V}=(0,u.C)(2e3),G=m.h0?.installCmdLatest||"npm install -g bluerouter@latest";(0,a.useEffect)(()=>{let e=!1;return fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t.enableTranslator&&z(!0)}).catch(()=>{}),fetch("/api/auth/status",{cache:"no-store"}).then(e=>e.json()).then(t=>{e||(U(t?.displayName||t?.ldapName||t?.ldapEmail||t?.oidcName||t?.oidcEmail||t?.localLoginUsername||""),F(t?.loginMethod||(t?.ldapLogin?"LDAP":t?.oidcLogin?"OIDC":"Local")))}).catch(()=>{e||(U(""),F(""))}),fetch("/api/version",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.hasUpdate&&K(t)}).catch(()=>{}),()=>{e=!0}},[]);let J=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),Q=()=>e?.(),H=async()=>{try{await fetch("/api/auth/logout",{method:"POST"})}catch{}r.push("/login"),r.refresh()},X=async()=>{R(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch{}R(!1),o(!1),A(!0)},Y=async()=>{P(!0);try{await fetch("/api/version/restart",{method:"POST"})}catch{}k(!1),setTimeout(()=>globalThis.location.reload(),4e3)},Z=async()=>{try{await navigator.clipboard.writeText(G)}catch{}V(G);let e=m.h0?.shutdownCountdownSec||5;L(e);let t=setInterval(()=>{L(e-=1),e<=0&&(clearInterval(t),fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),A(!0))},1e3)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:"flex h-full w-72 flex-col border-r border-border bg-sidebar px-3 py-4",children:[(0,s.jsxs)("div",{className:"mb-4 rounded-2xl border border-border bg-background/70 p-3 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl bg-primary/10 p-2 text-primary",children:"hub"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"font-semibold text-text-main",children:"Blue Router"}),(0,s.jsxs)("div",{className:"text-xs text-text-muted",children:["v",m.vQ?.version||"local"]})]})]}),q&&(0,s.jsxs)("div",{className:"mt-3 rounded-xl bg-surface px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-text-main",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"person"}),(0,s.jsx)("span",{className:"truncate",children:q})]}),D&&(0,s.jsxs)("div",{className:"mt-0.5 text-[11px] text-text-muted",children:["Signed in via ",D]})]}),W&&(0,s.jsxs)("div",{className:"mt-3 rounded-xl border border-green-300 bg-green-50 p-2 dark:border-amber-500/30 dark:bg-amber-500/10",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>S(!0),className:"w-full text-left text-xs font-semibold text-green-700 dark:text-amber-300",children:["↑ New version available: v",W.latestVersion]}),(0,s.jsx)("button",{type:"button",onClick:()=>V(G),className:"mt-1 w-full min-w-0 truncate rounded-lg bg-background/70 px-2 py-1 text-left font-mono text-[10px] text-text-muted transition hover:opacity-80",title:"Copy install command",children:B?"✓ copied!":G})]})]}),(0,s.jsxs)("nav",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto pr-1",children:[b.map(e=>(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href)),(0,s.jsx)("div",{className:"pt-3 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"System"}),(0,s.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:(0,c.cn)("group flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",t.startsWith("/dashboard/media-providers")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"perm_media"}),(0,s.jsx)("span",{className:"flex-1 text-left",children:"Media Providers"}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l?"expand_less":"expand_more"})]}),l&&(0,s.jsxs)("div",{className:"ml-4 space-y-1 border-l border-border pl-2",children:[(0,s.jsx)(j,{...f,active:t===f.href,onClick:Q,compact:!0}),x.rj.filter(e=>h.includes(e.id)).map(e=>(0,s.jsx)(j,{href:`/dashboard/media-providers/${e.id}`,label:e.label,icon:e.icon||"category",active:t===`/dashboard/media-providers/${e.id}`,onClick:Q,compact:!0},e.id))]}),y.map(e=>(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href)),g.map(e=>"/dashboard/translator"!==e.href||M?(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href):null)]}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 border-t border-border pt-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>k(!0),className:"flex h-10 items-center justify-center rounded-xl border border-blue-200 text-blue-600 transition hover:border-blue-300 hover:bg-blue-50 dark:border-blue-500/30 dark:hover:bg-blue-500/10",title:"Restart","aria-label":"Restart",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"restart_alt"})}),(0,s.jsx)("button",{type:"button",onClick:H,className:"flex h-10 items-center justify-center rounded-xl border border-border text-text-muted transition hover:bg-surface hover:text-text-main",title:"Logout","aria-label":"Logout",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"logout"})}),(0,s.jsx)("button",{type:"button",onClick:()=>o(!0),className:"flex h-10 items-center justify-center rounded-xl border border-red-200 text-red-500 transition hover:border-red-300 hover:bg-red-50 dark:border-red-500/30 dark:hover:bg-red-500/10",title:"Shutdown","aria-label":"Shutdown",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"power_settings_new"})})]})]}),(0,s.jsx)(p.ConfirmModal,{isOpen:i,onClose:()=>o(!1),onConfirm:X,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:T}),(0,s.jsx)(p.ConfirmModal,{isOpen:w,onClose:()=>k(!1),onConfirm:Y,title:"Restart Bluerouter",message:"Restart the Bluerouter server now? The dashboard will reload after a few seconds.",confirmText:"Restart",cancelText:"Cancel",variant:"primary",loading:$}),(0,s.jsx)(p.ConfirmModal,{isOpen:C,onClose:()=>S(!1),onConfirm:()=>{S(!1),I(!0)},title:"Update Bluerouter",message:`Show install command for v${W?.latestVersion||""}? You can copy it and shutdown to install manually.`,confirmText:"Show Command",cancelText:"Cancel",variant:"primary"}),(_||O||$)&&(0,s.jsx)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:O?(0,s.jsx)(N,{latestVersion:W?.latestVersion,installCmd:G,copied:!!B,onCopyAndShutdown:Z,onCancel:()=>{I(!1),L(0)},countdown:E,isDisconnected:_}):$?(0,s.jsxs)("div",{className:"max-w-md rounded-2xl bg-background p-6 text-center shadow-2xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-4xl text-primary",children:"restart_alt"}),(0,s.jsx)("h2",{className:"mt-3 text-xl font-semibold text-text-main",children:"Restarting Bluerouter"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"The server is restarting. This page will reload automatically."}),(0,s.jsx)("button",{type:"button",className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]}):(0,s.jsxs)("div",{className:"max-w-md rounded-2xl bg-background p-6 text-center shadow-2xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-4xl text-red-500",children:"power_off"}),(0,s.jsx)("h2",{className:"mt-3 text-xl font-semibold text-text-main",children:"Server Disconnected"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"The proxy server has been stopped."}),(0,s.jsx)("button",{type:"button",className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}function N({latestVersion:e,installCmd:t,copied:r,onCopyAndShutdown:a,onCancel:l,countdown:n,isDisconnected:i}){let o=n>0;return(0,s.jsxs)("div",{className:"max-w-xl rounded-2xl bg-background p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl bg-primary/10 p-2 text-primary",children:"content_copy"}),(0,s.jsxs)("h2",{className:"text-xl font-semibold text-text-main",children:["Update Bluerouter",e?` to v${e}`:""]})]}),(0,s.jsx)("p",{className:"mt-3 text-sm text-text-muted",children:i?"Server stopped. Paste the command into a terminal to install.":o?`Command copied. Server will stop in ${n}s...`:"Click the button below to copy the install command and shutdown."}),(0,s.jsxs)("div",{className:"mt-4 rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-semibold text-text-muted",children:"Install command:"}),(0,s.jsx)("code",{className:"break-all font-mono text-xs text-text-main",children:t})]}),(0,s.jsxs)("ol",{className:"mt-4 list-decimal space-y-1 pl-5 text-sm text-text-muted",children:[(0,s.jsx)("li",{children:"Click Copy & Shutdown below."}),(0,s.jsx)("li",{children:"Paste the command into your terminal and press Enter."}),(0,s.jsx)("li",{children:"Run bluerouter again after install."})]}),i?(0,s.jsx)("button",{type:"button",className:"mt-5 w-full rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"}):(0,s.jsxs)("div",{className:"mt-5 flex gap-3",children:[(0,s.jsx)("button",{type:"button",className:"flex-1 rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",onClick:l,children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"flex-1 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white disabled:opacity-60",onClick:a,disabled:o,children:r?"✓ Copied — shutting down...":o?`Shutting down in ${n}s`:"Copy & Shutdown"})]})]})}j.propTypes={href:n().string.isRequired,label:n().string.isRequired,icon:n().string.isRequired,active:n().bool,onClick:n().func,compact:n().bool},v.propTypes={onClose:n().func},N.propTypes={latestVersion:n().string,installCmd:n().string.isRequired,copied:n().bool,onCopyAndShutdown:n().func.isRequired,onCancel:n().func.isRequired,countdown:n().number,isDisconnected:n().bool}},94230:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497),o=r(11059);function d({isOpen:e,provider:t,onSuccess:r,onClose:l}){let[n,c]=(0,a.useState)("loading"),[m,x]=(0,a.useState)(""),[u,p]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(null),{copied:y,copy:j}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{g(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),r=await e.json();if(!e.ok)throw Error(r.error);p(r),x(r.authUrl),c("input"),window.open(r.authUrl,"_blank")}catch(e){g(e.message),c("error")}})()},[e,t]);let v=async()=>{try{let e;g(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let s=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!s)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,codeVerifier:u.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),r?.()}catch(e){g(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,s.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===y?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,s.jsx)(i.pd,{value:h,onChange:e=>f(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!h,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,s.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},95088:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:r,onClose:l}){let n,[c,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(o),[p,h]=(0,a.useState)(""),[f,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(""),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),R=()=>{m(null),u(o),h(""),b(""),y(""),w(null),v(!1),C(!1),T(null),l()},$=async()=>{if(!g.trim())return void w("Personal Access Token is required");v(!0),w(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:g.trim(),baseUrl:x.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");r?.(),R()}catch(e){w(e.message)}finally{v(!1)}};return e?k&&S?(0,s.jsx)(i.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{r?.(),R()},onClose:()=>{C(!1),T(null)}}):(0,s.jsx)(i.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:R,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{onClick:()=>m("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,s.jsxs)("button",{onClick:()=>m("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,s.jsx)("a",{href:`${x.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(n=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${n}/callback`)})]}),(0,s.jsx)(i.pd,{label:"GitLab Base URL",value:x,onChange:e=>u(e.target.value),placeholder:o}),(0,s.jsx)(i.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,s.jsx)(i.pd,{label:"Client Secret (optional for PKCE)",value:f,onChange:e=>b(e.target.value),placeholder:"Leave empty for public PKCE app"}),N&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:()=>{p.trim()?(w(null),T({baseUrl:x.trim()||o,clientId:p.trim(),clientSecret:f.trim()}),C(!0)):w("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,s.jsx)(i.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,s.jsx)("a",{href:`${x.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,s.jsx)(i.pd,{label:"GitLab Base URL",value:x,onChange:e=>u(e.target.value),placeholder:o}),(0,s.jsx)(i.pd,{label:"Personal Access Token",value:g,onChange:e=>y(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),N&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:$,fullWidth:!0,disabled:!g.trim()||j,loading:j,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:n().bool.isRequired,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},96748:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:r,onSaved:l,node:n}){let c=!!n,[m,x]=(0,a.useState)({name:"",prefix:"",baseUrl:o}),[u,p]=(0,a.useState)(!1),[h,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(""),[y,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(N(null),f(""),g(""),c?x({name:n.name||"",prefix:n.prefix||"",baseUrl:n.baseUrl||o}):x({name:"",prefix:"",baseUrl:o}))},[e,c,n]);let w=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${n.id}`:"/api/provider-nodes",t=c?"PUT":"POST",s={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(s.type="custom-embedding");let a=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),i=await a.json();a.ok&&(c?l?.(i.node):r?.(i.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},k=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:b.trim()||void 0})}),t=await e.json();N(t)}catch{N({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(i.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(i.pd,{label:"Name",value:m.name,onChange:e=>x({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,s.jsx)(i.pd,{label:"Prefix",value:m.prefix,onChange:e=>x({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,s.jsx)(i.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>x({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,s.jsx)(i.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>f(e.target.value)}),(0,s.jsx)(i.pd,{label:"Model ID (for Check)",value:b,onChange:e=>g(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i.$n,{onClick:k,disabled:!h||!b.trim()||y||!m.baseUrl.trim(),variant:"secondary",children:y?"Checking...":"Check"}),(()=>{if(!v)return null;let{valid:e,error:t,dimensions:r}=v;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Ex,{variant:"success",children:"Valid"}),r&&(0,s.jsxs)("span",{className:"text-sm text-text-muted",children:[r," dims"]})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(i.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:w,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||u,children:u?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,s.jsx)(i.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func,onSaved:n().func,node:n().shape({id:n().string,name:n().string,prefix:n().string,baseUrl:n().string})}},97677:(e,t,r)=>{r.d(t,{default:()=>a});var s=r(95155);function a({text:e,children:t,position:r="top",color:l}){let n=l?"":"bg-gray-900";return(0,s.jsxs)("div",{className:"relative inline-flex group",children:[t,(0,s.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[r]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${n} text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,style:l?{backgroundColor:l}:{},children:e})]})}},98542:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(95155),a=r(31474);function l({checked:e=!1,onChange:t,label:r,description:n,disabled:i=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,s.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",d),children:[(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:i,onClick:()=>{!i&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,i&&"cursor-not-allowed"),children:(0,s.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(r||n)&&(0,s.jsxs)("div",{className:"flex flex-col",children:[r&&(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:r}),n&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:n})]})]})}}}]);
|
|
7
|
+
`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[b.includes(e.value)&&!r&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,s.jsxs)(s.Fragment,{children:[e.name,(0,s.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):e.name]})},e.value)})})]},e)),0===Object.keys(M).length&&0===L.length&&(0,s.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,s.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}x.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,onDeselect:n().func,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object,kindFilter:n().string,addedModelValues:n().arrayOf(n().string),closeOnSelect:n().bool}},73579:(e,t,r)=>{r.d(t,{default:()=>x});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(81127),o=r(11910),d=r(92542),c=r(56061),m=r(52679);function x({isOpen:e,connection:t,proxyPools:r,onSave:l,onClose:n}){let[u,p]=(0,a.useState)({name:"",priority:1,apiKey:""}),[h,f]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,g]=(0,a.useState)({accountId:""}),[y,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[T,R]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(p({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&g({accountId:t.providerSpecificData.accountId||""}),N(null),S(null))},[t]);let $=t?.authType==="oauth",P=t?.provider==="azure",O=t?.provider==="cloudflare-ai",I=!!t&&((0,m.mq)(t.provider)||(0,m.gb)(t.provider)),_=async()=>{if(t?.provider){j(!0),N(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),r=await e.json();N(r.valid?"success":"failed")}catch{N("failed")}finally{j(!1)}}},A=async()=>{if(t?.provider&&u.apiKey){k(!0),S(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:u.apiKey,...P?{providerSpecificData:h}:{},...O?{providerSpecificData:b}:{}})}),r=await e.json();S(r.valid?"success":"failed")}catch{S("failed")}finally{k(!1)}}},E=async()=>{if(t){R(!0);try{let e={name:u.name,priority:u.priority};if(!$&&u.apiKey){e.apiKey=u.apiKey;let r="success"===C;if(!r)try{k(!0),S(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:u.apiKey,...P?{providerSpecificData:h}:{},...O?{providerSpecificData:b}:{}})});r=!!(await e.json()).valid,S(r?"success":"failed")}catch{S("failed")}finally{k(!1)}r&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}P&&(e.providerSpecificData={azureEndpoint:h.azureEndpoint,apiVersion:h.apiVersion,deployment:h.deployment,organization:h.organization}),O&&(e.providerSpecificData={accountId:b.accountId}),await l(e)}finally{R(!1)}}};return t?(0,s.jsx)(i.default,{isOpen:e,title:"Edit Connection",onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(o.default,{label:"Name",value:u.name,onChange:e=>p({...u,name:e.target.value}),placeholder:$?"Account name":"Production Key"}),$&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(o.default,{label:"Priority",type:"number",value:u.priority,onChange:e=>p({...u,priority:Number.parseInt(e.target.value,10)||1})}),!$&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.default,{label:"API Key",type:"password",value:u.apiKey,onChange:e=>p({...u,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.default,{onClick:A,disabled:!u.apiKey||w||T,variant:"secondary",children:w?"Checking...":"Check"})})]}),C&&(0,s.jsx)(c.default,{variant:"success"===C?"success":"error",children:"success"===C?"Valid":"Invalid"})]}),P&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(o.default,{label:"Azure Endpoint",value:h.azureEndpoint,onChange:e=>f({...h,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,s.jsx)(o.default,{label:"Deployment Name",value:h.deployment,onChange:e=>f({...h,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,s.jsx)(o.default,{label:"API Version",value:h.apiVersion,onChange:e=>f({...h,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,s.jsx)(o.default,{label:"Organization",value:h.organization,onChange:e=>f({...h,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),!I&&!P&&!O&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(d.default,{onClick:_,variant:"secondary",disabled:y,children:y?"Testing...":"Test Connection"}),v&&(0,s.jsx)(c.default,{variant:"success"===v?"success":"error",children:"success"===v?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.default,{onClick:E,fullWidth:!0,disabled:T,children:T?"Saving...":"Save"}),(0,s.jsx)(d.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:n().bool.isRequired,connection:n().shape({id:n().string,name:n().string,email:n().string,priority:n().number,authType:n().string,provider:n().string,providerSpecificData:n().object}),proxyPools:n().arrayOf(n().shape({id:n().string,name:n().string})),onSave:n().func.isRequired,onClose:n().func.isRequired}},74891:(e,t,r)=>{r.d(t,{default:()=>b});var s=r(95155),a=r(12115),l=r(73321),n=r(98500),i=r.n(n),o=r(14051),d=r.n(o),c=r(57250),m=r(80752),x=r(38587),u=r(38003),p=r(90620),h=r(52679),f=r(73006);function b({onMenuClick:e,showMenuButton:t=!0}){let r=(0,l.usePathname)(),n=(0,l.useRouter)(),[o,d]=(0,a.useState)(""),[u,y]=(0,a.useState)(""),{title:j,description:v,icon:N,breadcrumbs:w}=(0,a.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(t){let e=t[1],r=t[2],s=h.rj.find(t=>t.id===e),a=h.Q2[r];return{title:a?.name||r,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:s?.label||e,href:`/dashboard/media-providers/${e}`},{label:a?.name||r,image:`/providers/${r}.png`}]}}let r=e.match(/\/media-providers\/([^/]+)$/);if(r){let e=r[1],t=h.rj.find(t=>t.id===e);return{title:t?.label||e,description:`Manage your ${t?.label||e} providers`,icon:t?.icon||"perm_media",breadcrumbs:[]}}let s=e.match(/\/providers\/([^/]+)$/);if(s){let e=s[1],t=p.zN[e]||p.fg[e];if(t)return{title:t.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:t.name,image:`/providers/${t.id}.png`}]}}return e.includes("/providers")&&!e.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:e.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:e.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:e.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:e.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:e.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(r),[r]);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let r=await t.json();e||(d(r?.displayName||r?.oidcName||r?.oidcEmail||""),y(r?.loginMethod||""))}catch{e||(d(""),y(""))}}(),()=>{e=!0}},[]);let k=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(n.push("/login"),n.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,s.jsxs)("header",{className:"shrink-0 flex items-center justify-between gap-3 px-4 lg:px-8 pt-3 pb-2 border-b border-border-subtle bg-surface/60 backdrop-blur-xl lg:bg-transparent lg:backdrop-blur-none z-20",children:[(0,s.jsx)("div",{className:"flex items-center gap-3 lg:hidden shrink-0",children:t&&(0,s.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,s.jsx)("div",{className:"flex flex-col min-w-0 flex-1",children:w.length>0?(0,s.jsx)("div",{className:"flex items-center gap-2",children:w.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,s.jsx)(i(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,s.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,s.jsx)("h1",{className:"text-base lg:text-2xl font-semibold text-text-main tracking-tight truncate",children:(0,f.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):j?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[N&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-xl lg:text-2xl",children:N}),(0,s.jsx)("h1",{className:"text-base lg:text-2xl font-semibold tracking-tight truncate",children:(0,f.Tl)(j)})]}),v&&(0,s.jsx)("p",{className:"hidden lg:block text-sm text-text-muted truncate",children:(0,f.Tl)(v)})]}):null}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[o&&"OIDC"===u&&(0,s.jsxs)("div",{className:"hidden sm:flex items-center max-w-[220px] px-3 py-1.5 rounded-full border border-border bg-surface/70 text-xs text-text-muted truncate",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1.5 text-primary",children:"person"}),(0,s.jsx)("span",{className:"truncate",children:o}),(0,s.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:"OIDC"})]}),(0,s.jsx)(g,{}),(0,s.jsx)(x.default,{}),(0,s.jsx)(m.default,{onLogout:k})]})]})}function g(){let e=(0,u.C)(e=>e.visible),t=(0,u.C)(e=>e.query),r=(0,u.C)(e=>e.placeholder),a=(0,u.C)(e=>e.setQuery);return e?(0,s.jsxs)("div",{className:"relative w-[160px] sm:w-[220px]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[16px] pointer-events-none",children:"search"}),(0,s.jsx)("input",{type:"text",value:t,onChange:e=>a(e.target.value),placeholder:r,className:"w-full h-8 pl-7 pr-7 rounded-lg border border-border bg-surface/60 text-sm focus:outline-none focus:border-primary/50 transition-colors"}),t&&(0,s.jsx)("button",{type:"button",onClick:()=>a(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded","aria-label":"Clear search",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}):null}b.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},80752:(e,t,r)=>{r.d(t,{default:()=>u});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(93308),o=r(1620),d=r(40197);r(14932);var c=r(21931);let m={en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (BR)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (PT)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}};function x({icon:e,label:t,onClick:r,trailing:a,danger:l}){return(0,s.jsxs)("button",{onClick:r,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${l?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[20px] ${l?"":"text-text-muted"}`,children:e}),(0,s.jsx)("span",{className:"flex-1 text-left",children:t}),a&&(0,s.jsx)("span",{className:"text-base",children:a})]})}function u({onLogout:e}){let[t,r]=(0,a.useState)(!1),[l,n]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)("en"),{toggleTheme:g,isDark:y}=(0,o.D)(),j=(0,a.useRef)(null);return(0,a.useEffect)(()=>{b(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[p]),(0,a.useEffect)(()=>{let e=e=>{j.current&&!j.current.contains(e.target)&&r(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative",ref:j,children:[(0,s.jsx)("button",{onClick:()=>r(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,s.jsx)(x,{icon:"history",label:"Change Log",onClick:()=>{r(!1),n(!0)}}),(0,s.jsx)(x,{icon:"language",label:m[f]?.name||f,trailing:m[f]?.flag||"\uD83C\uDF10",onClick:()=>{r(!1),h(!0)}}),(0,s.jsx)(x,{icon:y?"light_mode":"dark_mode",label:"Theme",onClick:()=>{g(),r(!1)}}),(0,s.jsx)(x,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{r(!1),e()}})]})]}),(0,s.jsx)(d.default,{isOpen:l,onClose:()=>n(!1)}),(0,s.jsx)(c.default,{hideTrigger:!0,isOpen:p,onClose:e=>{h(!1),b(e)}})]})}x.propTypes={icon:n().string.isRequired,label:n().string.isRequired,onClick:n().func.isRequired,trailing:n().node,danger:n().bool},u.propTypes={onLogout:n().func.isRequired}},81127:(e,t,r)=>{r.d(t,{ConfirmModal:()=>d,default:()=>o});var s=r(95155),a=r(12115),l=r(31474),n=r(92542),i=r(97677);function o({isOpen:e,onClose:t,title:r,children:n,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:x=!0,className:u}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,s.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],u),children:[(r||x)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[x&&(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,s.jsx)(i.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,s.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),r&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:r})]}),(0,s.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:n}),d&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:r,title:a="Confirm",message:l,confirmText:i="Confirm",cancelText:c="Cancel",variant:m="danger",loading:x=!1}){return(0,s.jsx)(o,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,s.jsx)(n.default,{variant:m,onClick:r,loading:x,children:i})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:l})})}},84588:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(95155),a=r(31474);function l({children:e,title:t,subtitle:r,icon:n,action:i,padding:o="md",hover:d=!1,elev:c=!1,className:m,...x}){return(0,s.jsxs)("div",{className:(0,a.cn)("bg-surface border border-border-subtle",c?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[var(--shadow-soft)]",d&&"hover:shadow-[var(--shadow-warm)] hover:border-brand-500/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[o],m),...x,children:[(t||i)&&(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[n&&(0,s.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:n})}),(0,s.jsxs)("div",{children:[t&&(0,s.jsx)("h3",{className:"text-text-main font-semibold",children:t}),r&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:r})]})]}),i]}),e]})}l.Section=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",t),...r,children:e})},l.Row=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",t),...r,children:e})},l.ListItem=function({children:e,actions:t,className:r,...l}){return(0,s.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50 transition-colors",r),...l,children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,s.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},90882:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497),o=r(11059);function d({isOpen:e,provider:t,providerInfo:r,onSuccess:l,onClose:n,oauthMeta:c,idcConfig:m}){let[x,u]=(0,a.useState)("waiting"),[p,h]=(0,a.useState)(null),[f,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(null),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(!1),S=(0,a.useRef)(null),T=(0,a.useRef)(!1),{copied:R,copy:$}=(0,o.C)(),[P,O]=(0,a.useState)(!1),[I,_]=(0,a.useState)("/callback?code=..."),A=(0,a.useRef)(!1);(0,a.useEffect)(()=>{O("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),_(`${window.location.origin}/callback?code=...`)},[]);let E=(0,a.useCallback)(async(e,r)=>{if(p)try{let s=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:p.redirectUri,codeVerifier:p.codeVerifier,state:r,...c?{meta:c}:{}})}),a=await s.json();if(!s.ok)throw Error(a.error);u("success"),l?.()}catch(e){y(e.message),u("error")}},[p,t,l]),L=(0,a.useCallback)(async e=>{if(p?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:p.state})}),r=await t.json();if(!t.ok)throw Error(r.error);u("success"),l?.()}catch(e){y(e.message),u("error")}},[p,l]),M=(0,a.useCallback)(async(e,r,s,a)=>{T.current=!1,C(!0);for(let n=0;n<60;n++){if(T.current){console.log("[OAuthModal] Polling aborted"),C(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),T.current){console.log("[OAuthModal] Polling aborted after sleep"),C(!1);return}try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:r,extraData:a})}),i=await n.json();if(i.success){T.current=!0,u("success"),C(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(s=Math.min(s+5,30))}catch(e){y(e.message),u("error"),C(!1);return}}y("Authorization timeout"),u("error"),C(!1)},[t,l]),z=(0,a.useCallback)(async()=>{if(t)try{let e;if(y(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy"].includes(t)){v(!0),u("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&m?.startUrl&&(e.searchParams.set("start_url",m.startUrl),m.region&&e.searchParams.set("region",m.region),e.searchParams.set("auth_method","idc"));let r=await fetch(e.toString()),s=await r.json();if(!r.ok)throw Error(s.error);w(s);let a=s.verification_uri_complete||s.verification_uri;a&&window.open(a,"_blank","noopener,noreferrer");let l="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl}:null;M(s.device_code,s.codeVerifier,s.interval||5,l);return}let r=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${r}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",e),c&&Object.entries(c).forEach(([e,t])=>{t&&s.searchParams.set(e,t)});let a=await fetch(s.toString()),l=await a.json();if(!a.ok)throw Error(l.error);let n=!1,i=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",r),t.searchParams.set("state",l.state),t.searchParams.set("code_verifier",l.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),a=await s.json();n=a.success,i=!!a.serverSide}catch{n=!1}let o=!1,d=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",r),t.searchParams.set("state",l.state),t.searchParams.set("code_verifier",l.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),a=await s.json();if(o=a.success,d=!!a.serverSide,!o&&"port_busy"===a.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}h({...l,redirectUri:e,codexServerSide:i,xaiServerSide:d}),"codex"===t&&n||"xai"===t&&o||P&&"codex"!==t&&"xai"!==t?(u("waiting"),S.current=window.open(l.authUrl,"oauth_popup","width=600,height=700"),S.current||u("input")):(u("input"),window.open(l.authUrl,"_blank"))}catch(e){y(e.message),u("error")}},[t,P,M,c,m]);(0,a.useEffect)(()=>{e&&t?(h(null),b(""),y(null),v(!1),w(null),C(!1),T.current=!1,z()):e||(T.current=!0,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,z]),(0,a.useEffect)(()=>{let e=p?.codexServerSide?"codex":p?.xaiServerSide?"xai":null;if(!e||!p?.state||A.current)return;let t=!1,r=0,s=async()=>{if(!t&&!A.current){r+=1;try{let r=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(p.state)}`),s=await r.json();if(t||A.current)return;if("done"===s.status){A.current=!0,u("success"),l?.();return}if("error"===s.status){A.current=!0,y(s.error||"Authentication failed"),u("error");return}}catch{}if(r>=200){A.current=!0,y("Authentication timeout"),u("error");return}setTimeout(s,1500)}};return setTimeout(s,1500),()=>{t=!0}},[p,l]),(0,a.useEffect)(()=>{let e;if(!p)return;A.current=!1;let t=async e=>{if(A.current)return;let{code:t,state:r,error:s,errorDescription:a}=e;if(s){A.current=!0,y(a||s),u("error");return}t&&(A.current=!0,await E(t,r))},r=e=>{let r=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(r||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",r);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let r=JSON.parse(e.newValue);t(r),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let r=JSON.parse(e);r.timestamp&&Date.now()-r.timestamp<3e4&&t(r),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",r),window.removeEventListener("storage",s),e&&e.close()}},[p,E]);let q=async()=>{try{y(null);let e=f.trim();if(e.startsWith("eyJ")&&e.includes("."))return void await E(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await L(e);let r=new URL(e),s=r.searchParams.get("code"),a=r.searchParams.get("state"),l=r.searchParams.get("error");if(l)throw Error(r.searchParams.get("error_description")||l);if(!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await E(s,a)}catch(e){y(e.message),u("error")}},U=(0,a.useCallback)(()=>{"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),n()},[n,t]);if(!t||!r)return null;let D="xai"===t,F=N?.verification_uri_complete||N?.verification_uri||"",W=D?"Connect Grok Build OAuth":`Connect ${r.name}`;return(0,s.jsx)(i.aF,{isOpen:e,title:W,onClose:U,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===x||"input"===x)&&!j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,s.jsx)("span",{className:"text-sm",children:D?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",D?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.pd,{value:p?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===R?"check":"content_copy",onClick:()=>$(p?.authUrl,"auth_url"),disabled:!p?.authUrl,children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":"callback URL"," here"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,s.jsx)(i.pd,{value:f,onChange:e=>b(e.target.value),placeholder:D?"http://127.0.0.1:56121/callback?code=... or copied code":I,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:q,fullWidth:!0,disabled:!f,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===x&&j&&N&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:F}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"login_url"===R?"check":"content_copy",onClick:()=>$(F,"login_url"),disabled:!F}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(F,"_blank","noopener,noreferrer"),disabled:!F,children:"Open"})]})]}),(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:N.user_code}),(0,s.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===R?"check":"content_copy",onClick:()=>$(N.user_code,"user_code")})]})]})]}),k&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===x&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",r.name," account has been connected."]}),(0,s.jsx)(i.$n,{onClick:U,fullWidth:!0,children:"Done"})]}),"error"===x&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:g}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:z,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(i.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired,oauthMeta:n().object,idcConfig:n().shape({startUrl:n().string,region:n().string})}},91450:(e,t,r)=>{r.d(t,{default:()=>i});var s=r(95155),a=r(14051),l=r.n(a),n=r(38587);function i({children:e}){return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,s.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,s.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(n.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},92173:(e,t,r)=>{r.d(t,{default:()=>c});var s=r(95155),a=r(98500),l=r.n(a),n=r(90620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,s.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,r)=>{r.d(t,{default:()=>i});var s=r(95155),a=r(31474);let l={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},n={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function i({children:e,variant:t="primary",size:r="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...p}){return(0,s.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[r],x&&"w-full",u),disabled:c||m,...p,children:[m?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,r)=>{r.d(t,{default:()=>v});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(98500),o=r.n(i),d=r(73321),c=r(31474),m=r(90620),x=r(52679),u=r(11059),p=r(81127);let h=["embedding","image","tts","stt"],f={id:"web",label:"Web Fetch & Search",icon:"travel_explore",href:"/dashboard/media-providers/web"},b=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/virtual-combos",label:"Virtual Combos",icon:"hub"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"AI Traffic Gateway",icon:"security"},{href:"/dashboard/prompt-logs",label:"Prompt Logs",icon:"manage_search"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],g=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],y=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/ollama-nodes",label:"Ollama Nodes",icon:"memory"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function j({href:e,label:t,icon:r,active:a,onClick:l,compact:n=!1}){return(0,s.jsxs)(o(),{href:e,onClick:l,className:(0,c.cn)("group flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",a?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main",n&&"py-1.5 text-xs"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r}),(0,s.jsx)("span",{className:"truncate",children:t})]})}function v({onClose:e}){let t=(0,d.usePathname)(),r=(0,d.useRouter)(),[l,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[T,R]=(0,a.useState)(!1),[$,P]=(0,a.useState)(!1),[O,I]=(0,a.useState)(!1),[_,A]=(0,a.useState)(!1),[E,L]=(0,a.useState)(0),[M,z]=(0,a.useState)(!1),[q,U]=(0,a.useState)(""),[D,F]=(0,a.useState)(""),[W,K]=(0,a.useState)(null),{copied:B,copy:V}=(0,u.C)(2e3),G=m.h0?.installCmdLatest||"npm install -g bluerouter@latest";(0,a.useEffect)(()=>{let e=!1;return fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t.enableTranslator&&z(!0)}).catch(()=>{}),fetch("/api/auth/status",{cache:"no-store"}).then(e=>e.json()).then(t=>{e||(U(t?.displayName||t?.ldapName||t?.ldapEmail||t?.oidcName||t?.oidcEmail||t?.localLoginUsername||""),F(t?.loginMethod||(t?.ldapLogin?"LDAP":t?.oidcLogin?"OIDC":"Local")))}).catch(()=>{e||(U(""),F(""))}),fetch("/api/version",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.hasUpdate&&K(t)}).catch(()=>{}),()=>{e=!0}},[]);let J=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),Q=()=>e?.(),H=async()=>{try{await fetch("/api/auth/logout",{method:"POST"})}catch{}r.push("/login"),r.refresh()},X=async()=>{R(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch{}R(!1),o(!1),A(!0)},Y=async()=>{P(!0);try{await fetch("/api/version/restart",{method:"POST"})}catch{}k(!1),setTimeout(()=>globalThis.location.reload(),4e3)},Z=async()=>{try{await navigator.clipboard.writeText(G)}catch{}V(G);let e=m.h0?.shutdownCountdownSec||5;L(e);let t=setInterval(()=>{L(e-=1),e<=0&&(clearInterval(t),fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),A(!0))},1e3)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:"flex h-full w-72 flex-col border-r border-border bg-sidebar px-3 py-4",children:[(0,s.jsxs)("div",{className:"mb-4 rounded-2xl border border-border bg-background/70 p-3 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl bg-primary/10 p-2 text-primary",children:"hub"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"font-semibold text-text-main",children:"Blue Router"}),(0,s.jsxs)("div",{className:"text-xs text-text-muted",children:["v",m.vQ?.version||"local"]})]})]}),q&&(0,s.jsxs)("div",{className:"mt-3 rounded-xl bg-surface px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-text-main",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"person"}),(0,s.jsx)("span",{className:"truncate",children:q})]}),D&&(0,s.jsxs)("div",{className:"mt-0.5 text-[11px] text-text-muted",children:["Signed in via ",D]})]}),W&&(0,s.jsxs)("div",{className:"mt-3 rounded-xl border border-green-300 bg-green-50 p-2 dark:border-amber-500/30 dark:bg-amber-500/10",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>S(!0),className:"w-full text-left text-xs font-semibold text-green-700 dark:text-amber-300",children:["↑ New version available: v",W.latestVersion]}),(0,s.jsx)("button",{type:"button",onClick:()=>V(G),className:"mt-1 w-full min-w-0 truncate rounded-lg bg-background/70 px-2 py-1 text-left font-mono text-[10px] text-text-muted transition hover:opacity-80",title:"Copy install command",children:B?"✓ copied!":G})]})]}),(0,s.jsxs)("nav",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto pr-1",children:[b.map(e=>(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href)),(0,s.jsx)("div",{className:"pt-3 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"System"}),(0,s.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:(0,c.cn)("group flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",t.startsWith("/dashboard/media-providers")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"perm_media"}),(0,s.jsx)("span",{className:"flex-1 text-left",children:"Media Providers"}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l?"expand_less":"expand_more"})]}),l&&(0,s.jsxs)("div",{className:"ml-4 space-y-1 border-l border-border pl-2",children:[(0,s.jsx)(j,{...f,active:t===f.href,onClick:Q,compact:!0}),x.rj.filter(e=>h.includes(e.id)).map(e=>(0,s.jsx)(j,{href:`/dashboard/media-providers/${e.id}`,label:e.label,icon:e.icon||"category",active:t===`/dashboard/media-providers/${e.id}`,onClick:Q,compact:!0},e.id))]}),y.map(e=>(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href)),g.map(e=>"/dashboard/translator"!==e.href||M?(0,s.jsx)(j,{...e,active:J(e.href),onClick:Q},e.href):null)]}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 border-t border-border pt-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>k(!0),className:"flex h-10 items-center justify-center rounded-xl border border-blue-200 text-blue-600 transition hover:border-blue-300 hover:bg-blue-50 dark:border-blue-500/30 dark:hover:bg-blue-500/10",title:"Restart","aria-label":"Restart",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"restart_alt"})}),(0,s.jsx)("button",{type:"button",onClick:H,className:"flex h-10 items-center justify-center rounded-xl border border-border text-text-muted transition hover:bg-surface hover:text-text-main",title:"Logout","aria-label":"Logout",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"logout"})}),(0,s.jsx)("button",{type:"button",onClick:()=>o(!0),className:"flex h-10 items-center justify-center rounded-xl border border-red-200 text-red-500 transition hover:border-red-300 hover:bg-red-50 dark:border-red-500/30 dark:hover:bg-red-500/10",title:"Shutdown","aria-label":"Shutdown",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"power_settings_new"})})]})]}),(0,s.jsx)(p.ConfirmModal,{isOpen:i,onClose:()=>o(!1),onConfirm:X,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:T}),(0,s.jsx)(p.ConfirmModal,{isOpen:w,onClose:()=>k(!1),onConfirm:Y,title:"Restart Bluerouter",message:"Restart the Bluerouter server now? The dashboard will reload after a few seconds.",confirmText:"Restart",cancelText:"Cancel",variant:"primary",loading:$}),(0,s.jsx)(p.ConfirmModal,{isOpen:C,onClose:()=>S(!1),onConfirm:()=>{S(!1),I(!0)},title:"Update Bluerouter",message:`Show install command for v${W?.latestVersion||""}? You can copy it and shutdown to install manually.`,confirmText:"Show Command",cancelText:"Cancel",variant:"primary"}),(_||O||$)&&(0,s.jsx)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:O?(0,s.jsx)(N,{latestVersion:W?.latestVersion,installCmd:G,copied:!!B,onCopyAndShutdown:Z,onCancel:()=>{I(!1),L(0)},countdown:E,isDisconnected:_}):$?(0,s.jsxs)("div",{className:"max-w-md rounded-2xl bg-background p-6 text-center shadow-2xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-4xl text-primary",children:"restart_alt"}),(0,s.jsx)("h2",{className:"mt-3 text-xl font-semibold text-text-main",children:"Restarting Bluerouter"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"The server is restarting. This page will reload automatically."}),(0,s.jsx)("button",{type:"button",className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]}):(0,s.jsxs)("div",{className:"max-w-md rounded-2xl bg-background p-6 text-center shadow-2xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-4xl text-red-500",children:"power_off"}),(0,s.jsx)("h2",{className:"mt-3 text-xl font-semibold text-text-main",children:"Server Disconnected"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"The proxy server has been stopped."}),(0,s.jsx)("button",{type:"button",className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}function N({latestVersion:e,installCmd:t,copied:r,onCopyAndShutdown:a,onCancel:l,countdown:n,isDisconnected:i}){let o=n>0;return(0,s.jsxs)("div",{className:"max-w-xl rounded-2xl bg-background p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl bg-primary/10 p-2 text-primary",children:"content_copy"}),(0,s.jsxs)("h2",{className:"text-xl font-semibold text-text-main",children:["Update Bluerouter",e?` to v${e}`:""]})]}),(0,s.jsx)("p",{className:"mt-3 text-sm text-text-muted",children:i?"Server stopped. Paste the command into a terminal to install.":o?`Command copied. Server will stop in ${n}s...`:"Click the button below to copy the install command and shutdown."}),(0,s.jsxs)("div",{className:"mt-4 rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-semibold text-text-muted",children:"Install command:"}),(0,s.jsx)("code",{className:"break-all font-mono text-xs text-text-main",children:t})]}),(0,s.jsxs)("ol",{className:"mt-4 list-decimal space-y-1 pl-5 text-sm text-text-muted",children:[(0,s.jsx)("li",{children:"Click Copy & Shutdown below."}),(0,s.jsx)("li",{children:"Paste the command into your terminal and press Enter."}),(0,s.jsx)("li",{children:"Run bluerouter again after install."})]}),i?(0,s.jsx)("button",{type:"button",className:"mt-5 w-full rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white",onClick:()=>globalThis.location.reload(),children:"Reload Page"}):(0,s.jsxs)("div",{className:"mt-5 flex gap-3",children:[(0,s.jsx)("button",{type:"button",className:"flex-1 rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",onClick:l,children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"flex-1 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white disabled:opacity-60",onClick:a,disabled:o,children:r?"✓ Copied — shutting down...":o?`Shutting down in ${n}s`:"Copy & Shutdown"})]})]})}j.propTypes={href:n().string.isRequired,label:n().string.isRequired,icon:n().string.isRequired,active:n().bool,onClick:n().func,compact:n().bool},v.propTypes={onClose:n().func},N.propTypes={latestVersion:n().string,installCmd:n().string.isRequired,copied:n().bool,onCopyAndShutdown:n().func.isRequired,onCancel:n().func.isRequired,countdown:n().number,isDisconnected:n().bool}},94230:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497),o=r(11059);function d({isOpen:e,provider:t,onSuccess:r,onClose:l}){let[n,c]=(0,a.useState)("loading"),[m,x]=(0,a.useState)(""),[u,p]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(null),{copied:y,copy:j}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{g(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),r=await e.json();if(!e.ok)throw Error(r.error);p(r),x(r.authUrl),c("input"),window.open(r.authUrl,"_blank")}catch(e){g(e.message),c("error")}})()},[e,t]);let v=async()=>{try{let e;g(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let s=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!s)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,codeVerifier:u.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),r?.()}catch(e){g(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,s.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===y?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,s.jsx)(i.pd,{value:h,onChange:e=>f(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!h,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,s.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},95088:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:r,onClose:l}){let n,[c,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(o),[p,h]=(0,a.useState)(""),[f,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(""),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),R=()=>{m(null),u(o),h(""),b(""),y(""),w(null),v(!1),C(!1),T(null),l()},$=async()=>{if(!g.trim())return void w("Personal Access Token is required");v(!0),w(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:g.trim(),baseUrl:x.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");r?.(),R()}catch(e){w(e.message)}finally{v(!1)}};return e?k&&S?(0,s.jsx)(i.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{r?.(),R()},onClose:()=>{C(!1),T(null)}}):(0,s.jsx)(i.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:R,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{onClick:()=>m("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,s.jsxs)("button",{onClick:()=>m("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,s.jsx)("a",{href:`${x.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(n=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${n}/callback`)})]}),(0,s.jsx)(i.pd,{label:"GitLab Base URL",value:x,onChange:e=>u(e.target.value),placeholder:o}),(0,s.jsx)(i.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,s.jsx)(i.pd,{label:"Client Secret (optional for PKCE)",value:f,onChange:e=>b(e.target.value),placeholder:"Leave empty for public PKCE app"}),N&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:()=>{p.trim()?(w(null),T({baseUrl:x.trim()||o,clientId:p.trim(),clientSecret:f.trim()}),C(!0)):w("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,s.jsx)(i.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,s.jsx)("a",{href:`${x.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,s.jsx)(i.pd,{label:"GitLab Base URL",value:x,onChange:e=>u(e.target.value),placeholder:o}),(0,s.jsx)(i.pd,{label:"Personal Access Token",value:g,onChange:e=>y(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),N&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:$,fullWidth:!0,disabled:!g.trim()||j,loading:j,children:"Connect"}),(0,s.jsx)(i.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:n().bool.isRequired,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},96748:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(95155),a=r(12115),l=r(14051),n=r.n(l),i=r(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:r,onSaved:l,node:n}){let c=!!n,[m,x]=(0,a.useState)({name:"",prefix:"",baseUrl:o}),[u,p]=(0,a.useState)(!1),[h,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(""),[y,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(N(null),f(""),g(""),c?x({name:n.name||"",prefix:n.prefix||"",baseUrl:n.baseUrl||o}):x({name:"",prefix:"",baseUrl:o}))},[e,c,n]);let w=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${n.id}`:"/api/provider-nodes",t=c?"PUT":"POST",s={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(s.type="custom-embedding");let a=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),i=await a.json();a.ok&&(c?l?.(i.node):r?.(i.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},k=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:b.trim()||void 0})}),t=await e.json();N(t)}catch{N({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(i.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(i.pd,{label:"Name",value:m.name,onChange:e=>x({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,s.jsx)(i.pd,{label:"Prefix",value:m.prefix,onChange:e=>x({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,s.jsx)(i.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>x({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,s.jsx)(i.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>f(e.target.value)}),(0,s.jsx)(i.pd,{label:"Model ID (for Check)",value:b,onChange:e=>g(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i.$n,{onClick:k,disabled:!h||!b.trim()||y||!m.baseUrl.trim(),variant:"secondary",children:y?"Checking...":"Check"}),(()=>{if(!v)return null;let{valid:e,error:t,dimensions:r}=v;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Ex,{variant:"success",children:"Valid"}),r&&(0,s.jsxs)("span",{className:"text-sm text-text-muted",children:[r," dims"]})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(i.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.$n,{onClick:w,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||u,children:u?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,s.jsx)(i.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func,onSaved:n().func,node:n().shape({id:n().string,name:n().string,prefix:n().string,baseUrl:n().string})}},97677:(e,t,r)=>{r.d(t,{default:()=>a});var s=r(95155);function a({text:e,children:t,position:r="top",color:l}){let n=l?"":"bg-gray-900";return(0,s.jsxs)("div",{className:"relative inline-flex group",children:[t,(0,s.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[r]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${n} text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,style:l?{backgroundColor:l}:{},children:e})]})}},98542:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(95155),a=r(31474);function l({checked:e=!1,onChange:t,label:r,description:n,disabled:i=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,s.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",d),children:[(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:i,onClick:()=>{!i&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,i&&"cursor-not-allowed"),children:(0,s.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(r||n)&&(0,s.jsxs)("div",{className:"flex flex-col",children:[r&&(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:r}),n&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:n})]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1088],{72546:(e,a,r)=>{Promise.resolve().then(r.bind(r,99296))},99296:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>w});var l=r(95155),t=r(12115),s=r(35497),n=r(65921);let d={"qwen3:1.7b":{minRamFreeMb:2048,minVramFreeMb:0,loadedRamFreeMb:512,loadedVramFreeMb:0,safetyMarginMb:512,notes:"small text model"},"qwen3:4b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:512,notes:"small/medium text model"},"qwen3:8b":{minRamFreeMb:6144,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"8B text model"},"qwen3:14b":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"14B class model"},"qwen3:32b":{minRamFreeMb:4096,minVramFreeMb:16e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"32B class model, GPU preferred"},"qwen3-coder:30b":{minRamFreeMb:8192,minVramFreeMb:24e3,loadedRamFreeMb:2048,loadedVramFreeMb:3072,safetyMarginMb:2048,notes:"30B coder, fits under 32GB VRAM with margin"},"qwen3-coder:latest":{minRamFreeMb:8192,minVramFreeMb:24e3,loadedRamFreeMb:2048,loadedVramFreeMb:3072,safetyMarginMb:2048,notes:"qwen3 coder latest, treat as 30B unless overridden"},"qwen2.5-coder:14b":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"14B coder"},"qwen2.5vl:7b":{minRamFreeMb:8192,minVramFreeMb:8e3,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"7B vision-language"},"qwen2.5vl:latest":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"vision-language latest, conservative"},"qwen3-ijs-k4-translate-vn2jp:latest":{minRamFreeMb:6144,minVramFreeMb:8e3,loadedRamFreeMb:1024,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"custom translate model, non-f16"},"qwen3-ijs-k4-translate:latest":{minRamFreeMb:6144,minVramFreeMb:8e3,loadedRamFreeMb:1024,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"custom translate model, non-f16"},"qwen3-jp-vi-k2-translate-f16:latest":{minRamFreeMb:8192,minVramFreeMb:16e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"custom f16 translate model"},"qwen3-mail-translate-f16:latest":{minRamFreeMb:8192,minVramFreeMb:16e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"custom f16 translate model"},"qwen3-prc-sc-k2-translate-jp2vn:latest":{minRamFreeMb:6144,minVramFreeMb:12e3,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"custom translate model"},"qwen3-jp-vi-translate:latest":{minRamFreeMb:6144,minVramFreeMb:8e3,loadedRamFreeMb:1024,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"custom translate model"},"bge-m3:latest":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:512,loadedVramFreeMb:0,safetyMarginMb:512,notes:"embedding model"},"deepseek-coder:6.7b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"6.7B coder"},"gemma4:e4b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:1024,notes:"small Gemma variant"},"gemma:7b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:1024,notes:"7B text model"},"glm-4.7-flash:latest":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"flash/local text model"},"gpt-oss:20b":{minRamFreeMb:8192,minVramFreeMb:12e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"20B class model, GPU preferred"},"llama3.1:8b":{minRamFreeMb:6144,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"8B text model"},"llama3.2-vision:latest":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"vision model"},"bge-m3:*":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:512,loadedVramFreeMb:0,safetyMarginMb:512,notes:"embedding model wildcard"},"gemma*:e4b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:1024,notes:"Gemma E4B wildcard"},"gemma*:7b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:1024,notes:"Gemma 7B wildcard"},"glm-4.7-flash:*":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"GLM flash wildcard"},"gpt-oss:20b*":{minRamFreeMb:8192,minVramFreeMb:12e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"GPT-OSS 20B wildcard"},"llama3.1:8b*":{minRamFreeMb:6144,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"Llama 3.1 8B wildcard"},"llama3.2-vision:*":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"Llama vision wildcard"},"qwen2.5-coder:14b*":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"Qwen2.5 coder 14B wildcard"},"qwen2.5vl:*":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"Qwen2.5 VL wildcard"},"qwen3-coder:30b*":{minRamFreeMb:8192,minVramFreeMb:24e3,loadedRamFreeMb:2048,loadedVramFreeMb:3072,safetyMarginMb:2048,notes:"Qwen3 coder 30B wildcard"},"qwen3-*-translate-f16:*":{minRamFreeMb:8192,minVramFreeMb:16e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"custom Qwen3 f16 translate wildcard"},"qwen3-*-translate*:latest":{minRamFreeMb:6144,minVramFreeMb:8e3,loadedRamFreeMb:1024,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"custom Qwen3 translate wildcard"},"*:1.7b":{minRamFreeMb:2048,minVramFreeMb:0,loadedRamFreeMb:512,loadedVramFreeMb:0,safetyMarginMb:512,notes:"generic 1.7B fallback"},"*:4b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:0,safetyMarginMb:512,notes:"generic 4B fallback"},"*:6.7b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"generic 6-7B fallback"},"*:7b":{minRamFreeMb:4096,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"generic 7B fallback"},"*:8b":{minRamFreeMb:6144,minVramFreeMb:0,loadedRamFreeMb:1024,loadedVramFreeMb:512,safetyMarginMb:1024,notes:"generic 8B fallback"},"*:14b":{minRamFreeMb:8192,minVramFreeMb:1e4,loadedRamFreeMb:2048,loadedVramFreeMb:1024,safetyMarginMb:1024,notes:"generic 14B fallback"},"*:20b":{minRamFreeMb:8192,minVramFreeMb:12e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"generic 20B fallback"},"*:30b":{minRamFreeMb:8192,minVramFreeMb:24e3,loadedRamFreeMb:2048,loadedVramFreeMb:3072,safetyMarginMb:2048,notes:"generic 30B fallback"},"*:32b":{minRamFreeMb:4096,minVramFreeMb:16e3,loadedRamFreeMb:2048,loadedVramFreeMb:2048,safetyMarginMb:2048,notes:"generic 32B fallback"}},o=["minRamFreeMb","minVramFreeMb","loadedRamFreeMb","loadedVramFreeMb","safetyMarginMb"],i={minRamFreeMb:"Wake RAM MB (sleep)",minVramFreeMb:"Wake VRAM MB (sleep)",loadedRamFreeMb:"Loaded RAM MB (loaded)",loadedVramFreeMb:"Loaded VRAM MB (loaded)",safetyMarginMb:"Safety MB (buffer)"},m={model:"",minRamFreeMb:"4096",minVramFreeMb:"0",loadedRamFreeMb:"1024",loadedVramFreeMb:"0",safetyMarginMb:"1024"},c={model:"",overrideEnabled:!1,minRamFreeMb:"",minVramFreeMb:"",loadedRamFreeMb:"",loadedVramFreeMb:"",safetyMarginMb:""};function b(e){return null!=e&&""!==String(e).trim()}function x(e){return b(e)?String(e):""}function u(e,a=!1){if(null==e||""===e)return a;if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;let r=String(e).trim().toLowerCase();return!!["true","1","yes","y","on","enabled"].includes(r)||!["false","0","no","n","off","disabled"].includes(r)&&!!e}function M(e={},{overrideRows:a=!1}={}){return Object.entries(e||{}).map(([e,r])=>({model:e,overrideEnabled:!a||u(r?.enabled,!0),minRamFreeMb:x(r?.minRamFreeMb),minVramFreeMb:x(r?.minVramFreeMb),loadedRamFreeMb:x(r?.loadedRamFreeMb),loadedVramFreeMb:x(r?.loadedVramFreeMb),safetyMarginMb:x(r?.safetyMarginMb)}))}function h(){return{name:"",host:"",sshUser:"root",sshPort:22,useSudo:!1,agentPort:19999,agentToken:"",ollamaPorts:"11434",refreshIntervalMs:15e3,ufwAllowFrom:"",enabled:!0,useGlobalModelMemory:!0,notes:""}}function f(e){if(!e)return"Never";let a=new Date(e);return Number.isNaN(a.getTime())?"Never":a.toLocaleString()}function g(e){let a=Number(e||0);return Number.isFinite(a)?a>=1024?`${(a/1024).toFixed(1)} GB`:`${Math.round(a)} MB`:"-"}function p(e){let a=new Set,r=e?.lastStatus||{};for(let e of r.instances||[])for(let r of e.models||[])a.add(r);for(let e of r.ollama?.models||[])a.add(e);return[...a].sort()}function v(e=[],a=[],r=[]){let l=new Map;for(let a of e){let e=String(a.model||"").trim();e&&l.set(e,{...c,model:e,overrideEnabled:!1})}for(let e of r)l.has(e)||l.set(e,{...c,model:e,overrideEnabled:!1});for(let e of a){let a=String(e.model||"").trim();a&&l.set(a,{...c,...e,model:a,overrideEnabled:u(e.overrideEnabled,!0)})}return[...l.values()].sort((e,a)=>String(e.model).localeCompare(String(a.model)))}function F({children:e,variant:a="muted"}){return(0,l.jsx)("div",{className:`mt-1 truncate text-[10px] leading-4 ${"override"===a?"text-blue-600":"warning"===a?"text-amber-600":"text-text-muted"}`,children:e})}function j({value:e,onChange:a,disabled:r=!1,globalValue:t,globalEnabled:s=!0}){let n=b(e),d=b(t)?t:"none";return(0,l.jsxs)("div",{className:"min-w-[130px]",children:[(0,l.jsx)("input",{value:e??"",disabled:r,placeholder:s&&b(t)?String(t):"0",onChange:e=>a(e.target.value),className:`w-full rounded-md border border-border px-2 py-1.5 text-xs outline-none focus:border-primary ${r?"bg-surface-2 text-text-muted":"bg-background text-text-main"}`}),s?(0,l.jsxs)(F,{variant:n?"override":"muted",children:["Global: ",d,n?" \xb7 override":" \xb7 using global"]}):(0,l.jsx)(F,{variant:"warning",children:"Global disabled"})]})}function y({row:e,globalRule:a,useGlobal:r}){if(u(e.overrideEnabled,!1)){let a=o.filter(a=>b(e[a])).length;return(0,l.jsxs)(s.Ex,{variant:"warning",children:["override ",a,"/5"]})}return r&&a?(0,l.jsx)(s.Ex,{variant:"success",children:"global"}):r?(0,l.jsx)(s.Ex,{variant:"error",children:"no rule"}):(0,l.jsx)(s.Ex,{variant:"default",children:"global off"})}function w(){let e=(0,n.i)(),[a,r]=(0,t.useState)([]),[x,w]=(0,t.useState)(M(d)),[N,R]=(0,t.useState)(null),[V,S]=(0,t.useState)(!0),[k,C]=(0,t.useState)("nodes"),[E,O]=(0,t.useState)(!1),[A,$]=(0,t.useState)(!1),[P,B]=(0,t.useState)(null),[q,G]=(0,t.useState)(null),[T,I]=(0,t.useState)(h()),[U,L]=(0,t.useState)([]),[D,z]=(0,t.useState)(""),[H,_]=(0,t.useState)(""),[Q,W]=(0,t.useState)(!1),[J,Z]=(0,t.useState)(null),[K,X]=(0,t.useState)(""),[Y,ee]=(0,t.useState)(null),[ea,er]=(0,t.useState)(!1),el=(0,t.useCallback)(async()=>{try{let e=await fetch("/api/ollama-model-memory",{cache:"no-store"}),a=await e.json();e.ok&&(w(M(a.requirements||a.modelMemoryRequirements||d)),R(a.updatedAt||null))}catch{e.error("Failed to load global model memory map")}},[e]),et=(0,t.useCallback)(async()=>{try{let e=await fetch("/api/ollama-nodes",{cache:"no-store"}),a=await e.json();e.ok&&r(a.nodes||[])}catch{e.error("Failed to load Ollama nodes")}finally{S(!1)}},[e]),es=(0,t.useCallback)(async(a,r=!1)=>{Z(a);try{let l=await fetch(`/api/ollama-nodes/${a}/status`,{method:"POST"}),t=await l.json();l.ok||r||e.error(t.error||"Refresh failed"),await et(),l.ok&&!r&&e.success("Status refreshed")}catch{r||e.error("Refresh failed")}finally{Z(null)}},[et,e]);(0,t.useEffect)(()=>{el(),et()},[el,et]),(0,t.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();a.forEach(a=>{if(!a.enabled)return;let r=a.lastStatusAt?new Date(a.lastStatusAt).getTime():0,l=Math.max(5e3,Number(a.refreshIntervalMs||15e3));(!r||e-r>=l)&&es(a.id,!0)})},5e3);return()=>clearInterval(e)},[a,es]);let en=(0,t.useMemo)(()=>a.filter(e=>e.lastStatus?.ok&&!e.lastError).length,[a]),ed=(0,t.useMemo)(()=>v(x,U,P?p(P):[]),[P,x,U]),eo=()=>{B(null),I(h()),L(v(x,[],[])),O(!0)},ei=async()=>{if(!T.host.trim())return void e.warning("Host/IP is required");let a=function(e=[]){let a={};for(let r of e){let e=String(r.model||"").trim();if(!e||!u(r.overrideEnabled,!1))continue;let l={enabled:!0};for(let e of o)b(r[e])&&(l[e]=Math.max(0,Number(r[e]||0)));a[e]=l}return a}(ed);if(!u(T.useGlobalModelMemory,!0)&&!Object.keys(a).length)return void e.warning("Global map is disabled for this node. Enable at least one node override rule.");W(!0);try{let r={...T,modelMemoryRequirements:a},l=await fetch(P?`/api/ollama-nodes/${P.id}`:"/api/ollama-nodes",{method:P?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),t=await l.json();if(!l.ok)throw Error(t.error||"Save failed");O(!1),await et(),e.success(P?"Ollama node updated":"Ollama node added")}catch(a){e.error(a.message||"Save failed")}finally{W(!1)}},em=async()=>{if(q){Z(q.id),X("Installing...\n");try{let a=await fetch(`/api/ollama-nodes/${q.id}/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sshPassword:D,sudoPassword:H,ufwAllowFrom:q.ufwAllowFrom})}),r=await a.json(),l=r.result?[r.result.stdout,r.result.stderr].filter(Boolean).join("\n"):r.error||"";if(X(l),!a.ok)throw Error(r.error||"Install failed");e.success("Agent installed"),await es(q.id,!0)}catch(a){e.error(a.message||"Install failed")}finally{Z(null)}}},ec=(e,a,r)=>{L(()=>ed.map((l,t)=>t===e?{...l,[a]:"overrideEnabled"===a?u(r,!1):r}:l))},eb=async()=>{let a=P;if(a?.id){await es(a.id,!0);let e=await fetch("/api/ollama-nodes",{cache:"no-store"}).then(e=>e.json()).catch(()=>null);(a=e?.nodes?.find(e=>e.id===a.id)||a)&&B(a)}let r=p(a);if(!r.length)return void e.warning("No detected models found on this node yet. Refresh status first.");let l=new Set(ed.map(e=>String(e.model||"").trim()).filter(Boolean)),t=r.filter(e=>!l.has(e)).map(e=>({...c,model:e,overrideEnabled:!1}));t.length?(L(e=>[...ed,...t]),e.success(`Added ${t.length} detected model row(s). Toggle Override ON to customize them.`)):e.success("All detected models are already visible in this node table")},ex=(e,a,r)=>{w(l=>l.map((l,t)=>t===e?{...l,[a]:r}:l))},eu=async()=>{er(!0);try{let a=function(e=[]){let a={};for(let r of e){let e=String(r.model||"").trim();if(e)for(let l of(a[e]={},o))a[e][l]=Math.max(0,Number(r[l]||0))}return a}(x),r=await fetch("/api/ollama-model-memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirements:a})}),l=await r.json();if(!r.ok)throw Error(l.error||"Save global map failed");R(l.updatedAt||new Date().toISOString()),e.success("Global model memory map saved"),await et()}catch(a){e.error(a.message||"Save global map failed")}finally{er(!1)}};return V?(0,l.jsx)(s.Qv,{}):(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Ollama Nodes"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Remote install and monitor LAN Ollama hardware agents for hardware-aware routing."})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(s.Ex,{children:["Total: ",a.length]}),(0,l.jsxs)(s.Ex,{variant:"success",children:["Online: ",en]}),(0,l.jsx)(s.$n,{icon:"add",onClick:eo,children:"Add Ollama Node"})]})]}),(0,l.jsxs)("div",{className:"rounded-2xl border border-border bg-surface-1 p-1",children:[(0,l.jsx)("button",{type:"button",onClick:()=>C("nodes"),className:`rounded-xl px-4 py-2 text-sm ${"nodes"===k?"bg-primary text-white":"text-text-muted hover:bg-surface-2"}`,children:"Nodes"}),(0,l.jsx)("button",{type:"button",onClick:()=>C("global"),className:`rounded-xl px-4 py-2 text-sm ${"global"===k?"bg-primary text-white":"text-text-muted hover:bg-surface-2"}`,children:"Global Model Memory Map"})]}),"global"===k?(0,l.jsxs)(s.Zp,{className:"p-5",children:[(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Global Model Memory Map"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Global default RAM/VRAM thresholds used by all Ollama nodes. Node Override rules take priority only when Override is ON for that model."}),(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:["Patterns with * are supported, for example ",(0,l.jsx)("span",{className:"font-mono",children:"gemma*"})," or ",(0,l.jsx)("span",{className:"font-mono",children:"bge-m3:*"}),". Last saved: ",f(N)]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(s.$n,{variant:"secondary",icon:"add",onClick:()=>((e="")=>{w(a=>[...a,{...m,model:e}])})(),children:"Add Rule"}),(0,l.jsx)(s.$n,{variant:"secondary",icon:"download",onClick:()=>{let r=function(e=[]){let a=[],r=new Set;for(let l of e)for(let e of p(l))a.push(e),r.add(e);return{raw:a,unique:[...r].sort()}}(a);if(!r.unique.length)return void e.warning("No detected models found yet. Refresh one or more nodes first.");let l=new Set(x.map(e=>String(e.model||"").trim()).filter(Boolean)),t=r.unique.filter(e=>!l.has(e)).map(e=>({...m,model:e}));t.length?(w(e=>[...e,...t]),e.success(`Detected ${r.raw.length} entries, ${r.unique.length} unique. Added ${t.length}, skipped ${r.unique.length-t.length}.`)):e.success(`Detected ${r.raw.length} entries, ${r.unique.length} unique. All already exist in the global map.`)},children:"Import Detected"}),(0,l.jsx)(s.$n,{variant:"secondary",icon:"auto_fix_high",onClick:()=>{w(M(d)),e.success("Loaded default model memory presets")},children:"Presets"}),(0,l.jsx)(s.$n,{loading:ea,onClick:eu,children:ea?"Saving...":"Save Global Map"})]})]}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,l.jsxs)("table",{className:"w-full min-w-[980px] text-left text-sm",children:[(0,l.jsx)("thead",{className:"bg-surface-2 text-xs uppercase text-text-muted",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"px-3 py-2",children:"Model / Pattern"}),o.map(e=>(0,l.jsx)("th",{className:"px-3 py-2",children:i[e]},e)),(0,l.jsx)("th",{className:"px-3 py-2 text-right",children:"Action"})]})}),(0,l.jsx)("tbody",{children:x.map((e,a)=>(0,l.jsxs)("tr",{className:"border-t border-border",children:[(0,l.jsx)("td",{className:"px-3 py-2",children:(0,l.jsx)("input",{value:e.model,onChange:e=>ex(a,"model",e.target.value),placeholder:"qwen3:8b or gemma*",className:"w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs outline-none focus:border-primary"})}),o.map(r=>(0,l.jsx)("td",{className:"px-3 py-2",children:(0,l.jsx)("input",{value:e[r]??"",onChange:e=>ex(a,r,e.target.value),className:"w-32 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none focus:border-primary"})},r)),(0,l.jsx)("td",{className:"px-3 py-2 text-right",children:(0,l.jsx)("button",{type:"button",onClick:()=>{w(e=>e.filter((e,r)=>r!==a))},className:"rounded-md px-2 py-1 text-red-500 hover:bg-red-500/10",title:"Remove rule",children:(0,l.jsx)("span",{className:"material-icons text-base",children:"delete"})})})]},`${e.model}-${a}`))})]})}),(0,l.jsxs)("div",{className:"mt-4 grid gap-3 md:grid-cols-3",children:[(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-xs text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Wake:"})," sleeping model needs Wake RAM/VRAM + Safety."]}),(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-xs text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Loaded:"})," loaded model only needs smaller Loaded RAM/VRAM + Safety overhead."]}),(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-xs text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Override:"})," node-specific enabled rows have priority over global rules."]})]})]}):0===a.length?(0,l.jsxs)(s.Zp,{className:"p-8 text-center",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"No Ollama nodes yet"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Add a LAN Ollama machine, then install the hardware status agent from this dashboard."}),(0,l.jsx)(s.$n,{className:"mt-4",icon:"add",onClick:eo,children:"Add Ollama Node"})]}):(0,l.jsx)("div",{className:"grid gap-4",children:a.map(a=>{let r=a.lastStatus||{},t=a.lastEvaluation||{},n=r.hardware?.gpus||[],d=r.hardware?.ram||{};return(0,l.jsxs)(s.Zp,{className:"p-5",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:a.name}),(0,l.jsx)(s.Ex,{variant:a.lastError?"error":a.lastStatus?.ok?"success":"default",children:a.lastError?"error":r.ok?"online":"unknown"}),t.hasBlockedSleepingModels?(0,l.jsx)(s.Ex,{variant:"error",children:"blocked sleeping models"}):null,(0,l.jsx)(s.Ex,{variant:a.enabled?"success":"default",children:a.enabled?"enabled":"disabled"}),(0,l.jsx)(s.Ex,{variant:u(a.useGlobalModelMemory,!0)?"success":"warning",children:u(a.useGlobalModelMemory,!0)?"global on":"global off"})]}),(0,l.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[a.host,":",a.agentPort," \xb7 Ollama ports ",(a.ollamaPorts||[]).join(", ")," \xb7 Refresh ",a.refreshIntervalMs,"ms"]}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Last status: ",f(a.lastStatusAt),a.lastError?` \xb7 ${a.lastError}`:""]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(s.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>es(a.id),disabled:J===a.id,children:J===a.id?"Working...":"Refresh"}),(0,l.jsx)(s.$n,{size:"sm",variant:"secondary",icon:"terminal",onClick:()=>{G(a),z(""),_(""),X(""),$(!0)},children:"Install Agent"}),(0,l.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"edit",onClick:()=>{B(a),I({...h(),...a,ollamaPorts:(a.ollamaPorts||[11434]).join(","),useGlobalModelMemory:u(a.useGlobalModelMemory,!0)}),L(v(x,M(a.modelMemoryRequirements||{},{overrideRows:!0}),p(a))),O(!0)},children:"Edit"}),(0,l.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"delete",onClick:()=>{ee({title:"Delete Ollama Node",message:`Delete node "${a.name}"?`,onConfirm:async()=>{ee(null),(await fetch(`/api/ollama-nodes/${a.id}`,{method:"DELETE"})).ok?(await et(),e.success("Node deleted")):e.error("Delete failed")}})},children:"Delete"})]})]}),(0,l.jsxs)("div",{className:"mt-4 grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,l.jsx)("div",{className:"text-sm text-text-muted",children:"RAM"}),(0,l.jsxs)("div",{className:"mt-1 text-xl font-semibold text-text-main",children:[g(d.availableMb)," free"]}),(0,l.jsxs)("div",{className:"text-sm text-text-muted",children:["Total ",g(d.totalMb)," \xb7 Used ",d.usedPercent??"-","%"]})]}),(0,l.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,l.jsx)("div",{className:"text-sm text-text-muted",children:"GPU"}),n.length?n.map((e,a)=>(0,l.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:e.name}),(0,l.jsxs)(s.Ex,{children:["VRAM ",g(e.vramFreeMb)," / ",g(e.vramTotalMb)," free"]}),(0,l.jsxs)(s.Ex,{children:["GPU ",e.gpuUsagePercent,"%"]}),(0,l.jsxs)(s.Ex,{variant:Number(e.temperatureC)>=80?"error":"success",children:[e.temperatureC,"\xb0C"]})]},`${e.name}-${a}`)):(0,l.jsx)("div",{className:"mt-2 text-sm text-text-muted",children:"No NVIDIA GPU detected"})]})]}),(0,l.jsx)("div",{className:"mt-4 space-y-3",children:(t.instances||[]).map(e=>(0,l.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)("h3",{className:"font-semibold text-text-main",children:["Ollama :",e.port||"default"]}),(0,l.jsx)(s.Ex,{variant:e.alive?"success":"error",children:e.alive?"alive":"down"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:e.baseUrl})]}),e.modelReadiness?.length?(0,l.jsx)("div",{className:"mt-3 grid gap-2 md:grid-cols-2 xl:grid-cols-3",children:e.modelReadiness.map(e=>{var a;return(0,l.jsxs)("div",{className:"rounded-lg bg-surface-2 p-3 text-sm",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"font-mono text-xs text-text-main",children:e.model}),(0,l.jsx)(s.Ex,{variant:e.loaded?"success":"default",children:e.loaded?"loaded":"sleeping"}),(0,l.jsx)(s.Ex,{variant:(a=e.status)?a.includes("insufficient")||a.includes("low")?"error":a.includes("unconfigured")?"warning":"success":"default",children:e.status}),(0,l.jsx)(s.Ex,{variant:e.ruleSource?.includes("node")?"warning":"global"===e.ruleSource?"success":"default",children:e.ruleSource||"none"})]}),(0,l.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e.reason})]},e.model)})}):(0,l.jsx)("div",{className:"mt-3 text-sm text-text-muted",children:"No models reported for this instance."})]},e.id||e.port||e.baseUrl))})]},a.id)})}),(0,l.jsx)(s.aF,{isOpen:E,onClose:()=>O(!1),title:P?"Edit Ollama Node":"Add Ollama Node",size:"full",className:"max-w-[1180px]",footer:(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(s.$n,{onClick:ei,loading:Q,children:Q?"Saving...":"Save"}),(0,l.jsx)(s.$n,{variant:"ghost",onClick:()=>O(!1),disabled:Q,children:"Cancel"})]}),children:(0,l.jsxs)("div",{className:"max-h-[75vh] space-y-5 overflow-y-auto pr-2",children:[(0,l.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,l.jsx)(s.pd,{label:"Name",value:T.name,onChange:e=>I(a=>({...a,name:e.target.value})),placeholder:"A2 node"}),(0,l.jsx)(s.pd,{label:"Host/IP",value:T.host,onChange:e=>I(a=>({...a,host:e.target.value})),placeholder:"192.168.1.10"}),(0,l.jsx)(s.pd,{label:"SSH User",value:T.sshUser,onChange:e=>I(a=>({...a,sshUser:e.target.value})),placeholder:"root or ubuntu"}),(0,l.jsx)(s.pd,{label:"SSH Port",value:T.sshPort,onChange:e=>I(a=>({...a,sshPort:e.target.value})),placeholder:"22"}),(0,l.jsx)(s.pd,{label:"Agent Port",value:T.agentPort,onChange:e=>I(a=>({...a,agentPort:e.target.value})),placeholder:"19999"}),(0,l.jsx)(s.pd,{label:"Agent Token",value:T.agentToken,onChange:e=>I(a=>({...a,agentToken:e.target.value})),placeholder:"auto if empty"}),(0,l.jsx)(s.pd,{label:"Ollama Ports",value:T.ollamaPorts,onChange:e=>I(a=>({...a,ollamaPorts:e.target.value})),placeholder:"11434,11435"}),(0,l.jsx)(s.pd,{label:"Refresh Interval MS",value:T.refreshIntervalMs,onChange:e=>I(a=>({...a,refreshIntervalMs:e.target.value})),placeholder:"15000"}),(0,l.jsx)(s.pd,{label:"UFW Allow From",value:T.ufwAllowFrom,onChange:e=>I(a=>({...a,ufwAllowFrom:e.target.value})),placeholder:"192.168.1.0/24"})]}),(0,l.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,l.jsx)("div",{className:"rounded-xl border border-border p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Use sudo"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Enable when SSH user is not root but has sudo rights."})]}),(0,l.jsx)(s.lM,{checked:u(T.useSudo,!1),onChange:e=>I(a=>({...a,useSudo:u(e,!1)}))})]})}),(0,l.jsx)("div",{className:"rounded-xl border border-border p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Use Global Model Memory Map"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Global rules are fallback values for every model. Use the per-model Override switch below only when this node needs different RAM/VRAM thresholds."})]}),(0,l.jsx)(s.lM,{checked:u(T.useGlobalModelMemory,!0),onChange:e=>I(a=>({...a,useGlobalModelMemory:u(e,!0)}))})]})})]}),(0,l.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,l.jsxs)("div",{className:"mb-3 flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Per-model Node Overrides"}),(0,l.jsx)(s.Ex,{variant:"warning",children:"override per model"}),(0,l.jsx)(s.Ex,{variant:u(T.useGlobalModelMemory,!0)?"success":"warning",children:u(T.useGlobalModelMemory,!0)?"global fallback on":"global disabled"})]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Override OFF = use the Global Model Memory Map. Override ON = this node can override that model; empty fields still inherit the Global value shown under each textbox."})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(s.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>((e="")=>{L(a=>[...ed,{...c,model:e,overrideEnabled:!0}])})(),children:"Add Override"}),P?(0,l.jsx)(s.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eb,children:"Import Detected"}):null,(0,l.jsx)(s.$n,{size:"sm",variant:"secondary",icon:"cleaning_services",onClick:()=>{L(v(x,[],P?p(P):[])),e.success("Cleared node override rows")},children:"Clear Overrides"})]})]}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,l.jsxs)("table",{className:"w-full min-w-[1120px] text-left text-sm",children:[(0,l.jsx)("thead",{className:"bg-surface-2 text-xs uppercase text-text-muted",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"px-3 py-2",children:"Model / Pattern"}),(0,l.jsx)("th",{className:"px-3 py-2",children:"Override"}),(0,l.jsx)("th",{className:"px-3 py-2",children:"Source"}),o.map(e=>(0,l.jsx)("th",{className:"px-3 py-2",children:i[e]},e)),(0,l.jsx)("th",{className:"px-3 py-2 text-right",children:"Action"})]})}),(0,l.jsxs)("tbody",{children:[ed.map((e,a)=>{let r=u(T.useGlobalModelMemory,!0),t=u(e.overrideEnabled,!1),n=r?function(e=[],a){let r=String(a||"").trim();if(!r)return null;let l=e.find(e=>String(e.model||"")===r);if(l)return{row:l,key:l.model,matchType:"exact"};let t=r.toLowerCase(),s=e.find(e=>String(e.model||"").toLowerCase()===t);if(s)return{row:s,key:s.model,matchType:"case-insensitive"};let n=e.find(e=>{let a;return String(e.model||"").includes("*")&&(a=String(e.model||"").split("*").map(e=>e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&")).join(".*"),RegExp(`^${a}$`,"i")).test(r)});return n?{row:n,key:n.model,matchType:"wildcard"}:null}(x,e.model):null,d=n?.row||null,i=!t;return(0,l.jsxs)("tr",{className:"border-t border-border",children:[(0,l.jsxs)("td",{className:"px-3 py-2 align-top",children:[(0,l.jsx)("input",{value:e.model,onChange:e=>ec(a,"model",e.target.value),placeholder:"qwen3:8b",className:"w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs outline-none focus:border-primary"}),n?.matchType==="wildcard"?(0,l.jsxs)(F,{children:["Matched global pattern: ",n.key]}):null]}),(0,l.jsx)("td",{className:"px-3 py-2 align-top",children:(0,l.jsx)(s.lM,{checked:t,onChange:e=>ec(a,"overrideEnabled",e)})}),(0,l.jsx)("td",{className:"px-3 py-2 align-top",children:(0,l.jsx)(y,{row:e,globalRule:d,useGlobal:r})}),o.map(t=>(0,l.jsx)("td",{className:"px-3 py-2 align-top",children:(0,l.jsx)(j,{value:e[t]??"",disabled:i,globalValue:d?.[t],globalEnabled:r,onChange:e=>ec(a,t,e)})},t)),(0,l.jsx)("td",{className:"px-3 py-2 text-right align-top",children:(0,l.jsx)("button",{type:"button",onClick:()=>{L(e=>ed.filter((e,r)=>r!==a))},className:"rounded-md px-2 py-1 text-red-500 hover:bg-red-500/10",title:"Remove row",children:(0,l.jsx)("span",{className:"material-icons text-base",children:"delete"})})})]},`${e.model}-${a}`)}),0===ed.length?(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:9,className:"px-3 py-6 text-center text-sm text-text-muted",children:"No rows. Add an override or import detected models."})}):null]})]})}),(0,l.jsxs)("div",{className:"mt-3 grid gap-3 text-xs md:grid-cols-3",children:[(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Override OFF:"})," model uses global rule when global fallback is enabled."]}),(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Override ON:"})," filled fields override global; empty fields still inherit global."]}),(0,l.jsxs)("div",{className:"rounded-xl bg-surface-2 p-3 text-text-muted",children:[(0,l.jsx)("b",{className:"text-text-main",children:"Global OFF:"})," only enabled node override rows are used for this node."]})]})]})]})}),(0,l.jsx)(s.aF,{isOpen:A,onClose:()=>$(!1),title:`Install agent: ${q?.name||""}`,children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"rounded-xl border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:"Passwords are used only for this install request and are not stored. The server running BlueRouter needs ssh or sshpass installed for password-based SSH."}),(0,l.jsx)(s.pd,{label:"SSH Password",value:D,onChange:e=>z(e.target.value),type:"password",placeholder:"leave empty for SSH key"}),q?.useSudo?(0,l.jsx)(s.pd,{label:"Sudo Password",value:H,onChange:e=>_(e.target.value),type:"password",placeholder:"leave empty to reuse SSH password or passwordless sudo"}):null,(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(s.$n,{onClick:em,disabled:J===q?.id,children:J===q?.id?"Installing...":"Install / Update Agent"}),(0,l.jsx)(s.$n,{variant:"ghost",onClick:()=>$(!1),disabled:J===q?.id,children:"Close"})]}),K?(0,l.jsx)("pre",{className:"max-h-64 overflow-auto rounded-xl bg-surface-2 p-3 text-xs text-text-main",children:K}):null]})}),(0,l.jsx)(s.uo,{isOpen:!!Y,onClose:()=>ee(null),onConfirm:Y?.onConfirm,title:Y?.title||"Confirm",message:Y?.message,variant:"danger"})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=72546)),_N_E=e.O()}]);
|
|
Binary file
|
|
Binary file
|
package/app/package.json
CHANGED