@jheavenknows/bluerouter 1.0.118 → 1.0.119
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 +4 -4
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
- 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/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.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/_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/options/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-health/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/v1beta/models/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/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/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.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/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 +1 -1
- 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.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 +4 -4
- package/app/.next-cli-build/server/chunks/2496.js +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/6604.js +1 -1
- package/app/.next-cli-build/server/chunks/7130.js +1 -1
- package/app/.next-cli-build/server/chunks/7153.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-bd6fad95132fd93f.js → 1321-471862e81229a7b9.js} +1 -1
- package/app/.next-cli-build/static/chunks/5497-89c313367ff90255.js +7 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-54d0a876cf56345f.js → page-a8ce9e441cbc67b3.js} +2 -2
- 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/5497-711bf598e02550cc.js +0 -7
- /package/app/.next-cli-build/static/{CMWn-EVG6KE1-Qmhm2AR5 → Kn6gx-6qm3F1d1lL4KoaP}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{CMWn-EVG6KE1-Qmhm2AR5 → Kn6gx-6qm3F1d1lL4KoaP}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.112-to-1.0.113-1.0.113-20260609-204959 → upgrade-1.0.118-to-1.0.119-1.0.119-20260609-224309}/data.sqlite +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=6604,exports.ids=[6604],exports.modules={267:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(51126),h=c(99258);let i=a=>({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 (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",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"}})[a]||{name:a,flag:"\uD83C\uDF10"};function j({className:a="",isOpen:b,onClose:c,hideTrigger:k=!1}){let[l,m]=(0,e.useState)("en"),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),r=(0,e.useRef)(null),s="boolean"==typeof b,t=s?b:p,u=a=>{s?!a&&c&&c(l):q(a)},v=async a=>{if(a!==l&&!n){o(!0),u(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:a})}),await (0,h.wn)(),m(a)}catch(a){console.error("Failed to set locale:",a)}finally{o(!1)}}};return(0,d.jsxs)("div",{className:a,children:[!k&&(0,d.jsxs)("button",{onClick:()=>u(!t),disabled:n,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:i(l).name}),(0,d.jsx)("span",{className:"text-lg",children:i(l).flag})]}),t&&(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>u(!1)}),(0,d.jsxs)("div",{ref:r,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,d.jsx)("button",{onClick:()=>u(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,d.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:g.YZ.map(a=>{let b=l===a,c=i(a);return(0,d.jsxs)("button",{onClick:()=>v(a),disabled:n,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${b?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${n?"opacity-70 cursor-wait":""}`,title:c.name,children:[(0,d.jsx)("span",{className:"text-2xl",children:c.flag}),(0,d.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:c.name}),b&&(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},a)})})})]})]}),document.body)]})}},962:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\McpMarketplaceModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\McpMarketplaceModal.js","default")},2287:(a,b,c)=>{Promise.resolve().then(c.bind(c,18200)),Promise.resolve().then(c.bind(c,70061)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,33811)),Promise.resolve().then(c.bind(c,20493)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,70139)),Promise.resolve().then(c.bind(c,49123)),Promise.resolve().then(c.bind(c,64148)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,29354)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,962)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,29674)),Promise.resolve().then(c.bind(c,5843)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,81923)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,18421)),Promise.resolve().then(c.bind(c,2422))},2422:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\UsageStats.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\UsageStats.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\OAuthModal.js","default")},3236:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f);c(51126);var h=c(42118),i=c(11229);c(97564);var j=c(267);let k={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 l({icon:a,label:b,onClick:c,trailing:e,danger:f}){return(0,d.jsxs)("button",{onClick:c,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${f?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f?"":"text-text-muted"}`,children:a}),(0,d.jsx)("span",{className:"flex-1 text-left",children:b}),e&&(0,d.jsx)("span",{className:"text-base",children:e})]})}function m({onLogout:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)("en"),{toggleTheme:r,isDark:s}=(0,h.D)(),t=(0,e.useRef)(null);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative",ref:t,children:[(0,d.jsx)("button",{onClick:()=>c(a=>!a),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,d.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),b&&(0,d.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,d.jsx)(l,{icon:"history",label:"Change Log",onClick:()=>{c(!1),g(!0)}}),(0,d.jsx)(l,{icon:"language",label:k[p]?.name||p,trailing:k[p]?.flag||"\uD83C\uDF10",onClick:()=>{c(!1),o(!0)}}),(0,d.jsx)(l,{icon:s?"light_mode":"dark_mode",label:"Theme",onClick:()=>{r(),c(!1)}}),(0,d.jsx)(l,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{c(!1),a()}})]})]}),(0,d.jsx)(i.default,{isOpen:f,onClose:()=>g(!1)}),(0,d.jsx)(j.default,{hideTrigger:!0,isOpen:n,onClose:a=>{o(!1),q(a)}})]})}l.propTypes={icon:g().string.isRequired,label:g().string.isRequired,onClick:g().func.isRequired,trailing:g().node,danger:g().bool},m.propTypes={onLogout:g().func.isRequired}},4770:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,options:b=[],value:c,onChange:g,placeholder:h="Select an option",error:i,hint:j,disabled:k=!1,required:l=!1,className:m,selectClassName:n,...o}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",m),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,l&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("select",{value:c,onChange:g,disabled:k,className:(0,e.cn)("w-full py-2.5 px-3 pr-10 text-sm text-text-main","bg-surface-2 border border-transparent rounded-[10px] appearance-none","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",n),...o,children:[(0,d.jsx)("option",{value:"",disabled:!0,children:h}),b.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}),(0,d.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},5291:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(79346),i=c(86209),j=c(56110);function k({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),q=(0,e.useCallback)((a,b)=>{"builder-id"===a?l("builder-id"):"idc"===a?(l("idc"),p(b)):"social"===a?(l("social"),n(b.provider)):"import"===a&&c?.()},[c]),r=()=>{l(null),n(null),p(null)};return g?"builder-id"===g||"idc"===g?(0,d.jsx)(h.default,{isOpen:a,provider:"kiro",providerInfo:b,onSuccess:()=>{l(null),p(null),c?.(),f?.()},onClose:r,idcConfig:o}):"social"===g&&m?(0,d.jsx)(j.default,{isOpen:a,provider:m,onSuccess:()=>{l(null),n(null),c?.(),f?.()},onClose:r}):null:(0,d.jsx)(i.default,{isOpen:a,onMethodSelect:q,onClose:f})}k.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},5843:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\NoAuthProxyCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\NoAuthProxyCard.js","default")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Card.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Modal.js","ConfirmModal")},10535:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,86739)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,86209)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,54004)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,87226))},11229:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(49885),h=c.n(g),i=c(26921);function j({isOpen:a,onClose:b}){let[c,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),m=(0,e.useRef)(null);return!a||"u"<typeof document?null:(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{ref:m,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),k&&(0,d.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",k]}),!h&&!k&&c&&(0,d.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:c}})]})]})]}),document.body)}c(12020),i.xI.setOptions({gfm:!0,breaks:!0}),j.propTypes={isOpen:h().bool.isRequired,onClose:h().func.isRequired}},11633:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(17660);let f={mode:{label:"Mode",format:a=>a},defaultModel:{label:"Model",format:a=>a,mono:!0},baseUrl:{label:"Endpoint",format:a=>a,isLink:!0,mono:!0},costPerQuery:{label:"Cost / call",format:a=>0===a?"Free":`$${a.toFixed(4)}`},pricingUrl:{label:"Pricing",format:()=>"View pricing",isLink:!0},freeTier:{label:"Free tier",format:a=>a},freeMonthlyQuota:{label:"Free quota",format:a=>0===a?"—":a>=999999?"Unlimited":`${a.toLocaleString()} / mo`},searchTypes:{label:"Types",format:a=>a.join(", ")},formats:{label:"Formats",format:a=>a.join(", ")},maxMaxResults:{label:"Max results",format:a=>a},maxCharacters:{label:"Max chars",format:a=>a.toLocaleString()}};function g({config:a,provider:b,title:c="Provider Info"}){if(!a)return null;let h=Object.entries(f).filter(([b])=>void 0!==a[b]&&null!==a[b]&&""!==a[b]).map(([b,c])=>({key:b,label:c.label,value:c.format(a[b]),isLink:c.isLink,mono:c.mono,raw:a[b]})),i=b?.notice?.apiKeyUrl||b?.website,j=b?.notice?.text;return(0,d.jsxs)(e.default,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:c}),i&&(0,d.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2",children:[h.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0",children:a.label}),a.isLink?(0,d.jsx)("a",{href:a.raw,target:"_blank",rel:"noopener noreferrer",className:`text-sm text-primary hover:underline truncate ${a.mono?"font-mono":""}`,children:a.value}):(0,d.jsx)("span",{className:`text-sm text-text-main truncate ${a.mono?"font-mono":""}`,children:a.value})]},a.key)),j&&(0,d.jsxs)("div",{className:"flex items-start gap-3 min-w-0 sm:col-span-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0 mt-0.5",children:"Notice"}),(0,d.jsx)("span",{className:"text-sm text-text-main leading-relaxed",children:j})]})]})]})}},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroOAuthWrapper.js","default")},17660:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,elev:k=!1,className:l,...m}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-surface border border-border-subtle",k?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[var(--shadow-soft)]",j&&"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"}[i],l),...m,children:[(b||h)&&(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:g})}),(0,d.jsxs)("div",{children:[b&&(0,d.jsx)("h3",{className:"text-text-main font-semibold",children:b}),c&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.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",c),...f,children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:b})]})}},18200:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\AddCustomEmbeddingModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\AddCustomEmbeddingModal.js","default")},18421:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Tooltip.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Tooltip.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\RequestLogger.js","default")},20084:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(95145);function g({isOpen:a,onClose:b,onAdd:c,addedNames:h=[]}){let[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)("all"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),A=(0,e.useMemo)(()=>new Set(h),[h]),B=(0,e.useMemo)(()=>{let a=m.trim().toLowerCase();return i.filter(b=>("authless"!==o||!b.oauth)&&("oauth"!==o||!!b.oauth)&&(!a||(b.title||"").toLowerCase().includes(a)||(b.description||"").toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)))},[i,m,o]),C=async a=>{if(!u[a.url]){x(b=>({...b,[a.url]:!0}));try{let b=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a.url})}),c=await b.json(),d=c.tools||[],e=Array.isArray(a.toolNames)?a.toolNames:[],f=d.length>0?d.map(a=>a.name):e;v(b=>({...b,[a.url]:{tools:d,requiresAuth:!!c.requiresAuth,error:c.error}})),z(b=>({...b,[a.url]:Object.fromEntries(f.map(a=>[a,!0]))}))}catch(b){v(c=>({...c,[a.url]:{tools:[],error:b.message}}))}finally{x(b=>({...b,[a.url]:!1}))}}},D=(a,b)=>{let c=y[a]||{};z(d=>({...d,[a]:Object.fromEntries(Object.keys(c).map(a=>[a,b]))}))};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:"Browse MCP Marketplace",size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsxs)("select",{value:o,onChange:a=>p(a.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,d.jsx)("option",{value:"all",children:"All"}),(0,d.jsx)("option",{value:"authless",children:"Authless"}),(0,d.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),q&&(0,d.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:q}),k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading registry..."})]}),!k&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===B.length&&(0,d.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),B.map(a=>{let b=A.has(a.slug||a.name),e=s===a.url,f=u[a.url],g=w[a.url],h=y[a.url]||{},i=Object.keys(h),j=Object.values(h).filter(Boolean).length;return(0,d.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[a.iconUrl?(0,d.jsx)("img",{src:a.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-xs",children:a.title}),a.oauth?(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),a.toolCount>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.toolCount," tools"]})]}),a.description&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:a.description})]}),(0,d.jsx)("button",{onClick:()=>b?null:void(s===a.url?t(null):(t(a.url),C(a))),disabled:b,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${b?"bg-green-500/10 text-green-600 cursor-default":e?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:b?"Added":e?"Cancel":"+ Add"})]}),e&&(0,d.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Probing server for tools..."})]}),!g&&f?.requiresAuth&&(0,d.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!g&&f?.error&&!f?.requiresAuth&&(0,d.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",f.error]}),!g&&0===i.length&&!f?.requiresAuth&&!f?.error&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!g&&i.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[j,"/",i.length," tools enabled"]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>D(a.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,d.jsx)("button",{onClick:()=>D(a.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:i.map(b=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,d.jsx)("input",{type:"checkbox",checked:!!h[b],onChange:()=>{var c;return c=a.url,void z(a=>({...a,[c]:{...a[c],[b]:!a[c]?.[b]}}))},className:"size-3"}),(0,d.jsx)("span",{className:"truncate",children:b})]},b))})]}),(0,d.jsx)("button",{onClick:()=>{let b,d;return d=Object.keys(b=y[a.url]||{}).filter(a=>b[a]),void(c?.({name:a.slug||a.name,title:a.title,description:a.description,url:a.url,transport:a.transport,oauth:a.oauth,toolNames:d}),t(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},a.url)})]}),(0,d.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[B.length," of ",i.length," servers"]})]})})}},20493:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ComboFormModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ComboFormModal.js","default")},23048:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(97564);function g(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{onClick:()=>b(!0),className:"relative flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg transition-all text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5",title:"9Remote",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"computer"}),(0,d.jsx)("span",{className:"text-xs font-medium",children:"Remote"})]}),(0,d.jsx)(f.A,{isOpen:a,onClose:()=>b(!1)})]})}},25919:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({src:a,alt:b="Avatar",name:c,size:g="md",className:h}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return a?(0,d.jsx)("div",{className:(0,e.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],h),style:{backgroundImage:`url(${a})`},role:"img","aria-label":b}):(0,d.jsx)("div",{className:(0,e.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],(a=>{if(!a)return"bg-primary";let b=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],c=a.charCodeAt(0)%b.length;return b[c]})(c),h),role:"img","aria-label":b,children:(a=>{if(!a)return"?";let b=a.split(" ");return b.length>=2?`${b[0][0]}${b[1][0]}`.toUpperCase():a.substring(0,2).toUpperCase()})(c)})}},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Sidebar.js","default")},29354:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\HeaderMenu.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\HeaderMenu.js","default")},29674:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\NineRemoteButton.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\NineRemoteButton.js","default")},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(70061),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(49123),c(3080),c(94582),c(70603),c(20493),c(962),c(2422),c(45205),c(29674),c(29354),c(33811),c(19083),c(82448),c(14285),c(87228),c(40167),c(80342),c(64148),c(70139),c(18200),c(5843),c(54065),c(18421),c(81923);var e=c(61780);function f({children:a}){return(0,d.jsx)(e.default,{children:a})}c(64420)},32971:(a,b,c)=>{"use strict";c.d(b,{default:()=>e});var d=c(48249);function e({text:a,children:b,position:c="top",color:f}){let g=f?"":"bg-gray-900";return(0,d.jsxs)("div",{className:"relative inline-flex group",children:[b,(0,d.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"}[c]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${g} text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,style:f?{backgroundColor:f}:{},children:a})]})}},33811:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ChangelogModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ChangelogModal.js","default")},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Badge.js","default")},37365:(a,b,c)=>{"use strict";c.d(b,{C:()=>d});let d=(0,c(31417).v)(a=>({query:"",placeholder:"",visible:!1,setQuery:b=>a({query:b}),register:(b="Search...")=>a({visible:!0,placeholder:b,query:""}),unregister:()=>a({visible:!1,placeholder:"",query:""})}))},39645:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(95145),g=c(99070),h=c(50377);function i({isOpen:a,onClose:b,title:c="Manual Configuration",configs:j=[]}){let{copy:k}=(0,h.C)(),[l,m]=(0,e.useState)(null);return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:c,size:"xl",children:(0,d.jsx)("div",{className:"flex flex-col gap-4",children:j.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:a.filename}),(0,d.jsxs)(g.default,{variant:"ghost",size:"sm",onClick:()=>{var c;return c=a.content,void(k(c,`manualconfig-${b}`),m(b),setTimeout(()=>m(null),2e3))},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:l===b?"check":"content_copy"}),l===b?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:a.content})]},b))})})}},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ThemeToggle.js","default")},41371:(a,b,c)=>{"use strict";c.d(b,{i:()=>f});var d=c(31417);let e=0,f=(0,d.v)((a,b)=>({notifications:[],addNotification:c=>{let d=++e,f={id:d,type:c.type||"info",message:c.message,title:c.title||null,duration:c.duration??5e3,dismissible:c.dismissible??!0,createdAt:Date.now()};return a(a=>({notifications:[...a.notifications,f]})),f.duration>0&&setTimeout(()=>b().removeNotification(d),f.duration),d},removeNotification:b=>{a(a=>({notifications:a.notifications.filter(a=>a.id!==b)}))},clearAll:()=>a({notifications:[]}),success:(a,c)=>b().addNotification({type:"success",message:a,title:c}),error:(a,c)=>b().addNotification({type:"error",message:a,title:c,duration:8e3}),warning:(a,c)=>b().addNotification({type:"warning",message:a,title:c}),info:(a,c)=>b().addNotification({type:"info",message:a,title:c})}))},42118:(a,b,c)=>{"use strict";c.d(b,{D:()=>i});var d=c(67484),e=c(13033);function f(a){return()=>{}}function g(){return!1}function h(){return!1}function i(){let{theme:a,setTheme:b,toggleTheme:c,initTheme:i}=(0,e.A)(),j=(0,d.useSyncExternalStore)(f,g,h);return{theme:a,setTheme:b,toggleTheme:c,isDark:"dark"===a||"system"===a&&j}}},42196:(a,b,c)=>{"use strict";c.d(b,{default:()=>p});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(19099),k=c(71404),l=c(12020);let m=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/media-providers/web",label:"Media / Web",icon:"perm_media"},{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"},{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"},{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],n=[{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"}];function o({href:a,label:b,icon:c,active:e,onClick:f}){return(0,d.jsxs)(i(),{href:a,onClick:f,className:(0,k.cn)("group flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",e?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c}),(0,d.jsx)("span",{className:"truncate",children:b})]})}function p({onClose:a}){let b=(0,j.usePathname)(),c=(0,j.useRouter)(),[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(""),[k,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),t=()=>a?.(),u=async()=>{if(!r&&confirm("Restart BlueRouter now? The dashboard will be unavailable for a few seconds.")){s(!0);try{let a=await fetch("/api/version/restart",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok||b?.success===!1)throw Error(b?.message||"Restart request failed");setTimeout(()=>{window.location.reload()},2500)}catch(a){alert(a?.message||"Restart request failed"),s(!1)}}},v=async()=>{try{await fetch("/api/auth/logout",{method:"POST"})}catch{}c.push("/login"),c.refresh()};return(0,d.jsxs)("div",{className:"flex h-full flex-col p-4",children:[(0,d.jsxs)("div",{className:"mb-5 rounded-2xl bg-primary/10 p-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary",children:"hub"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"truncate text-lg font-bold text-text-main",children:"Blue Router"}),(0,d.jsxs)("div",{className:"text-xs text-text-muted",children:["v",l.vQ?.version||"local"]})]})]}),f?(0,d.jsxs)("div",{className:"mt-3 rounded-xl bg-background/70 px-3 py-2 text-xs text-text-muted",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 font-medium text-text-main",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"person"}),(0,d.jsx)("span",{className:"truncate",children:f})]}),(0,d.jsxs)("div",{className:"mt-1",children:[k?"Admin":"User",h?` \xb7 ${h}`:""]})]}):null]}),(0,d.jsx)("nav",{className:"flex-1 space-y-1 overflow-y-auto pr-1",children:(k?m:n).map(a=>{var c;return(0,d.jsx)(o,{...a,active:"/dashboard/endpoint"===(c=a.href)?"/dashboard"===b||b.startsWith("/dashboard/endpoint"):b===c||b.startsWith(`${c}/`),onClick:t},a.href)})}),(0,d.jsxs)("div",{className:"mt-4 space-y-2 border-t border-border pt-4",children:[k?(0,d.jsxs)("button",{onClick:u,disabled:r,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm font-medium text-amber-700 transition hover:bg-amber-500/20 disabled:cursor-not-allowed disabled:opacity-60 dark:text-amber-300",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"restart_alt"}),r?"Restarting...":"Restart"]}):null,(0,d.jsxs)("button",{onClick:v,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-muted transition hover:bg-surface-2 hover:text-text-main",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"logout"}),"Logout"]})]})]})}o.propTypes={href:g().string.isRequired,label:g().string.isRequired,icon:g().string.isRequired,active:g().bool,onClick:g().func},p.propTypes={onClose:g().func}},43182:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);let i="https://gitlab.com";function j({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(i),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),B=()=>{k(null),m(i),o(""),q(""),s(""),w(null),u(!1),y(!1),A(null),f()},C=async()=>{if(!r.trim())return void w("Personal Access Token is required");u(!0),w(null);try{let a=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r.trim(),baseUrl:l.trim()||i})}),b=await a.json();if(!a.ok)throw Error(b.error||"Authentication failed");c?.(),B()}catch(a){w(a.message)}finally{u(!1)}};return a?x&&z?(0,d.jsx)(h.LF,{isOpen:!0,provider:"gitlab",providerInfo:b,oauthMeta:z,onSuccess:()=>{c?.(),B()},onClose:()=>{y(!1),A(null)}}):(0,d.jsx)(h.aF,{isOpen:a,title:"Connect GitLab Duo",onClose:B,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("button",{onClick:()=>k("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,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,d.jsxs)("button",{onClick:()=>k("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,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"http://localhost/callback"})]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Client ID",value:n,onChange:a=>o(a.target.value),placeholder:"Your OAuth application client ID"}),(0,d.jsx)(h.pd,{label:"Client Secret (optional for PKCE)",value:p,onChange:a=>q(a.target.value),placeholder:"Leave empty for public PKCE app"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{n.trim()?(w(null),A({baseUrl:l.trim()||i,clientId:n.trim(),clientSecret:p.trim()}),y(!0)):w("Client ID is required")},fullWidth:!0,disabled:!n.trim(),children:"Authorize"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Personal Access Token",value:r,onChange:a=>s(a.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:C,fullWidth:!0,disabled:!r.trim()||t,loading:t,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Button.js","default")},48781:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.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,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.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,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},49123:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Footer.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Footer.js","default")},50377:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(b);else{let a=document.createElement("textarea");a.value=b,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}})(),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{"use strict";c.d(b,{x0:()=>x.default,Ex:()=>j.default,$n:()=>d.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,CK:()=>o.default,uo:()=>h.ConfirmModal,G9:()=>t.default,wI:()=>w.default,vj:()=>v.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,uR:()=>n.default,Nf:()=>p.default,aF:()=>h.default,rq:()=>m.default,gw:()=>y.default,LF:()=>l.default,Wx:()=>B.default,gM:()=>r.default,Iz:()=>z.default,l6:()=>f.default,lM:()=>k.default,m_:()=>A.default,jK:()=>q.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514);c(53845),c(19308),c(42196),c(86739),c(48781);var l=c(79346),m=c(83352),n=c(39645),o=c(62727),p=c(20084),q=c(87226);c(267),c(23048),c(3236),c(11229);var r=c(91809);c(86209);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(43182),w=c(51585),x=c(67738),y=c(50585),z=c(91099),A=c(32971),B=c(11633);c(54004),c(53838)},50585:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(17660),i=c(4770),j=c(75171);let k="__none__";function l({providerId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(k),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(!1),q=async b=>{g(b),n(!0);try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={...d[a]||{}};b===k?delete e.proxyPoolId:e.proxyPoolId=b;let f={...d};0===Object.keys(e).length?delete f[a]:f[a]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})}),p(!0),setTimeout(()=>p(!1),1500)}catch(a){console.log("Save proxyPoolId error:",a)}finally{n(!1)}};return(0,d.jsxs)(h.default,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),o&&(0,d.jsx)(j.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,d.jsx)(i.default,{label:"Proxy Pool",value:f,onChange:a=>q(a.target.value),disabled:m,options:[{value:k,label:"None (direct)"},...b.map(a=>({value:a.id,label:a.name}))]})]})}l.propTypes={providerId:g().string.isRequired}},51109:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,d.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},51585:(a,b,c)=>{"use strict";c.d(b,{default:()=>v});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(83552),j=c(99070),k=c(75171),l=c(96919),m=c(12020),n=c(73050);let o=[0,1,2,3,4,5,6],p=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}];function q(a,b){let c=String(a||"").trim();return/^([01]\d|2[0-3]):([0-5]\d)$/.test(c)?c:b}function r(a={}){let b=a&&"object"==typeof a?a:{},c=Array.isArray(b.weekdays)?b.weekdays.map(Number).filter(a=>a>=0&&a<=6):o;return{enabled:!1!==b.enabled,weekdays:[...new Set(c)].sort((a,b)=>a-b),fromTime:q(b.fromTime||b.from,"00:00"),toTime:q(b.toTime||b.to,"23:59")}}function s(a={}){var b;let c=a&&"object"==typeof a?a:{};return{enabled:!0===c.enabled,intervalSec:Math.max(10,Number.parseInt(c.intervalSec||60,10)||60),failureThreshold:Math.max(1,Number.parseInt(c.failureThreshold||3,10)||3),timeoutMs:Math.max(1e3,Number.parseInt(c.timeoutMs||15e3,10)||15e3),prompt:"string"==typeof c.prompt&&c.prompt.trim()?c.prompt.trim():"Say hi",disableThinking:!1!==c.disableThinking,model:"string"==typeof(b=c.model||c.healthModel||c.testModel)?b.trim():""}}function t(){return"text-xs font-medium text-text-muted"}function u(){return"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50"}function v({isOpen:a,connection:b,proxyPools:c,onSave:f,onClose:g}){let[q,w]=(0,e.useState)({name:"",priority:1,apiKey:""}),[x,y]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[z,A]=(0,e.useState)({accountId:""}),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(r()),[N,O]=(0,e.useState)(s()),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)([]),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),Z=b?.authType==="oauth",$=b?.provider==="azure",_=b?.provider==="cloudflare-ai",aa=b?function(a=""){if((0,l.gb)(a))return"anthropic";if((0,l.mq)(a)||"cloudflare-ai"===a)return"openai";if("gemini"===a)return"gemini";if("github"===a)return"openai";let b=m.X3?.[a]||"";return b.includes("/messages")?"anthropic":b.includes("/chat/completions")||b.includes("/responses")?"openai":null}(b.provider):null,ab=!!aa,ac=(0,n.wB)(T,N.model),ad=async()=>{if(b?.provider){C(!0),E(null);try{let a=await fetch(`/api/providers/${b.id}/test`,{method:"POST"}),c=await a.json();E(c.valid?"success":"failed")}catch{E("failed")}finally{C(!1)}}},ae=async()=>{if(b?.provider&&q.apiKey){G(!0),I(null);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:q.apiKey,...$?{providerSpecificData:x}:{},..._?{providerSpecificData:z}:{}})}),c=await a.json();I(c.valid?"success":"failed")}catch{I("failed")}finally{G(!1)}}},af=async()=>{if(b){K(!0);try{let a={name:q.name,priority:q.priority,schedule:r(L),healthCheck:s(N)};if(!Z&&q.apiKey){a.apiKey=q.apiKey;let c="success"===H;if(!c)try{G(!0),I(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:q.apiKey,...$?{providerSpecificData:x}:{},..._?{providerSpecificData:z}:{}})});c=!!(await a.json()).valid,I(c?"success":"failed")}catch{I("failed")}finally{G(!1)}c&&(a.testStatus="active",a.lastError=null,a.lastErrorAt=null)}$&&(a.providerSpecificData={azureEndpoint:x.azureEndpoint,apiVersion:x.apiVersion,deployment:x.deployment,organization:x.organization}),_&&(a.providerSpecificData={accountId:z.accountId}),await f(a)}finally{K(!1)}}};return b?(0,d.jsx)(h.default,{isOpen:a,onClose:g,title:"Edit Connection",size:"full",children:(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsx)(i.default,{label:"Name",value:q.name,onChange:a=>w({...q,name:a.target.value}),placeholder:Z?"Account name":"Production Key"}),(0,d.jsx)(i.default,{label:"Priority",type:"number",value:q.priority,onChange:a=>w({...q,priority:Number.parseInt(a.target.value,10)||1})})]}),Z&&b.email&&(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-sidebar/40 px-3 py-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Email:"})," ",b.email]}),!Z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.default,{label:"API Key",type:"password",value:q.apiKey,onChange:a=>w({...q,apiKey:a.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.default,{onClick:ae,disabled:!q.apiKey||F||J,variant:"secondary",children:F?"Checking...":"Check"})}),H&&(0,d.jsx)("div",{className:"pt-7",children:(0,d.jsx)(k.default,{variant:"success"===H?"success":"error",children:"success"===H?"Valid":"Invalid"})})]}),$&&(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-sidebar/40 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsx)(i.default,{label:"Azure Endpoint",value:x.azureEndpoint,onChange:a=>y({...x,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(i.default,{label:"Deployment Name",value:x.deployment,onChange:a=>y({...x,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(i.default,{label:"API Version",value:x.apiVersion,onChange:a=>y({...x,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(i.default,{label:"Organization",value:x.organization,onChange:a=>y({...x,organization:a.target.value}),placeholder:"Organization ID"})]})]}),_&&(0,d.jsx)(i.default,{label:"Cloudflare Account ID",value:z.accountId,onChange:a=>A({...z,accountId:a.target.value})}),(0,d.jsxs)("section",{className:"rounded-xl border border-border bg-sidebar/30 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Scheduler"}),P&&(0,d.jsx)("p",{className:"mb-3 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-500",children:"Provider-level scheduler override is enabled. This account scheduler is locked and ignored while override is on."}),(0,d.jsxs)("label",{className:"mb-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:L.enabled,disabled:P,onChange:a=>M(b=>({...b,enabled:a.target.checked}))}),"Enable account scheduler"]}),(0,d.jsx)("div",{className:"mb-3 flex flex-wrap gap-2",children:p.map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 rounded-lg border border-border px-2.5 py-1.5 text-xs text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:L.weekdays.includes(a.value),disabled:P,onChange:()=>M(b=>{let c=new Set(Array.isArray(b.weekdays)?b.weekdays:o);return c.has(a.value)?c.delete(a.value):c.add(a.value),{...b,weekdays:[...c].sort((a,b)=>a-b)}})}),a.label]},a.value))}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("label",{className:t(),children:["From time",(0,d.jsx)("input",{type:"time",value:L.fromTime,disabled:P,onChange:a=>M(b=>({...b,fromTime:a.target.value})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["To time",(0,d.jsx)("input",{type:"time",value:L.toTime,disabled:P,onChange:a=>M(b=>({...b,toTime:a.target.value})),className:u()})]})]})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-border bg-sidebar/30 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Ping Health Check"}),R&&(0,d.jsx)("p",{className:"mb-3 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-500",children:"Provider-level healthcheck override is enabled. This account healthcheck policy is locked and ignored while override is on."}),(0,d.jsxs)("label",{className:"mb-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:N.enabled,disabled:R,onChange:a=>O(b=>({...b,enabled:a.target.checked}))}),"Enable periodic health check"]}),N.enabled&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("label",{className:t(),children:["Healthcheck model",(0,d.jsxs)("select",{value:N.model||"",onChange:a=>O(b=>({...b,model:a.target.value})),className:u(),disabled:R||V,children:[(0,d.jsx)("option",{value:"",children:"Connection/base URL only — no chat ping"}),ac.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name||a.id},a.id))]})]}),(0,d.jsxs)("label",{className:`${t()} mt-3 block`,children:["Manual healthcheck model",(0,d.jsx)("input",{value:N.model||"",onChange:a=>O(b=>({...b,model:a.target.value})),placeholder:"anthropic"===aa?"claude/model name from this endpoint":"gemini"===aa?"gemini model, e.g. gemini-2.5-flash":"model name from Available Models",className:u(),disabled:R||V})]}),V&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Loading local Available Models..."}),X&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-yellow-500",children:["Model list note: ",X]}),!V&&!X&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Model list is loaded from local Available Models / DB, not from the provider /models API."}),"anthropic"===aa&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Anthropic-compatible healthcheck sends ",(0,d.jsx)("code",{children:"Say hi"})," to ",(0,d.jsx)("code",{children:"/v1/messages"})," only when a model is selected."]}),"gemini"===aa&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Gemini healthcheck sends ",(0,d.jsx)("code",{children:"Say hi"})," with the native ",(0,d.jsx)("code",{children:"generateContent"})," API only when a model is selected."]}),"cloudflare-ai"===b.provider&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Cloudflare healthcheck sends ",(0,d.jsx)("code",{children:"Say hi"})," to the Workers AI OpenAI-style chat endpoint only when a model is selected."]}),!ab&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"This provider can still show local Available Models. Auto healthcheck will keep using the original connection/token/account probe until a direct chat endpoint is available."})]}),N.enabled&&(!ab||!N.model)&&(0,d.jsx)("p",{className:"mt-4 rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"No direct chat healthcheck model/endpoint is active. Auto healthcheck will test connection/base URL/key/token/account and will not send the Say hi chat ping."}),(0,d.jsxs)("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("label",{className:t(),children:["Interval seconds",(0,d.jsx)("input",{type:"number",min:"10",value:N.intervalSec,disabled:R,onChange:a=>O(b=>({...b,intervalSec:Math.max(10,Number.parseInt(a.target.value,10)||60)})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["Fail threshold",(0,d.jsx)("input",{type:"number",min:"1",value:N.failureThreshold,disabled:R,onChange:a=>O(b=>({...b,failureThreshold:Math.max(1,Number.parseInt(a.target.value,10)||3)})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["Timeout ms",(0,d.jsx)("input",{type:"number",min:"1000",value:N.timeoutMs,disabled:R,onChange:a=>O(b=>({...b,timeoutMs:Math.max(1e3,Number.parseInt(a.target.value,10)||15e3)})),className:u()})]})]}),(0,d.jsxs)("label",{className:`${t()} mt-3 block`,children:["Prompt",(0,d.jsx)("input",{value:N.prompt,disabled:R,onChange:a=>O(b=>({...b,prompt:a.target.value})),className:u()})]}),(0,d.jsxs)("label",{className:"mt-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:N.disableThinking,disabled:R,onChange:a=>O(b=>({...b,disableThinking:a.target.checked}))}),"Prefer lightweight test / disable thinking where supported"]}),(0,d.jsxs)("div",{className:"mt-3 text-xs text-text-muted",children:["Status: ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:b.healthStatus||"unknown"}),b.healthLastCheckedAt&&(0,d.jsxs)("span",{children:[" \xb7 last checked: ",function(a){if(!a)return"";try{return new Date(a).toLocaleString()}catch{return String(a)}}(b.healthLastCheckedAt)]}),b.healthLastError&&(0,d.jsx)("p",{className:"mt-1 break-words text-red-500",children:b.healthLastError})]})]}),!$&&!_&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.default,{onClick:ad,disabled:B,variant:"secondary",children:B?"Testing...":"Test Connection"}),D&&(0,d.jsx)(k.default,{variant:"success"===D?"success":"error",children:"success"===D?"Valid":"Failed"})]}),(0,d.jsxs)("div",{className:"flex gap-2 border-t border-border pt-4",children:[(0,d.jsx)(j.default,{onClick:af,disabled:J||$&&(!x.azureEndpoint||!x.deployment||!x.organization)||_&&!z.accountId,fullWidth:!0,children:J?"Saving...":"Save"}),(0,d.jsx)(j.default,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}v.propTypes={isOpen:g().bool.isRequired,connection:g().shape({id:g().string,name:g().string,email:g().string,priority:g().number,authType:g().string,provider:g().string,defaultModel:g().string,providerSpecificData:g().object,schedule:g().object,healthCheck:g().object,healthStatus:g().string,healthLastCheckedAt:g().string,healthLastError:g().string,providerScheduleOverride:g().bool,providerHealthOverride:g().bool}),proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),onSave:g().func.isRequired,onClose:g().func.isRequired}},53838:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.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,d.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,d.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,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{isDark:c,toggleTheme:h}=(0,e.D)(),i={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(i[b],a),"aria-label":`Switch to ${c?"light":"dark"} mode`,title:`Switch to ${c?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:c?"light_mode":"dark_mode"})})}},54004:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(41371),g=c(42196),h=c(86739),i=c(19099);let j=["/dashboard/api-keys"];function k({children:a}){let b=(0,i.usePathname)();(0,i.useRouter)();let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(!0);return c?g||j.some(a=>b===a||b.startsWith(`${a}/`))?a:(0,d.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center text-sm text-text-muted",children:"Redirecting..."}):(0,d.jsxs)("div",{className:"flex min-h-[50vh] items-center justify-center text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mr-2 animate-spin",children:"progress_activity"}),"Loading dashboard..."]})}function l({children:a}){let[b,c]=(0,e.useState)(!1),i=(0,f.i)(a=>a.notifications),j=(0,f.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"min-h-screen bg-background text-text-main",children:[(0,d.jsx)("div",{className:"pointer-events-none fixed inset-0 bg-[linear-gradient(to_right,rgba(99,102,241,0.07)_1px,transparent_1px),linear-gradient(to_bottom,rgba(99,102,241,0.07)_1px,transparent_1px)] bg-size-[32px_32px]"}),(0,d.jsx)("div",{className:"fixed right-4 top-4 z-50 flex w-[min(420px,calc(100vw-2rem))] flex-col gap-2",children:i.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 shadow-lg backdrop-blur ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-lg",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 text-sm",children:[a.title?(0,d.jsx)("div",{className:"font-semibold",children:a.title}):null,(0,d.jsx)("div",{children:a.message})]}),a.dismissible?(0,d.jsx)("button",{onClick:()=>j(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/40 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("aside",{className:"fixed inset-y-0 left-0 z-40 hidden w-72 border-r border-border bg-surface/90 backdrop-blur lg:block",children:(0,d.jsx)(g.default,{})}),(0,d.jsx)("aside",{className:`fixed inset-y-0 left-0 z-50 w-72 border-r border-border bg-surface/95 backdrop-blur transition-transform lg:hidden ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(g.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{className:"relative z-10 min-h-screen lg:pl-72",children:[(0,d.jsx)(h.default,{onMenuClick:()=>c(!0)}),(0,d.jsx)("div",{className:"w-full max-w-none min-w-0 px-4 py-6 sm:px-6 lg:px-8",children:(0,d.jsx)(k,{children:a})})]})]})}},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\SegmentedControl.js","default")},56110:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)(),v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\layouts\\\\DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\layouts\\DashboardLayout.js","default")},62727:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(95145),g=c(83552),h=c(99070),i=c(83352);let j=/^[a-zA-Z0-9_.\-]+$/;function k({index:a,model:b,isFirst:c,isLast:f,onEdit:g,onMoveUp:h,onMoveDown:i,onRemove:j}){let[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(b),p=()=>{let a=n.trim();a&&a!==b?g(a):o(b),m(!1)};return(0,d.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,d.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:a+1}),l?(0,d.jsx)("input",{autoFocus:!0,value:n,onChange:a=>o(a.target.value),onBlur:p,onKeyDown:a=>{"Enter"===a.key&&p(),"Escape"===a.key&&(o(b),m(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,d.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>m(!0),title:"Click to edit",children:b}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,d.jsx)("button",{onClick:h,disabled:c,className:`p-0.5 rounded ${c?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,d.jsx)("button",{onClick:i,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,d.jsx)("button",{onClick:j,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function l({isOpen:a,combo:b,comboStrategy:c={},onClose:m,onSave:n,activeProviders:o,kindFilter:p=null,forcePrefix:q="",title:r}){let s=b?.name?q&&b.name.startsWith(q)?b.name.slice(q.length):b.name:"",[t,u]=(0,e.useState)(s),[v,w]=(0,e.useState)(b?.models||[]),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)({}),F=a=>{if(!a.trim())return C("Name is required"),!1;let b=q+a;return j.test(b)?(C(""),!0):(C("Only letters, numbers, -, _ and . allowed"),!1)},G=a=>{let b=a.target.value;q&&b.startsWith(q)&&(b=b.slice(q.length)),u(b),b?F(b):C("")},H=async()=>{F(t)&&(A(!0),await n({name:q+t.trim(),models:v}),A(!1))},I=!!b,J=c?.fallbackStrategy||"fallback";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{isOpen:a,onClose:m,title:r||(I?"Edit Combo":"Create Combo"),children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,d.jsxs)("div",{className:"flex items-stretch",children:[(0,d.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:q}),(0,d.jsx)("input",{value:t,onChange:G,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),B&&(0,d.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:B})]}):(0,d.jsx)(g.default,{label:"Combo Name",value:t,onChange:G,placeholder:"my-combo",error:B}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[q?`Auto-prefixed with "${q}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-primary/15 bg-primary/5 px-3 py-2 text-xs text-text-muted",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 font-medium text-primary",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"route"}),"Routing: ","least-latency"===J?"Least latency":"p2c"===J?"P2C":"round-robin"===J?"Round Robin":"Fallback priority"]}),(0,d.jsx)("p",{className:"mt-1",children:"Strategy, LAN health, and tag rules are saved in settings.comboStrategies and can be edited from the Combo card."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===v.length?(0,d.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,d.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:v.map((a,b)=>(0,d.jsx)(k,{index:b,model:a,isFirst:0===b,isLast:b===v.length-1,onEdit:a=>{let c=[...v];c[b]=a,w(c)},onMoveUp:()=>(a=>{if(0===a)return;let b=[...v];[b[a-1],b[a]]=[b[a],b[a-1]],w(b)})(b),onMoveDown:()=>(a=>{if(a===v.length-1)return;let b=[...v];[b[a],b[a+1]]=[b[a+1],b[a]],w(b)})(b),onRemove:()=>w(v.filter((a,c)=>c!==b))},b))}),(0,d.jsxs)("button",{onClick:()=>y(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,d.jsx)(h.default,{onClick:m,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(h.default,{onClick:H,fullWidth:!0,size:"sm",disabled:!t.trim()||!!B||z,children:z?"Saving...":I?"Save":"Create"})]})]})}),(0,d.jsx)(i.default,{isOpen:x,onClose:()=>y(!1),onSelect:a=>{v.includes(a.value)||w([...v,a.value])},onDeselect:a=>{w(v.filter(b=>b!==a.value))},activeProviders:o,modelAliases:D,title:"Add Model to Combo",kindFilter:p,addedModelValues:v,closeOnSelect:!1})]})}},64148:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\GitLabAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\GitLabAuthModal.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\layouts\\\\AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\layouts\\AuthLayout.js","default")},67738:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onClose:b,onCreated:c,onSaved:f,node:g}){let j=!!g,[k,l]=(0,e.useState)({name:"",prefix:"",baseUrl:"https://api.openai.com/v1"}),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),w=async()=>{if(k.name.trim()&&k.prefix.trim()&&k.baseUrl.trim()){n(!0);try{let a=j?`/api/provider-nodes/${g.id}`:"/api/provider-nodes",b={name:k.name,prefix:k.prefix,baseUrl:k.baseUrl};j||(b.type="custom-embedding");let d=await fetch(a,{method:j?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),e=await d.json();d.ok&&(j?f?.(e.node):c?.(e.node))}catch(a){console.log("Error saving custom embedding node:",a)}finally{n(!1)}}},x=async()=>{t(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:k.baseUrl,apiKey:o,type:"custom-embedding",modelId:q.trim()||void 0})}),b=await a.json();v(b)}catch{v({valid:!1,error:"Network error"})}finally{t(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:j?"Edit Custom Embedding":"Add Custom Embedding",onClose:b,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Name",value:k.name,onChange:a=>l({...k,name:a.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,d.jsx)(h.pd,{label:"Prefix",value:k.prefix,onChange:a=>l({...k,prefix:a.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,d.jsx)(h.pd,{label:"Base URL",value:k.baseUrl,onChange:a=>l({...k,baseUrl:a.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,d.jsx)(h.pd,{label:"API Key (for Check)",type:"password",value:o,onChange:a=>p(a.target.value)}),(0,d.jsx)(h.pd,{label:"Model ID (for Check)",value:q,onChange:a=>r(a.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,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)(h.$n,{onClick:x,disabled:!o||!q.trim()||s||!k.baseUrl.trim(),variant:"secondary",children:s?"Checking...":"Check"}),(()=>{if(!u)return null;let{valid:a,error:b,dimensions:c}=u;return a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.Ex,{variant:"success",children:"Valid"}),c&&(0,d.jsxs)("span",{className:"text-sm text-text-muted",children:[c," dims"]})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(h.Ex,{variant:"error",children:"Invalid"}),b&&(0,d.jsx)("span",{className:"text-sm text-red-500",children:b})]})})()]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:!k.name.trim()||!k.prefix.trim()||!k.baseUrl.trim()||m,children:m?j?"Saving...":"Creating...":j?"Save":"Create"}),(0,d.jsx)(h.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onCreated:g().func,onSaved:g().func,node:g().shape({id:g().string,name:g().string,prefix:g().string,baseUrl:g().string})}},70061:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Avatar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Avatar.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Toggle.js","default")},70139:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\EditConnectionModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\EditConnectionModal.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ManualConfigModal.js","default")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Input.js","default")},71404:(a,b,c)=>{"use strict";function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(b,{cn:()=>d})},72738:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f);function h({src:a,alt:b,size:c=32,className:f="",fallbackText:g="?",fallbackColor:i}){let[j,k]=(0,e.useState)(!1);return!a||j?(0,d.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${f}`.trim(),style:{width:c,height:c,color:i,fontSize:Math.max(10,Math.floor(.38*c))},children:g}):(0,d.jsx)("img",{src:a,alt:b,width:c,height:c,className:f,onError:()=>k(!0)})}h.propTypes={src:g().string,alt:g().string,size:g().number,className:g().string,fallbackText:g().string,fallbackColor:g().string}},73050:(a,b,c)=>{"use strict";c.d(b,{ns:()=>l,wB:()=>m});var d=c(96919),e=c(91431);let f=[{id:"@cf/meta/llama-3.1-8b-instruct",name:"Cloudflare: Llama 3.1 8B Instruct"},{id:"@cf/meta/llama-3.1-70b-instruct",name:"Cloudflare: Llama 3.1 70B Instruct"},{id:"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",name:"Cloudflare: DeepSeek R1 Distill Qwen 32B"},{id:"@cf/qwen/qwen1.5-14b-chat-awq",name:"Cloudflare: Qwen 1.5 14B Chat AWQ"}];function g(a){return"string"==typeof a?a.trim():""}function h(a){return a&&"object"==typeof a&&!Array.isArray(a)?a:{}}function i(a){return Array.isArray(a)?a.map(a=>String(a||"").trim()).filter(Boolean):[]}function j(a=""){let b=g(a);return b?(0,d.mq)(b)||(0,d.gb)(b)?b:(0,d.wG)(b)||b:""}function k(a){return[...a].sort((a,b)=>{let c=a.source||"",d=b.source||"";if(c!==d){let a={builtin:0,connection:1,alias:2,current:3};return(a[c]??9)-(a[d]??9)}return String(a.id||"").localeCompare(String(b.id||""))})}async function l({providerId:a="",connections:b=[],currentModel:c=""}={}){let m=g(a);if(!m)return{models:[],warning:"Provider is empty"};let n=j(m),o={},p=[],q="";try{let[a,b]=await Promise.all([fetch("/api/models/alias",{cache:"no-store"}),fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(n)}`,{cache:"no-store"})]);if(a.ok){let b=await a.json();o=h(b.aliases)}else q="Failed to load model aliases from local DB.";if(b.ok){let a=await b.json();p=i(a.ids)}}catch(a){q=a.message||"Failed to load local model list."}let r=function({providerId:a="",aliases:b={},disabledIds:c=[],connections:d=[],currentModel:l=""}={}){let m=g(a);if(!m)return[];let n=j(m),o=new Set(i(c)),p=h(b),q=function(a="",b=""){return[...new Set([b,a].map(g).filter(Boolean))].map(a=>`${a}/`)}(m,n),r=new Set,s=[],t=(a,b,c="builtin")=>{let d=g(a);!d||r.has(d)||o.has(d)&&"current"!==c||(r.add(d),s.push({id:d,name:g(b)||d,source:c}))};for(let a of(0,e.KC)(m)||[])a&&(!a.type||"llm"===a.type)&&t(a.id,a.name||a.displayName||a.id,"builtin");if("cloudflare-ai"===m&&0===s.length)for(let a of f)t(a.id,a.name,"builtin");for(let a of d||[])a&&a.provider===m&&t(a.defaultModel,a.defaultModel,"connection");for(let[a,b]of Object.entries(p)){let c=function(a,b){let c=g(a);if(!c)return"";for(let a of b)if(c.startsWith(a))return c.slice(a.length).trim();return""}(b,q);c&&t(c,a&&a!==c?`${c} (${a})`:c,"alias")}let u=g(l);return u&&t(u,`${u} (current)`,"current"),k(s)}({providerId:m,aliases:o,disabledIds:p,connections:b,currentModel:c});if(!q&&0===r.length){let a=d.Q2?.[m]?.name||m;q=`No local Available Models found for ${a}. Add models in Available Models first, then reopen this healthcheck dialog.`}return{models:r,warning:q}}function m(a=[],b=""){let c=g(b);return!c||(a||[]).some(a=>a.id===c)?a:k([...a||[],{id:c,name:`${c} (current)`,source:"current"}])}},74812:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>i,PageLoading:()=>g,Skeleton:()=>h,Spinner:()=>f,default:()=>j});var d=c(48249),e=c(71404);function f({size:a="md",className:b}){return(0,d.jsx)("span",{className:(0,e.cn)("material-symbols-outlined animate-spin text-brand-500",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[a],b),children:"progress_activity"})}function g({message:a="Loading..."}){return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,d.jsx)(f,{size:"xl"}),(0,d.jsx)("p",{className:"mt-4 text-text-muted",children:a})]})}function h({className:a,...b}){return(0,d.jsx)("div",{className:(0,e.cn)("animate-pulse rounded-[10px] bg-surface-2",a),...b})}function i(){return(0,d.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)(h,{className:"h-4 w-24"}),(0,d.jsx)(h,{className:"size-10 rounded-[10px]"})]}),(0,d.jsx)(h,{className:"h-8 w-16 mb-2"}),(0,d.jsx)(h,{className:"h-3 w-20"})]})}function j({type:a="spinner",...b}){switch(a){case"page":return(0,d.jsx)(g,{...b});case"skeleton":return(0,d.jsx)(h,{...b});case"card":return(0,d.jsx)(i,{...b});default:return(0,d.jsx)(f,{...b})}}},75171:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={default:"bg-surface-2 text-text-muted",primary:"bg-brand-500/10 text-brand-600 dark:text-brand-300",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},g={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function h({children:a,variant:b="default",size:c="md",dot:i=!1,icon:j,className:k}){return(0,d.jsxs)("span",{className:(0,e.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",f[b],g[c],k),children:[i&&(0,d.jsx)("span",{className:(0,e.cn)("size-1.5 rounded-full","success"===b&&"bg-green-500","warning"===b&&"bg-yellow-500","error"===b&&"bg-red-500","info"===b&&"bg-blue-500","primary"===b&&"bg-brand-500","default"===b&&"bg-gray-500")}),j&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:j}),a]})}},79346:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g,oauthMeta:k,idcConfig:l}){let[m,n]=(0,e.useState)("waiting"),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=(0,e.useRef)(!1),{copied:C,copy:D}=(0,i.C)(),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let I=(0,e.useCallback)(async(a,c)=>{if(o)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:o.redirectUri,codeVerifier:o.codeVerifier,state:c,...k?{meta:k}:{}})}),e=await d.json();if(!d.ok)throw Error(e.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,b,f]),J=(0,e.useCallback)(async a=>{if(o?.state)try{let b=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,state:o.state})}),c=await b.json();if(!b.ok)throw Error(c.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,f]),K=(0,e.useCallback)(async(a,c,d,e)=>{B.current=!1,z(!0);for(let g=0;g<60;g++){if(B.current){console.log("[OAuthModal] Polling aborted"),z(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),B.current){console.log("[OAuthModal] Polling aborted after sleep"),z(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){B.current=!0,n("success"),z(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){t(a.message),n("error"),z(!1);return}}t("Authorization timeout"),n("error"),z(!1)},[b,f]),L=(0,e.useCallback)(async()=>{if(b)try{let a;if(t(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy"].includes(b)){v(!0),n("waiting");let a=new URL(`/api/oauth/${b}/device-code`,window.location.origin);"kiro"===b&&l?.startUrl&&(a.searchParams.set("start_url",l.startUrl),l.region&&a.searchParams.set("region",l.region),a.searchParams.set("auth_method","idc"));let c=await fetch(a.toString()),d=await c.json();if(!c.ok)throw Error(d.error);x(d);let e=d.verification_uri_complete||d.verification_uri;e&&window.open(e,"_blank","noopener,noreferrer");let f="kiro"===b?{_clientId:d._clientId,_clientSecret:d._clientSecret,_region:d._region,_authMethod:d._authMethod,_startUrl:d._startUrl}:null;K(d.device_code,d.codeVerifier,d.interval||5,f);return}let c=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===b?"http://localhost:1455/auth/callback":"xai"===b?"http://127.0.0.1:56121/callback":`http://localhost:${c}/callback`;let d=new URL(`/api/oauth/${b}/authorize`,window.location.origin);d.searchParams.set("redirect_uri",a),k&&Object.entries(k).forEach(([a,b])=>{b&&d.searchParams.set(a,b)});let e=await fetch(d.toString()),f=await e.json();if(!e.ok)throw Error(f.error);let g=!1,h=!1;if("codex"===b)try{let b=new URL("/api/oauth/codex/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();g=e.success,h=!!e.serverSide}catch{g=!1}let i=!1,j=!1;if("xai"===b)try{let b=new URL("/api/oauth/xai/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();if(i=e.success,j=!!e.serverSide,!i&&"port_busy"===e.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(a){if(a?.message)throw a;i=!1}p({...f,redirectUri:a,codexServerSide:h,xaiServerSide:j}),"codex"===b&&g||"xai"===b&&i||E&&"codex"!==b&&"xai"!==b?(n("waiting"),A.current=window.open(f.authUrl,"oauth_popup","width=600,height=700"),A.current||n("input")):(n("input"),window.open(f.authUrl,"_blank"))}catch(a){t(a.message),n("error")}},[b,E,K,k,l]),M=async()=>{try{t(null);let a=q.trim();if(a.startsWith("eyJ")&&a.includes("."))return void await I(a,null);if("xai"===b&&a&&!a.includes("://")&&!a.includes("?")&&!a.includes("code="))return void await J(a);let c=new URL(a),d=c.searchParams.get("code"),e=c.searchParams.get("state"),f=c.searchParams.get("error");if(f)throw Error(c.searchParams.get("error_description")||f);if(!d)throw Error("xai"===b?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await I(d,e)}catch(a){t(a.message),n("error")}},N=(0,e.useCallback)(()=>{"codex"===b?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===b&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),g()},[g,b]);if(!b||!c)return null;let O="xai"===b,P=w?.verification_uri_complete||w?.verification_uri||"",Q=O?"Connect Grok Build OAuth":`Connect ${c.name}`;return(0,d.jsx)(h.aF,{isOpen:a,title:Q,onClose:N,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===m||"input"===m)&&!u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{className:"text-sm",children:O?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,d.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,d.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",O?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:o?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>D(o?.authUrl,"auth_url"),disabled:!o?.authUrl,children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===b?"callback URL or copied code":"callback URL"," here"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===b?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:q,onChange:a=>r(a.target.value),placeholder:O?"http://127.0.0.1:56121/callback?code=... or copied code":G,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:M,fullWidth:!0,disabled:!q,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===m&&u&&w&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"login_url"===C?"check":"content_copy",onClick:()=>D(P,"login_url"),disabled:!P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(P,"_blank","noopener,noreferrer"),disabled:!P,children:"Open"})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:w.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>D(w.user_code,"user_code")})]})]})]}),y&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:N,fullWidth:!0,children:"Done"})]}),"error"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:s}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired,oauthMeta:g().object,idcConfig:g().shape({startUrl:g().string,region:g().string})}},79488:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),p=async()=>{if(!f.trim())return void m("Please paste your cookie");k(!0),m(null);try{let a=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:f.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Authentication failed");o(!0),setTimeout(()=>{b?.(),q()},1500)}catch(a){m(a.message)}finally{k(!1)}},q=()=>{g(""),m(null),o(!1),c?.()};return(0,d.jsx)(h.aF,{isOpen:a,onClose:q,title:"iFlow Cookie Authentication",children:(0,d.jsx)("div",{className:"space-y-4",children:n?(0,d.jsxs)("div",{className:"text-center py-8",children:[(0,d.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,d.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,d.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,d.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,d.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,d.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,d.jsx)("li",{children:"Login to your account"}),(0,d.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,d.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,d.jsx)("li",{children:"Paste it below"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:j})]}),l&&(0,d.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,d.jsx)("p",{className:"text-sm text-error",children:l})}),(0,d.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:q,disabled:j,fullWidth:!0,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:p,loading:j,fullWidth:!0,children:"Authenticate"})]})]})})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func}},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\IFlowCookieModal.js","default")},81923:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ProviderInfoCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ProviderInfoCard.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroAuthModal.js","default")},83352:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(72738),i=c(91431),j=c(96919);let k=[...Object.keys(j.zN),...Object.keys(j.IS),...Object.keys(j.nJ),...Object.keys(j.fg)],l=Object.keys(j.IS).filter(a=>j.IS[a].noAuth);function m({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:n=[],title:o="Select Model",modelAliases:p={},kindFilter:q=null,addedModelValues:r=[],closeOnSelect:s=!0}){let t=(0,e.useMemo)(()=>q?n.filter(a=>{let b=j.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(q)}):n,[n,q]),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)([]),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)({}),E=(0,e.useMemo)(()=>({...j.zN,...j.IS,...j.nJ,...j.fg}),[]),F=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...t.map(a=>a.provider),...q?l.filter(a=>(j.Q2[a]?.serviceKinds||["llm"]).includes(q)):l])].sort((a,b)=>{let c=k.indexOf(a),d=k.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,j.wG)(e),g=E[e]||{name:e,color:"#666"},h=(0,j.mq)(e)||(0,j.gb)(e);if(q&&b.has(q)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(p).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b}));if(q&&c.has(q)&&0===(b=(0,i.KC)(e).filter(a=>a.type===q).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type}))).length&&d.has(q)&&(g.serviceKinds||["llm"]).includes(q)&&(b=[{id:e,name:g.name,value:f}]),b.length>0){let c=y.find(a=>a.id===e),d=c?.name||g.name;a[e]={name:d,alias:f,color:g.color,models:b}}}else if(h){if(q&&c.has(q))return;let b=n.find(a=>a.provider===e),d=y.find(a=>a.id===e),f=b?.name||d?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(p).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:j,isCustom:!0,hasModels:i.length>0}}else{var k;let b=(0,i.KC)(e),h=new Set(b.map(a=>a.id)),j=b.length>0,l=Object.entries(p).filter(([a,b])=>b.startsWith(`${f}/`)&&(!j||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=A.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type})),...l,...n],r=new Set,s=(k=o.filter(a=>!r.has(a.value)&&(r.add(a.value),!0)),q?c.has(q)?k.filter(a=>a.isPlaceholder||a.type===q):k:k.filter(a=>a.isPlaceholder||!a.type||"llm"===a.type));0===s.length&&q&&d.has(q)&&(g.serviceKinds||["llm"]).includes(q)&&(s=[{id:e,name:g.name,value:f}]),s.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:s})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...C[(0,j.wG)(b)]||[],...C[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[t,p,E,y,A,C,q,n]),G=(0,e.useMemo)(()=>{if(q)return[];if(!u.trim())return w;let a=u.toLowerCase();return w.filter(b=>[b.name,b.value,b.exposedModel,b.internalName,b.description,b.pickerType].map(a=>String(a||"").toLowerCase()).some(b=>b.includes(a)))},[w,u,q]),H=(0,e.useMemo)(()=>{let a=u.trim().toLowerCase(),b={};return Object.entries(F).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>r.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!r.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[F,u,r]),I=a=>{let d=a?.value||a?.name||a;r.includes(d)&&f?f(a):c(a),s&&(b(),v(""))},J=()=>{b(),v("")};return a?(0,d.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/65 p-4 backdrop-blur-sm",onMouseDown:a=>{a.target===a.currentTarget&&J()},role:"dialog","aria-modal":"true","aria-label":o,children:(0,d.jsxs)("div",{className:"flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",onMouseDown:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-border px-4 py-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"truncate text-base font-semibold text-text-main",children:o}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Click to add models to the combo. Click an added item again to remove it."})]}),(0,d.jsx)("button",{type:"button",onClick:J,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface hover:text-text-main","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden bg-white p-4 dark:bg-zinc-950",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:a=>v(a.target.value),className:"w-full rounded-xl border border-border bg-white py-2 pl-9 pr-3 text-sm text-text-main shadow-sm outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 dark:bg-zinc-900"})]})}),(0,d.jsxs)("div",{className:"max-h-[58vh] overflow-y-auto space-y-3 pr-1",children:[G.length>0&&(0,d.jsxs)("div",{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",G.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:G.map(a=>{let b=a.value||a.exposedModel||a.model||a.name||a.id,c=a.name||b,e=r.includes(b),f=g===b;return(0,d.jsxs)("button",{onClick:()=>I({id:b,name:c,value:b,combo:a}),className:`
|
|
1
|
+
exports.id=6604,exports.ids=[6604],exports.modules={267:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(51126),h=c(99258);let i=a=>({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 (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",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"}})[a]||{name:a,flag:"\uD83C\uDF10"};function j({className:a="",isOpen:b,onClose:c,hideTrigger:k=!1}){let[l,m]=(0,e.useState)("en"),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),r=(0,e.useRef)(null),s="boolean"==typeof b,t=s?b:p,u=a=>{s?!a&&c&&c(l):q(a)},v=async a=>{if(a!==l&&!n){o(!0),u(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:a})}),await (0,h.wn)(),m(a)}catch(a){console.error("Failed to set locale:",a)}finally{o(!1)}}};return(0,d.jsxs)("div",{className:a,children:[!k&&(0,d.jsxs)("button",{onClick:()=>u(!t),disabled:n,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:i(l).name}),(0,d.jsx)("span",{className:"text-lg",children:i(l).flag})]}),t&&(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>u(!1)}),(0,d.jsxs)("div",{ref:r,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,d.jsx)("button",{onClick:()=>u(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,d.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:g.YZ.map(a=>{let b=l===a,c=i(a);return(0,d.jsxs)("button",{onClick:()=>v(a),disabled:n,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${b?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${n?"opacity-70 cursor-wait":""}`,title:c.name,children:[(0,d.jsx)("span",{className:"text-2xl",children:c.flag}),(0,d.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:c.name}),b&&(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},a)})})})]})]}),document.body)]})}},962:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\McpMarketplaceModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\McpMarketplaceModal.js","default")},2287:(a,b,c)=>{Promise.resolve().then(c.bind(c,18200)),Promise.resolve().then(c.bind(c,70061)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,33811)),Promise.resolve().then(c.bind(c,20493)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,70139)),Promise.resolve().then(c.bind(c,49123)),Promise.resolve().then(c.bind(c,64148)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,29354)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,962)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,29674)),Promise.resolve().then(c.bind(c,5843)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,81923)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,18421)),Promise.resolve().then(c.bind(c,2422))},2422:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\UsageStats.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\UsageStats.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\OAuthModal.js","default")},3236:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f);c(51126);var h=c(42118),i=c(11229);c(97564);var j=c(267);let k={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 l({icon:a,label:b,onClick:c,trailing:e,danger:f}){return(0,d.jsxs)("button",{onClick:c,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${f?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f?"":"text-text-muted"}`,children:a}),(0,d.jsx)("span",{className:"flex-1 text-left",children:b}),e&&(0,d.jsx)("span",{className:"text-base",children:e})]})}function m({onLogout:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)("en"),{toggleTheme:r,isDark:s}=(0,h.D)(),t=(0,e.useRef)(null);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative",ref:t,children:[(0,d.jsx)("button",{onClick:()=>c(a=>!a),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,d.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),b&&(0,d.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,d.jsx)(l,{icon:"history",label:"Change Log",onClick:()=>{c(!1),g(!0)}}),(0,d.jsx)(l,{icon:"language",label:k[p]?.name||p,trailing:k[p]?.flag||"\uD83C\uDF10",onClick:()=>{c(!1),o(!0)}}),(0,d.jsx)(l,{icon:s?"light_mode":"dark_mode",label:"Theme",onClick:()=>{r(),c(!1)}}),(0,d.jsx)(l,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{c(!1),a()}})]})]}),(0,d.jsx)(i.default,{isOpen:f,onClose:()=>g(!1)}),(0,d.jsx)(j.default,{hideTrigger:!0,isOpen:n,onClose:a=>{o(!1),q(a)}})]})}l.propTypes={icon:g().string.isRequired,label:g().string.isRequired,onClick:g().func.isRequired,trailing:g().node,danger:g().bool},m.propTypes={onLogout:g().func.isRequired}},4770:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,options:b=[],value:c,onChange:g,placeholder:h="Select an option",error:i,hint:j,disabled:k=!1,required:l=!1,className:m,selectClassName:n,...o}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",m),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,l&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("select",{value:c,onChange:g,disabled:k,className:(0,e.cn)("w-full py-2.5 px-3 pr-10 text-sm text-text-main","bg-surface-2 border border-transparent rounded-[10px] appearance-none","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",n),...o,children:[(0,d.jsx)("option",{value:"",disabled:!0,children:h}),b.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}),(0,d.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},5291:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(79346),i=c(86209),j=c(56110);function k({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),q=(0,e.useCallback)((a,b)=>{"builder-id"===a?l("builder-id"):"idc"===a?(l("idc"),p(b)):"social"===a?(l("social"),n(b.provider)):"import"===a&&c?.()},[c]),r=()=>{l(null),n(null),p(null)};return g?"builder-id"===g||"idc"===g?(0,d.jsx)(h.default,{isOpen:a,provider:"kiro",providerInfo:b,onSuccess:()=>{l(null),p(null),c?.(),f?.()},onClose:r,idcConfig:o}):"social"===g&&m?(0,d.jsx)(j.default,{isOpen:a,provider:m,onSuccess:()=>{l(null),n(null),c?.(),f?.()},onClose:r}):null:(0,d.jsx)(i.default,{isOpen:a,onMethodSelect:q,onClose:f})}k.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},5843:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\NoAuthProxyCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\NoAuthProxyCard.js","default")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Card.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Modal.js","ConfirmModal")},10535:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,86739)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,86209)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,54004)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,87226))},11229:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(49885),h=c.n(g),i=c(26921);function j({isOpen:a,onClose:b}){let[c,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),m=(0,e.useRef)(null);return!a||"u"<typeof document?null:(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{ref:m,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),k&&(0,d.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",k]}),!h&&!k&&c&&(0,d.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:c}})]})]})]}),document.body)}c(12020),i.xI.setOptions({gfm:!0,breaks:!0}),j.propTypes={isOpen:h().bool.isRequired,onClose:h().func.isRequired}},11633:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(17660);let f={mode:{label:"Mode",format:a=>a},defaultModel:{label:"Model",format:a=>a,mono:!0},baseUrl:{label:"Endpoint",format:a=>a,isLink:!0,mono:!0},costPerQuery:{label:"Cost / call",format:a=>0===a?"Free":`$${a.toFixed(4)}`},pricingUrl:{label:"Pricing",format:()=>"View pricing",isLink:!0},freeTier:{label:"Free tier",format:a=>a},freeMonthlyQuota:{label:"Free quota",format:a=>0===a?"—":a>=999999?"Unlimited":`${a.toLocaleString()} / mo`},searchTypes:{label:"Types",format:a=>a.join(", ")},formats:{label:"Formats",format:a=>a.join(", ")},maxMaxResults:{label:"Max results",format:a=>a},maxCharacters:{label:"Max chars",format:a=>a.toLocaleString()}};function g({config:a,provider:b,title:c="Provider Info"}){if(!a)return null;let h=Object.entries(f).filter(([b])=>void 0!==a[b]&&null!==a[b]&&""!==a[b]).map(([b,c])=>({key:b,label:c.label,value:c.format(a[b]),isLink:c.isLink,mono:c.mono,raw:a[b]})),i=b?.notice?.apiKeyUrl||b?.website,j=b?.notice?.text;return(0,d.jsxs)(e.default,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:c}),i&&(0,d.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2",children:[h.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0",children:a.label}),a.isLink?(0,d.jsx)("a",{href:a.raw,target:"_blank",rel:"noopener noreferrer",className:`text-sm text-primary hover:underline truncate ${a.mono?"font-mono":""}`,children:a.value}):(0,d.jsx)("span",{className:`text-sm text-text-main truncate ${a.mono?"font-mono":""}`,children:a.value})]},a.key)),j&&(0,d.jsxs)("div",{className:"flex items-start gap-3 min-w-0 sm:col-span-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0 mt-0.5",children:"Notice"}),(0,d.jsx)("span",{className:"text-sm text-text-main leading-relaxed",children:j})]})]})]})}},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroOAuthWrapper.js","default")},17660:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,elev:k=!1,className:l,...m}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-surface border border-border-subtle",k?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[var(--shadow-soft)]",j&&"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"}[i],l),...m,children:[(b||h)&&(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:g})}),(0,d.jsxs)("div",{children:[b&&(0,d.jsx)("h3",{className:"text-text-main font-semibold",children:b}),c&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.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",c),...f,children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:b})]})}},18200:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\AddCustomEmbeddingModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\AddCustomEmbeddingModal.js","default")},18421:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Tooltip.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Tooltip.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\RequestLogger.js","default")},20084:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(95145);function g({isOpen:a,onClose:b,onAdd:c,addedNames:h=[]}){let[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)("all"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),A=(0,e.useMemo)(()=>new Set(h),[h]),B=(0,e.useMemo)(()=>{let a=m.trim().toLowerCase();return i.filter(b=>("authless"!==o||!b.oauth)&&("oauth"!==o||!!b.oauth)&&(!a||(b.title||"").toLowerCase().includes(a)||(b.description||"").toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)))},[i,m,o]),C=async a=>{if(!u[a.url]){x(b=>({...b,[a.url]:!0}));try{let b=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a.url})}),c=await b.json(),d=c.tools||[],e=Array.isArray(a.toolNames)?a.toolNames:[],f=d.length>0?d.map(a=>a.name):e;v(b=>({...b,[a.url]:{tools:d,requiresAuth:!!c.requiresAuth,error:c.error}})),z(b=>({...b,[a.url]:Object.fromEntries(f.map(a=>[a,!0]))}))}catch(b){v(c=>({...c,[a.url]:{tools:[],error:b.message}}))}finally{x(b=>({...b,[a.url]:!1}))}}},D=(a,b)=>{let c=y[a]||{};z(d=>({...d,[a]:Object.fromEntries(Object.keys(c).map(a=>[a,b]))}))};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:"Browse MCP Marketplace",size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsxs)("select",{value:o,onChange:a=>p(a.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,d.jsx)("option",{value:"all",children:"All"}),(0,d.jsx)("option",{value:"authless",children:"Authless"}),(0,d.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),q&&(0,d.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:q}),k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading registry..."})]}),!k&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===B.length&&(0,d.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),B.map(a=>{let b=A.has(a.slug||a.name),e=s===a.url,f=u[a.url],g=w[a.url],h=y[a.url]||{},i=Object.keys(h),j=Object.values(h).filter(Boolean).length;return(0,d.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[a.iconUrl?(0,d.jsx)("img",{src:a.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-xs",children:a.title}),a.oauth?(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),a.toolCount>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.toolCount," tools"]})]}),a.description&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:a.description})]}),(0,d.jsx)("button",{onClick:()=>b?null:void(s===a.url?t(null):(t(a.url),C(a))),disabled:b,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${b?"bg-green-500/10 text-green-600 cursor-default":e?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:b?"Added":e?"Cancel":"+ Add"})]}),e&&(0,d.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Probing server for tools..."})]}),!g&&f?.requiresAuth&&(0,d.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!g&&f?.error&&!f?.requiresAuth&&(0,d.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",f.error]}),!g&&0===i.length&&!f?.requiresAuth&&!f?.error&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!g&&i.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[j,"/",i.length," tools enabled"]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>D(a.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,d.jsx)("button",{onClick:()=>D(a.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:i.map(b=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,d.jsx)("input",{type:"checkbox",checked:!!h[b],onChange:()=>{var c;return c=a.url,void z(a=>({...a,[c]:{...a[c],[b]:!a[c]?.[b]}}))},className:"size-3"}),(0,d.jsx)("span",{className:"truncate",children:b})]},b))})]}),(0,d.jsx)("button",{onClick:()=>{let b,d;return d=Object.keys(b=y[a.url]||{}).filter(a=>b[a]),void(c?.({name:a.slug||a.name,title:a.title,description:a.description,url:a.url,transport:a.transport,oauth:a.oauth,toolNames:d}),t(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},a.url)})]}),(0,d.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[B.length," of ",i.length," servers"]})]})})}},20493:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ComboFormModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ComboFormModal.js","default")},23048:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(97564);function g(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{onClick:()=>b(!0),className:"relative flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg transition-all text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5",title:"9Remote",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"computer"}),(0,d.jsx)("span",{className:"text-xs font-medium",children:"Remote"})]}),(0,d.jsx)(f.A,{isOpen:a,onClose:()=>b(!1)})]})}},25919:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({src:a,alt:b="Avatar",name:c,size:g="md",className:h}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return a?(0,d.jsx)("div",{className:(0,e.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],h),style:{backgroundImage:`url(${a})`},role:"img","aria-label":b}):(0,d.jsx)("div",{className:(0,e.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],(a=>{if(!a)return"bg-primary";let b=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],c=a.charCodeAt(0)%b.length;return b[c]})(c),h),role:"img","aria-label":b,children:(a=>{if(!a)return"?";let b=a.split(" ");return b.length>=2?`${b[0][0]}${b[1][0]}`.toUpperCase():a.substring(0,2).toUpperCase()})(c)})}},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Sidebar.js","default")},29354:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\HeaderMenu.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\HeaderMenu.js","default")},29674:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\NineRemoteButton.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\NineRemoteButton.js","default")},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(70061),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(49123),c(3080),c(94582),c(70603),c(20493),c(962),c(2422),c(45205),c(29674),c(29354),c(33811),c(19083),c(82448),c(14285),c(87228),c(40167),c(80342),c(64148),c(70139),c(18200),c(5843),c(54065),c(18421),c(81923);var e=c(61780);function f({children:a}){return(0,d.jsx)(e.default,{children:a})}c(64420)},32971:(a,b,c)=>{"use strict";c.d(b,{default:()=>e});var d=c(48249);function e({text:a,children:b,position:c="top",color:f}){let g=f?"":"bg-gray-900";return(0,d.jsxs)("div",{className:"relative inline-flex group",children:[b,(0,d.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"}[c]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${g} text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,style:f?{backgroundColor:f}:{},children:a})]})}},33811:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ChangelogModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ChangelogModal.js","default")},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Badge.js","default")},37365:(a,b,c)=>{"use strict";c.d(b,{C:()=>d});let d=(0,c(31417).v)(a=>({query:"",placeholder:"",visible:!1,setQuery:b=>a({query:b}),register:(b="Search...")=>a({visible:!0,placeholder:b,query:""}),unregister:()=>a({visible:!1,placeholder:"",query:""})}))},39645:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(95145),g=c(99070),h=c(50377);function i({isOpen:a,onClose:b,title:c="Manual Configuration",configs:j=[]}){let{copy:k}=(0,h.C)(),[l,m]=(0,e.useState)(null);return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:c,size:"xl",children:(0,d.jsx)("div",{className:"flex flex-col gap-4",children:j.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:a.filename}),(0,d.jsxs)(g.default,{variant:"ghost",size:"sm",onClick:()=>{var c;return c=a.content,void(k(c,`manualconfig-${b}`),m(b),setTimeout(()=>m(null),2e3))},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:l===b?"check":"content_copy"}),l===b?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:a.content})]},b))})})}},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ThemeToggle.js","default")},41371:(a,b,c)=>{"use strict";c.d(b,{i:()=>f});var d=c(31417);let e=0,f=(0,d.v)((a,b)=>({notifications:[],addNotification:c=>{let d=++e,f={id:d,type:c.type||"info",message:c.message,title:c.title||null,duration:c.duration??5e3,dismissible:c.dismissible??!0,createdAt:Date.now()};return a(a=>({notifications:[...a.notifications,f]})),f.duration>0&&setTimeout(()=>b().removeNotification(d),f.duration),d},removeNotification:b=>{a(a=>({notifications:a.notifications.filter(a=>a.id!==b)}))},clearAll:()=>a({notifications:[]}),success:(a,c)=>b().addNotification({type:"success",message:a,title:c}),error:(a,c)=>b().addNotification({type:"error",message:a,title:c,duration:8e3}),warning:(a,c)=>b().addNotification({type:"warning",message:a,title:c}),info:(a,c)=>b().addNotification({type:"info",message:a,title:c})}))},42118:(a,b,c)=>{"use strict";c.d(b,{D:()=>i});var d=c(67484),e=c(13033);function f(a){return()=>{}}function g(){return!1}function h(){return!1}function i(){let{theme:a,setTheme:b,toggleTheme:c,initTheme:i}=(0,e.A)(),j=(0,d.useSyncExternalStore)(f,g,h);return{theme:a,setTheme:b,toggleTheme:c,isDark:"dark"===a||"system"===a&&j}}},42196:(a,b,c)=>{"use strict";c.d(b,{default:()=>p});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(19099),k=c(71404),l=c(12020);let m=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/media-providers/web",label:"Media / Web",icon:"perm_media"},{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"},{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"},{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],n=[{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"}];function o({href:a,label:b,icon:c,active:e,onClick:f}){return(0,d.jsxs)(i(),{href:a,onClick:f,className:(0,k.cn)("group flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all",e?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c}),(0,d.jsx)("span",{className:"truncate",children:b})]})}function p({onClose:a}){let b=(0,j.usePathname)(),c=(0,j.useRouter)(),[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(""),[k,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),t=()=>a?.(),u=async()=>{if(!r&&confirm("Restart BlueRouter now? The dashboard will be unavailable for a few seconds.")){s(!0);try{let a=await fetch("/api/version/restart",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok||b?.success===!1)throw Error(b?.message||"Restart request failed");setTimeout(()=>{window.location.reload()},2500)}catch(a){alert(a?.message||"Restart request failed"),s(!1)}}},v=async()=>{try{await fetch("/api/auth/logout",{method:"POST"})}catch{}c.push("/login"),c.refresh()};return(0,d.jsxs)("div",{className:"flex h-full flex-col p-4",children:[(0,d.jsxs)("div",{className:"mb-5 rounded-2xl bg-primary/10 p-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary",children:"hub"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"truncate text-lg font-bold text-text-main",children:"Blue Router"}),(0,d.jsxs)("div",{className:"text-xs text-text-muted",children:["v",l.vQ?.version||"local"]})]})]}),f?(0,d.jsxs)("div",{className:"mt-3 rounded-xl bg-background/70 px-3 py-2 text-xs text-text-muted",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 font-medium text-text-main",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"person"}),(0,d.jsx)("span",{className:"truncate",children:f})]}),(0,d.jsxs)("div",{className:"mt-1",children:[k?"Admin":"User",h?` \xb7 ${h}`:""]})]}):null]}),(0,d.jsx)("nav",{className:"flex-1 space-y-1 overflow-y-auto pr-1",children:(k?m:n).map(a=>{var c;return(0,d.jsx)(o,{...a,active:"/dashboard/endpoint"===(c=a.href)?"/dashboard"===b||b.startsWith("/dashboard/endpoint"):b===c||b.startsWith(`${c}/`),onClick:t},a.href)})}),(0,d.jsxs)("div",{className:"mt-4 space-y-2 border-t border-border pt-4",children:[k?(0,d.jsxs)("button",{onClick:u,disabled:r,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm font-medium text-amber-700 transition hover:bg-amber-500/20 disabled:cursor-not-allowed disabled:opacity-60 dark:text-amber-300",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"restart_alt"}),r?"Restarting...":"Restart"]}):null,(0,d.jsxs)("button",{onClick:v,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-muted transition hover:bg-surface-2 hover:text-text-main",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"logout"}),"Logout"]})]})]})}o.propTypes={href:g().string.isRequired,label:g().string.isRequired,icon:g().string.isRequired,active:g().bool,onClick:g().func},p.propTypes={onClose:g().func}},43182:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);let i="https://gitlab.com";function j({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(i),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),B=()=>{k(null),m(i),o(""),q(""),s(""),w(null),u(!1),y(!1),A(null),f()},C=async()=>{if(!r.trim())return void w("Personal Access Token is required");u(!0),w(null);try{let a=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r.trim(),baseUrl:l.trim()||i})}),b=await a.json();if(!a.ok)throw Error(b.error||"Authentication failed");c?.(),B()}catch(a){w(a.message)}finally{u(!1)}};return a?x&&z?(0,d.jsx)(h.LF,{isOpen:!0,provider:"gitlab",providerInfo:b,oauthMeta:z,onSuccess:()=>{c?.(),B()},onClose:()=>{y(!1),A(null)}}):(0,d.jsx)(h.aF,{isOpen:a,title:"Connect GitLab Duo",onClose:B,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("button",{onClick:()=>k("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,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,d.jsxs)("button",{onClick:()=>k("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,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"http://localhost/callback"})]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Client ID",value:n,onChange:a=>o(a.target.value),placeholder:"Your OAuth application client ID"}),(0,d.jsx)(h.pd,{label:"Client Secret (optional for PKCE)",value:p,onChange:a=>q(a.target.value),placeholder:"Leave empty for public PKCE app"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{n.trim()?(w(null),A({baseUrl:l.trim()||i,clientId:n.trim(),clientSecret:p.trim()}),y(!0)):w("Client ID is required")},fullWidth:!0,disabled:!n.trim(),children:"Authorize"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Personal Access Token",value:r,onChange:a=>s(a.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:C,fullWidth:!0,disabled:!r.trim()||t,loading:t,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Button.js","default")},48781:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.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,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.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,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},49123:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Footer.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Footer.js","default")},50377:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(b);else{let a=document.createElement("textarea");a.value=b,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}})(),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{"use strict";c.d(b,{x0:()=>x.default,Ex:()=>j.default,$n:()=>d.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,CK:()=>o.default,uo:()=>h.ConfirmModal,G9:()=>t.default,wI:()=>w.default,vj:()=>v.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,uR:()=>n.default,Nf:()=>p.default,aF:()=>h.default,rq:()=>m.default,gw:()=>y.default,LF:()=>l.default,Wx:()=>B.default,gM:()=>r.default,Iz:()=>z.default,l6:()=>f.default,lM:()=>k.default,m_:()=>A.default,jK:()=>q.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514);c(53845),c(19308),c(42196),c(86739),c(48781);var l=c(79346),m=c(83352),n=c(39645),o=c(62727),p=c(20084),q=c(87226);c(267),c(23048),c(3236),c(11229);var r=c(91809);c(86209);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(43182),w=c(51585),x=c(67738),y=c(50585),z=c(91099),A=c(32971),B=c(11633);c(54004),c(53838)},50585:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(17660),i=c(4770),j=c(75171);let k="__none__";function l({providerId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(k),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(!1),q=async b=>{g(b),n(!0);try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={...d[a]||{}};b===k?delete e.proxyPoolId:e.proxyPoolId=b;let f={...d};0===Object.keys(e).length?delete f[a]:f[a]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})}),p(!0),setTimeout(()=>p(!1),1500)}catch(a){console.log("Save proxyPoolId error:",a)}finally{n(!1)}};return(0,d.jsxs)(h.default,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),o&&(0,d.jsx)(j.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,d.jsx)(i.default,{label:"Proxy Pool",value:f,onChange:a=>q(a.target.value),disabled:m,options:[{value:k,label:"None (direct)"},...b.map(a=>({value:a.id,label:a.name}))]})]})}l.propTypes={providerId:g().string.isRequired}},51109:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,d.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},51585:(a,b,c)=>{"use strict";c.d(b,{default:()=>v});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(83552),j=c(99070),k=c(75171),l=c(96919),m=c(12020),n=c(73050);let o=[0,1,2,3,4,5,6],p=[{value:1,label:"T2"},{value:2,label:"T3"},{value:3,label:"T4"},{value:4,label:"T5"},{value:5,label:"T6"},{value:6,label:"T7"},{value:0,label:"CN"}];function q(a,b){let c=String(a||"").trim();return/^([01]\d|2[0-3]):([0-5]\d)$/.test(c)?c:b}function r(a={}){let b=a&&"object"==typeof a?a:{},c=Array.isArray(b.weekdays)?b.weekdays.map(Number).filter(a=>a>=0&&a<=6):o;return{enabled:!1!==b.enabled,weekdays:[...new Set(c)].sort((a,b)=>a-b),fromTime:q(b.fromTime||b.from,"00:00"),toTime:q(b.toTime||b.to,"23:59")}}function s(a={}){var b;let c=a&&"object"==typeof a?a:{};return{enabled:!0===c.enabled,intervalSec:Math.max(10,Number.parseInt(c.intervalSec||60,10)||60),failureThreshold:Math.max(1,Number.parseInt(c.failureThreshold||3,10)||3),timeoutMs:Math.max(1e3,Number.parseInt(c.timeoutMs||15e3,10)||15e3),prompt:"string"==typeof c.prompt&&c.prompt.trim()?c.prompt.trim():"Say hi",disableThinking:!1!==c.disableThinking,model:"string"==typeof(b=c.model||c.healthModel||c.testModel)?b.trim():""}}function t(){return"text-xs font-medium text-text-muted"}function u(){return"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50"}function v({isOpen:a,connection:b,proxyPools:c,onSave:f,onClose:g}){let[q,w]=(0,e.useState)({name:"",priority:1,apiKey:""}),[x,y]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[z,A]=(0,e.useState)({accountId:""}),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(r()),[N,O]=(0,e.useState)(s()),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)([]),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),Z=b?.authType==="oauth",$=b?.provider==="azure",_=b?.provider==="cloudflare-ai",aa=b?function(a=""){if((0,l.gb)(a))return"anthropic";if((0,l.mq)(a)||"cloudflare-ai"===a)return"openai";if("gemini"===a)return"gemini";if("github"===a)return"openai";let b=m.X3?.[a]||"";return b.includes("/messages")?"anthropic":b.includes("/chat/completions")||b.includes("/responses")?"openai":null}(b.provider):null,ab=!!aa,ac=(0,n.wB)(T,N.model),ad=async()=>{if(b?.provider){C(!0),E(null);try{let a=await fetch(`/api/providers/${b.id}/test`,{method:"POST"}),c=await a.json();E(c.valid?"success":"failed")}catch{E("failed")}finally{C(!1)}}},ae=async()=>{if(b?.provider&&q.apiKey){G(!0),I(null);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:q.apiKey,...$?{providerSpecificData:x}:{},..._?{providerSpecificData:z}:{}})}),c=await a.json();I(c.valid?"success":"failed")}catch{I("failed")}finally{G(!1)}}},af=async()=>{if(b){K(!0);try{let a={name:q.name,priority:q.priority,schedule:r(L),healthCheck:s(N)};if(!Z&&q.apiKey){a.apiKey=q.apiKey;let c="success"===H;if(!c)try{G(!0),I(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:q.apiKey,...$?{providerSpecificData:x}:{},..._?{providerSpecificData:z}:{}})});c=!!(await a.json()).valid,I(c?"success":"failed")}catch{I("failed")}finally{G(!1)}c&&(a.testStatus="active",a.lastError=null,a.lastErrorAt=null)}$&&(a.providerSpecificData={azureEndpoint:x.azureEndpoint,apiVersion:x.apiVersion,deployment:x.deployment,organization:x.organization}),_&&(a.providerSpecificData={accountId:z.accountId}),await f(a)}finally{K(!1)}}};return b?(0,d.jsx)(h.default,{isOpen:a,onClose:g,title:"Chỉnh sửa connection",size:"full",children:(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsx)(i.default,{label:"T\xean",value:q.name,onChange:a=>w({...q,name:a.target.value}),placeholder:Z?"T\xean t\xe0i khoản":"Key production"}),(0,d.jsx)(i.default,{label:"Priority",type:"number",value:q.priority,onChange:a=>w({...q,priority:Number.parseInt(a.target.value,10)||1})})]}),Z&&b.email&&(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-sidebar/40 px-3 py-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Email:"})," ",b.email]}),!Z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.default,{label:"API Key",type:"password",value:q.apiKey,onChange:a=>w({...q,apiKey:a.target.value}),placeholder:"Nhập API key mới",hint:"Để trống nếu muốn giữ API key hiện tại.",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.default,{onClick:ae,disabled:!q.apiKey||F||J,variant:"secondary",children:F?"Checking...":"Check"})}),H&&(0,d.jsx)("div",{className:"pt-7",children:(0,d.jsx)(k.default,{variant:"success"===H?"success":"error",children:"success"===H?"Valid":"Invalid"})})]}),$&&(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-sidebar/40 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Cấu h\xecnh Azure OpenAI"}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsx)(i.default,{label:"Azure Endpoint",value:x.azureEndpoint,onChange:a=>y({...x,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(i.default,{label:"T\xean deployment",value:x.deployment,onChange:a=>y({...x,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(i.default,{label:"Phi\xean bản API",value:x.apiVersion,onChange:a=>y({...x,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(i.default,{label:"Organization",value:x.organization,onChange:a=>y({...x,organization:a.target.value}),placeholder:"Organization ID"})]})]}),_&&(0,d.jsx)(i.default,{label:"Cloudflare Account ID",value:z.accountId,onChange:a=>A({...z,accountId:a.target.value})}),(0,d.jsxs)("section",{className:"rounded-xl border border-border bg-sidebar/30 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Lịch hoạt động"}),P&&(0,d.jsx)("p",{className:"mb-3 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-500",children:"Provider đang bật ghi đ\xe8 lịch. Lịch ri\xeang của t\xe0i khoản n\xe0y sẽ bị kh\xf3a v\xe0 bị bỏ qua khi ghi đ\xe8 c\xf2n bật."}),(0,d.jsxs)("label",{className:"mb-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:L.enabled,disabled:P,onChange:a=>M(b=>({...b,enabled:a.target.checked}))}),"Bật lịch cho t\xe0i khoản"]}),(0,d.jsx)("div",{className:"mb-3 flex flex-wrap gap-2",children:p.map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 rounded-lg border border-border px-2.5 py-1.5 text-xs text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:L.weekdays.includes(a.value),disabled:P,onChange:()=>M(b=>{let c=new Set(Array.isArray(b.weekdays)?b.weekdays:o);return c.has(a.value)?c.delete(a.value):c.add(a.value),{...b,weekdays:[...c].sort((a,b)=>a-b)}})}),a.label]},a.value))}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("label",{className:t(),children:["Từ giờ",(0,d.jsx)("input",{type:"time",value:L.fromTime,disabled:P,onChange:a=>M(b=>({...b,fromTime:a.target.value})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["Đến giờ",(0,d.jsx)("input",{type:"time",value:L.toTime,disabled:P,onChange:a=>M(b=>({...b,toTime:a.target.value})),className:u()})]})]})]}),(0,d.jsxs)("section",{className:"rounded-xl border border-border bg-sidebar/30 p-4",children:[(0,d.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-main",children:"Kiểm tra sức khỏe bằng ping"}),R&&(0,d.jsx)("p",{className:"mb-3 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-500",children:"Provider đang bật ghi đ\xe8 healthcheck. Ch\xednh s\xe1ch healthcheck ri\xeang của t\xe0i khoản n\xe0y sẽ bị kh\xf3a v\xe0 bị bỏ qua khi ghi đ\xe8 c\xf2n bật."}),(0,d.jsxs)("label",{className:"mb-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:N.enabled,disabled:R,onChange:a=>O(b=>({...b,enabled:a.target.checked}))}),"Bật healthcheck định kỳ"]}),N.enabled&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("label",{className:t(),children:["Healthcheck model",(0,d.jsxs)("select",{value:N.model||"",onChange:a=>O(b=>({...b,model:a.target.value})),className:u(),disabled:R||V,children:[(0,d.jsx)("option",{value:"",children:"Chỉ kiểm tra connection/base URL — kh\xf4ng ping chat"}),ac.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name||a.id},a.id))]})]}),(0,d.jsxs)("label",{className:`${t()} mt-3 block`,children:["Nhập model healthcheck thủ c\xf4ng",(0,d.jsx)("input",{value:N.model||"",onChange:a=>O(b=>({...b,model:a.target.value})),placeholder:"anthropic"===aa?"t\xean model Claude từ endpoint n\xe0y":"gemini"===aa?"model Gemini, v\xed dụ gemini-2.5-flash":"t\xean model từ Available Models",className:u(),disabled:R||V})]}),V&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Đang tải Available Models cục bộ..."}),X&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-yellow-500",children:["Ghi ch\xfa danh s\xe1ch model: ",X]}),!V&&!X&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Danh s\xe1ch model được lấy từ Available Models / DB cục bộ, kh\xf4ng gọi API /models của provider."}),"anthropic"===aa&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Healthcheck tương th\xedch Anthropic gửi ",(0,d.jsx)("code",{children:"Say hi"})," tới ",(0,d.jsx)("code",{children:"/v1/messages"})," chỉ khi đ\xe3 chọn model."]}),"gemini"===aa&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Healthcheck Gemini gửi ",(0,d.jsx)("code",{children:"Say hi"})," bằng API native ",(0,d.jsx)("code",{children:"generateContent"})," chỉ khi đ\xe3 chọn model."]}),"cloudflare-ai"===b.provider&&(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Healthcheck Cloudflare gửi ",(0,d.jsx)("code",{children:"Say hi"})," tới Workers AI OpenAI-style chat endpoint chỉ khi đ\xe3 chọn model."]}),!ab&&(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Provider n\xe0y vẫn c\xf3 thể hiển thị Available Models cục bộ. Auto healthcheck sẽ tiếp tục d\xf9ng kiểm tra connection/token/account gốc cho đến khi c\xf3 direct chat endpoint."})]}),N.enabled&&(!ab||!N.model)&&(0,d.jsx)("p",{className:"mt-4 rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"Chưa bật model/endpoint direct chat healthcheck. Auto healthcheck sẽ kiểm tra connection/base URL/key/token/account v\xe0 kh\xf4ng gửi ping chat Say hi."}),(0,d.jsxs)("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[(0,d.jsxs)("label",{className:t(),children:["Chu kỳ (gi\xe2y)",(0,d.jsx)("input",{type:"number",min:"10",value:N.intervalSec,disabled:R,onChange:a=>O(b=>({...b,intervalSec:Math.max(10,Number.parseInt(a.target.value,10)||60)})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["Ngưỡng lỗi",(0,d.jsx)("input",{type:"number",min:"1",value:N.failureThreshold,disabled:R,onChange:a=>O(b=>({...b,failureThreshold:Math.max(1,Number.parseInt(a.target.value,10)||3)})),className:u()})]}),(0,d.jsxs)("label",{className:t(),children:["Timeout (ms)",(0,d.jsx)("input",{type:"number",min:"1000",value:N.timeoutMs,disabled:R,onChange:a=>O(b=>({...b,timeoutMs:Math.max(1e3,Number.parseInt(a.target.value,10)||15e3)})),className:u()})]})]}),(0,d.jsxs)("label",{className:`${t()} mt-3 block`,children:["Prompt",(0,d.jsx)("input",{value:N.prompt,disabled:R,onChange:a=>O(b=>({...b,prompt:a.target.value})),className:u()})]}),(0,d.jsxs)("label",{className:"mt-3 flex items-center gap-2 text-sm text-text-main",children:[(0,d.jsx)("input",{type:"checkbox",checked:N.disableThinking,disabled:R,onChange:a=>O(b=>({...b,disableThinking:a.target.checked}))}),"Ưu ti\xean payload kiểm tra nhẹ / tắt thinking nếu được hỗ trợ"]}),(0,d.jsxs)("div",{className:"mt-3 text-xs text-text-muted",children:["Trạng th\xe1i: ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:b.healthStatus||"kh\xf4ng r\xf5"}),b.healthLastCheckedAt&&(0,d.jsxs)("span",{children:[" \xb7 lần kiểm tra cuối: ",function(a){if(!a)return"";try{return new Date(a).toLocaleString()}catch{return String(a)}}(b.healthLastCheckedAt)]}),b.healthLastError&&(0,d.jsx)("p",{className:"mt-1 break-words text-red-500",children:b.healthLastError})]})]}),!$&&!_&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.default,{onClick:ad,disabled:B,variant:"secondary",children:B?"Đang kiểm tra...":"Kiểm tra connection"}),D&&(0,d.jsx)(k.default,{variant:"success"===D?"success":"error",children:"success"===D?"Hợp lệ":"Thất bại"})]}),(0,d.jsxs)("div",{className:"flex gap-2 border-t border-border pt-4",children:[(0,d.jsx)(j.default,{onClick:af,disabled:J||$&&(!x.azureEndpoint||!x.deployment||!x.organization)||_&&!z.accountId,fullWidth:!0,children:J?"Đang lưu...":"Lưu"}),(0,d.jsx)(j.default,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}v.propTypes={isOpen:g().bool.isRequired,connection:g().shape({id:g().string,name:g().string,email:g().string,priority:g().number,authType:g().string,provider:g().string,defaultModel:g().string,providerSpecificData:g().object,schedule:g().object,healthCheck:g().object,healthStatus:g().string,healthLastCheckedAt:g().string,healthLastError:g().string,providerScheduleOverride:g().bool,providerHealthOverride:g().bool}),proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),onSave:g().func.isRequired,onClose:g().func.isRequired}},53838:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.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,d.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,d.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,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{isDark:c,toggleTheme:h}=(0,e.D)(),i={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(i[b],a),"aria-label":`Switch to ${c?"light":"dark"} mode`,title:`Switch to ${c?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:c?"light_mode":"dark_mode"})})}},54004:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(41371),g=c(42196),h=c(86739),i=c(19099);let j=["/dashboard/api-keys"];function k({children:a}){let b=(0,i.usePathname)();(0,i.useRouter)();let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(!0);return c?g||j.some(a=>b===a||b.startsWith(`${a}/`))?a:(0,d.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center text-sm text-text-muted",children:"Redirecting..."}):(0,d.jsxs)("div",{className:"flex min-h-[50vh] items-center justify-center text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mr-2 animate-spin",children:"progress_activity"}),"Loading dashboard..."]})}function l({children:a}){let[b,c]=(0,e.useState)(!1),i=(0,f.i)(a=>a.notifications),j=(0,f.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"min-h-screen bg-background text-text-main",children:[(0,d.jsx)("div",{className:"pointer-events-none fixed inset-0 bg-[linear-gradient(to_right,rgba(99,102,241,0.07)_1px,transparent_1px),linear-gradient(to_bottom,rgba(99,102,241,0.07)_1px,transparent_1px)] bg-size-[32px_32px]"}),(0,d.jsx)("div",{className:"fixed right-4 top-4 z-50 flex w-[min(420px,calc(100vw-2rem))] flex-col gap-2",children:i.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 shadow-lg backdrop-blur ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-lg",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 text-sm",children:[a.title?(0,d.jsx)("div",{className:"font-semibold",children:a.title}):null,(0,d.jsx)("div",{children:a.message})]}),a.dismissible?(0,d.jsx)("button",{onClick:()=>j(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/40 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("aside",{className:"fixed inset-y-0 left-0 z-40 hidden w-72 border-r border-border bg-surface/90 backdrop-blur lg:block",children:(0,d.jsx)(g.default,{})}),(0,d.jsx)("aside",{className:`fixed inset-y-0 left-0 z-50 w-72 border-r border-border bg-surface/95 backdrop-blur transition-transform lg:hidden ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(g.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{className:"relative z-10 min-h-screen lg:pl-72",children:[(0,d.jsx)(h.default,{onMenuClick:()=>c(!0)}),(0,d.jsx)("div",{className:"w-full max-w-none min-w-0 px-4 py-6 sm:px-6 lg:px-8",children:(0,d.jsx)(k,{children:a})})]})]})}},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\SegmentedControl.js","default")},56110:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)(),v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\layouts\\\\DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\layouts\\DashboardLayout.js","default")},62727:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(95145),g=c(83552),h=c(99070),i=c(83352);let j=/^[a-zA-Z0-9_.\-]+$/;function k({index:a,model:b,isFirst:c,isLast:f,onEdit:g,onMoveUp:h,onMoveDown:i,onRemove:j}){let[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(b),p=()=>{let a=n.trim();a&&a!==b?g(a):o(b),m(!1)};return(0,d.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,d.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:a+1}),l?(0,d.jsx)("input",{autoFocus:!0,value:n,onChange:a=>o(a.target.value),onBlur:p,onKeyDown:a=>{"Enter"===a.key&&p(),"Escape"===a.key&&(o(b),m(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,d.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>m(!0),title:"Click to edit",children:b}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,d.jsx)("button",{onClick:h,disabled:c,className:`p-0.5 rounded ${c?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,d.jsx)("button",{onClick:i,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,d.jsx)("button",{onClick:j,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function l({isOpen:a,combo:b,comboStrategy:c={},onClose:m,onSave:n,activeProviders:o,kindFilter:p=null,forcePrefix:q="",title:r}){let s=b?.name?q&&b.name.startsWith(q)?b.name.slice(q.length):b.name:"",[t,u]=(0,e.useState)(s),[v,w]=(0,e.useState)(b?.models||[]),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)({}),F=a=>{if(!a.trim())return C("Name is required"),!1;let b=q+a;return j.test(b)?(C(""),!0):(C("Only letters, numbers, -, _ and . allowed"),!1)},G=a=>{let b=a.target.value;q&&b.startsWith(q)&&(b=b.slice(q.length)),u(b),b?F(b):C("")},H=async()=>{F(t)&&(A(!0),await n({name:q+t.trim(),models:v}),A(!1))},I=!!b,J=c?.fallbackStrategy||"fallback";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{isOpen:a,onClose:m,title:r||(I?"Edit Combo":"Create Combo"),children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,d.jsxs)("div",{className:"flex items-stretch",children:[(0,d.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:q}),(0,d.jsx)("input",{value:t,onChange:G,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),B&&(0,d.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:B})]}):(0,d.jsx)(g.default,{label:"Combo Name",value:t,onChange:G,placeholder:"my-combo",error:B}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[q?`Auto-prefixed with "${q}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-primary/15 bg-primary/5 px-3 py-2 text-xs text-text-muted",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 font-medium text-primary",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"route"}),"Routing: ","least-latency"===J?"Least latency":"p2c"===J?"P2C":"round-robin"===J?"Round Robin":"Fallback priority"]}),(0,d.jsx)("p",{className:"mt-1",children:"Strategy, LAN health, and tag rules are saved in settings.comboStrategies and can be edited from the Combo card."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===v.length?(0,d.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,d.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:v.map((a,b)=>(0,d.jsx)(k,{index:b,model:a,isFirst:0===b,isLast:b===v.length-1,onEdit:a=>{let c=[...v];c[b]=a,w(c)},onMoveUp:()=>(a=>{if(0===a)return;let b=[...v];[b[a-1],b[a]]=[b[a],b[a-1]],w(b)})(b),onMoveDown:()=>(a=>{if(a===v.length-1)return;let b=[...v];[b[a],b[a+1]]=[b[a+1],b[a]],w(b)})(b),onRemove:()=>w(v.filter((a,c)=>c!==b))},b))}),(0,d.jsxs)("button",{onClick:()=>y(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,d.jsx)(h.default,{onClick:m,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(h.default,{onClick:H,fullWidth:!0,size:"sm",disabled:!t.trim()||!!B||z,children:z?"Saving...":I?"Save":"Create"})]})]})}),(0,d.jsx)(i.default,{isOpen:x,onClose:()=>y(!1),onSelect:a=>{v.includes(a.value)||w([...v,a.value])},onDeselect:a=>{w(v.filter(b=>b!==a.value))},activeProviders:o,modelAliases:D,title:"Add Model to Combo",kindFilter:p,addedModelValues:v,closeOnSelect:!1})]})}},64148:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\GitLabAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\GitLabAuthModal.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\layouts\\\\AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\layouts\\AuthLayout.js","default")},67738:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onClose:b,onCreated:c,onSaved:f,node:g}){let j=!!g,[k,l]=(0,e.useState)({name:"",prefix:"",baseUrl:"https://api.openai.com/v1"}),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),w=async()=>{if(k.name.trim()&&k.prefix.trim()&&k.baseUrl.trim()){n(!0);try{let a=j?`/api/provider-nodes/${g.id}`:"/api/provider-nodes",b={name:k.name,prefix:k.prefix,baseUrl:k.baseUrl};j||(b.type="custom-embedding");let d=await fetch(a,{method:j?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),e=await d.json();d.ok&&(j?f?.(e.node):c?.(e.node))}catch(a){console.log("Error saving custom embedding node:",a)}finally{n(!1)}}},x=async()=>{t(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:k.baseUrl,apiKey:o,type:"custom-embedding",modelId:q.trim()||void 0})}),b=await a.json();v(b)}catch{v({valid:!1,error:"Network error"})}finally{t(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:j?"Edit Custom Embedding":"Add Custom Embedding",onClose:b,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Name",value:k.name,onChange:a=>l({...k,name:a.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,d.jsx)(h.pd,{label:"Prefix",value:k.prefix,onChange:a=>l({...k,prefix:a.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,d.jsx)(h.pd,{label:"Base URL",value:k.baseUrl,onChange:a=>l({...k,baseUrl:a.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,d.jsx)(h.pd,{label:"API Key (for Check)",type:"password",value:o,onChange:a=>p(a.target.value)}),(0,d.jsx)(h.pd,{label:"Model ID (for Check)",value:q,onChange:a=>r(a.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,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)(h.$n,{onClick:x,disabled:!o||!q.trim()||s||!k.baseUrl.trim(),variant:"secondary",children:s?"Checking...":"Check"}),(()=>{if(!u)return null;let{valid:a,error:b,dimensions:c}=u;return a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.Ex,{variant:"success",children:"Valid"}),c&&(0,d.jsxs)("span",{className:"text-sm text-text-muted",children:[c," dims"]})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)(h.Ex,{variant:"error",children:"Invalid"}),b&&(0,d.jsx)("span",{className:"text-sm text-red-500",children:b})]})})()]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:!k.name.trim()||!k.prefix.trim()||!k.baseUrl.trim()||m,children:m?j?"Saving...":"Creating...":j?"Save":"Create"}),(0,d.jsx)(h.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onCreated:g().func,onSaved:g().func,node:g().shape({id:g().string,name:g().string,prefix:g().string,baseUrl:g().string})}},70061:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Avatar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Avatar.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Toggle.js","default")},70139:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\EditConnectionModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\EditConnectionModal.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ManualConfigModal.js","default")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Input.js","default")},71404:(a,b,c)=>{"use strict";function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(b,{cn:()=>d})},72738:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f);function h({src:a,alt:b,size:c=32,className:f="",fallbackText:g="?",fallbackColor:i}){let[j,k]=(0,e.useState)(!1);return!a||j?(0,d.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${f}`.trim(),style:{width:c,height:c,color:i,fontSize:Math.max(10,Math.floor(.38*c))},children:g}):(0,d.jsx)("img",{src:a,alt:b,width:c,height:c,className:f,onError:()=>k(!0)})}h.propTypes={src:g().string,alt:g().string,size:g().number,className:g().string,fallbackText:g().string,fallbackColor:g().string}},73050:(a,b,c)=>{"use strict";c.d(b,{ns:()=>l,wB:()=>m});var d=c(96919),e=c(91431);let f=[{id:"@cf/meta/llama-3.1-8b-instruct",name:"Cloudflare: Llama 3.1 8B Instruct"},{id:"@cf/meta/llama-3.1-70b-instruct",name:"Cloudflare: Llama 3.1 70B Instruct"},{id:"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",name:"Cloudflare: DeepSeek R1 Distill Qwen 32B"},{id:"@cf/qwen/qwen1.5-14b-chat-awq",name:"Cloudflare: Qwen 1.5 14B Chat AWQ"}];function g(a){return"string"==typeof a?a.trim():""}function h(a){return a&&"object"==typeof a&&!Array.isArray(a)?a:{}}function i(a){return Array.isArray(a)?a.map(a=>String(a||"").trim()).filter(Boolean):[]}function j(a=""){let b=g(a);return b?(0,d.mq)(b)||(0,d.gb)(b)?b:(0,d.wG)(b)||b:""}function k(a){return[...a].sort((a,b)=>{let c=a.source||"",d=b.source||"";if(c!==d){let a={builtin:0,connection:1,alias:2,current:3};return(a[c]??9)-(a[d]??9)}return String(a.id||"").localeCompare(String(b.id||""))})}async function l({providerId:a="",connections:b=[],currentModel:c=""}={}){let m=g(a);if(!m)return{models:[],warning:"Provider đang trống"};let n=j(m),o={},p=[],q="";try{let[a,b]=await Promise.all([fetch("/api/models/alias",{cache:"no-store"}),fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(n)}`,{cache:"no-store"})]);if(a.ok){let b=await a.json();o=h(b.aliases)}else q="Kh\xf4ng tải được model aliases từ DB cục bộ.";if(b.ok){let a=await b.json();p=i(a.ids)}}catch(a){q=a.message||"Kh\xf4ng tải được danh s\xe1ch model cục bộ."}let r=function({providerId:a="",aliases:b={},disabledIds:c=[],connections:d=[],currentModel:l=""}={}){let m=g(a);if(!m)return[];let n=j(m),o=new Set(i(c)),p=h(b),q=function(a="",b=""){return[...new Set([b,a].map(g).filter(Boolean))].map(a=>`${a}/`)}(m,n),r=new Set,s=[],t=(a,b,c="builtin")=>{let d=g(a);!d||r.has(d)||o.has(d)&&"current"!==c||(r.add(d),s.push({id:d,name:g(b)||d,source:c}))};for(let a of(0,e.KC)(m)||[])a&&(!a.type||"llm"===a.type)&&t(a.id,a.name||a.displayName||a.id,"builtin");if("cloudflare-ai"===m&&0===s.length)for(let a of f)t(a.id,a.name,"builtin");for(let a of d||[])a&&a.provider===m&&t(a.defaultModel,a.defaultModel,"connection");for(let[a,b]of Object.entries(p)){let c=function(a,b){let c=g(a);if(!c)return"";for(let a of b)if(c.startsWith(a))return c.slice(a.length).trim();return""}(b,q);c&&t(c,a&&a!==c?`${c} (${a})`:c,"alias")}let u=g(l);return u&&t(u,`${u} (current)`,"current"),k(s)}({providerId:m,aliases:o,disabledIds:p,connections:b,currentModel:c});if(!q&&0===r.length){let a=d.Q2?.[m]?.name||m;q=`Chưa c\xf3 Available Models cục bộ cho ${a}. H\xe3y th\xeam model trong Available Models trước, sau đ\xf3 mở lại hộp thoại healthcheck n\xe0y.`}return{models:r,warning:q}}function m(a=[],b=""){let c=g(b);return!c||(a||[]).some(a=>a.id===c)?a:k([...a||[],{id:c,name:`${c} (đang chọn)`,source:"current"}])}},74812:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>i,PageLoading:()=>g,Skeleton:()=>h,Spinner:()=>f,default:()=>j});var d=c(48249),e=c(71404);function f({size:a="md",className:b}){return(0,d.jsx)("span",{className:(0,e.cn)("material-symbols-outlined animate-spin text-brand-500",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[a],b),children:"progress_activity"})}function g({message:a="Loading..."}){return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,d.jsx)(f,{size:"xl"}),(0,d.jsx)("p",{className:"mt-4 text-text-muted",children:a})]})}function h({className:a,...b}){return(0,d.jsx)("div",{className:(0,e.cn)("animate-pulse rounded-[10px] bg-surface-2",a),...b})}function i(){return(0,d.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)(h,{className:"h-4 w-24"}),(0,d.jsx)(h,{className:"size-10 rounded-[10px]"})]}),(0,d.jsx)(h,{className:"h-8 w-16 mb-2"}),(0,d.jsx)(h,{className:"h-3 w-20"})]})}function j({type:a="spinner",...b}){switch(a){case"page":return(0,d.jsx)(g,{...b});case"skeleton":return(0,d.jsx)(h,{...b});case"card":return(0,d.jsx)(i,{...b});default:return(0,d.jsx)(f,{...b})}}},75171:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={default:"bg-surface-2 text-text-muted",primary:"bg-brand-500/10 text-brand-600 dark:text-brand-300",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},g={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function h({children:a,variant:b="default",size:c="md",dot:i=!1,icon:j,className:k}){return(0,d.jsxs)("span",{className:(0,e.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",f[b],g[c],k),children:[i&&(0,d.jsx)("span",{className:(0,e.cn)("size-1.5 rounded-full","success"===b&&"bg-green-500","warning"===b&&"bg-yellow-500","error"===b&&"bg-red-500","info"===b&&"bg-blue-500","primary"===b&&"bg-brand-500","default"===b&&"bg-gray-500")}),j&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:j}),a]})}},79346:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g,oauthMeta:k,idcConfig:l}){let[m,n]=(0,e.useState)("waiting"),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=(0,e.useRef)(!1),{copied:C,copy:D}=(0,i.C)(),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let I=(0,e.useCallback)(async(a,c)=>{if(o)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:o.redirectUri,codeVerifier:o.codeVerifier,state:c,...k?{meta:k}:{}})}),e=await d.json();if(!d.ok)throw Error(e.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,b,f]),J=(0,e.useCallback)(async a=>{if(o?.state)try{let b=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,state:o.state})}),c=await b.json();if(!b.ok)throw Error(c.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,f]),K=(0,e.useCallback)(async(a,c,d,e)=>{B.current=!1,z(!0);for(let g=0;g<60;g++){if(B.current){console.log("[OAuthModal] Polling aborted"),z(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),B.current){console.log("[OAuthModal] Polling aborted after sleep"),z(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){B.current=!0,n("success"),z(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){t(a.message),n("error"),z(!1);return}}t("Authorization timeout"),n("error"),z(!1)},[b,f]),L=(0,e.useCallback)(async()=>{if(b)try{let a;if(t(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy"].includes(b)){v(!0),n("waiting");let a=new URL(`/api/oauth/${b}/device-code`,window.location.origin);"kiro"===b&&l?.startUrl&&(a.searchParams.set("start_url",l.startUrl),l.region&&a.searchParams.set("region",l.region),a.searchParams.set("auth_method","idc"));let c=await fetch(a.toString()),d=await c.json();if(!c.ok)throw Error(d.error);x(d);let e=d.verification_uri_complete||d.verification_uri;e&&window.open(e,"_blank","noopener,noreferrer");let f="kiro"===b?{_clientId:d._clientId,_clientSecret:d._clientSecret,_region:d._region,_authMethod:d._authMethod,_startUrl:d._startUrl}:null;K(d.device_code,d.codeVerifier,d.interval||5,f);return}let c=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===b?"http://localhost:1455/auth/callback":"xai"===b?"http://127.0.0.1:56121/callback":`http://localhost:${c}/callback`;let d=new URL(`/api/oauth/${b}/authorize`,window.location.origin);d.searchParams.set("redirect_uri",a),k&&Object.entries(k).forEach(([a,b])=>{b&&d.searchParams.set(a,b)});let e=await fetch(d.toString()),f=await e.json();if(!e.ok)throw Error(f.error);let g=!1,h=!1;if("codex"===b)try{let b=new URL("/api/oauth/codex/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();g=e.success,h=!!e.serverSide}catch{g=!1}let i=!1,j=!1;if("xai"===b)try{let b=new URL("/api/oauth/xai/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();if(i=e.success,j=!!e.serverSide,!i&&"port_busy"===e.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(a){if(a?.message)throw a;i=!1}p({...f,redirectUri:a,codexServerSide:h,xaiServerSide:j}),"codex"===b&&g||"xai"===b&&i||E&&"codex"!==b&&"xai"!==b?(n("waiting"),A.current=window.open(f.authUrl,"oauth_popup","width=600,height=700"),A.current||n("input")):(n("input"),window.open(f.authUrl,"_blank"))}catch(a){t(a.message),n("error")}},[b,E,K,k,l]),M=async()=>{try{t(null);let a=q.trim();if(a.startsWith("eyJ")&&a.includes("."))return void await I(a,null);if("xai"===b&&a&&!a.includes("://")&&!a.includes("?")&&!a.includes("code="))return void await J(a);let c=new URL(a),d=c.searchParams.get("code"),e=c.searchParams.get("state"),f=c.searchParams.get("error");if(f)throw Error(c.searchParams.get("error_description")||f);if(!d)throw Error("xai"===b?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await I(d,e)}catch(a){t(a.message),n("error")}},N=(0,e.useCallback)(()=>{"codex"===b?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===b&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),g()},[g,b]);if(!b||!c)return null;let O="xai"===b,P=w?.verification_uri_complete||w?.verification_uri||"",Q=O?"Connect Grok Build OAuth":`Connect ${c.name}`;return(0,d.jsx)(h.aF,{isOpen:a,title:Q,onClose:N,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===m||"input"===m)&&!u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{className:"text-sm",children:O?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,d.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,d.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",O?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:o?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>D(o?.authUrl,"auth_url"),disabled:!o?.authUrl,children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===b?"callback URL or copied code":"callback URL"," here"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===b?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:q,onChange:a=>r(a.target.value),placeholder:O?"http://127.0.0.1:56121/callback?code=... or copied code":G,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:M,fullWidth:!0,disabled:!q,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===m&&u&&w&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"login_url"===C?"check":"content_copy",onClick:()=>D(P,"login_url"),disabled:!P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(P,"_blank","noopener,noreferrer"),disabled:!P,children:"Open"})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:w.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>D(w.user_code,"user_code")})]})]})]}),y&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:N,fullWidth:!0,children:"Done"})]}),"error"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:s}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired,oauthMeta:g().object,idcConfig:g().shape({startUrl:g().string,region:g().string})}},79488:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),p=async()=>{if(!f.trim())return void m("Please paste your cookie");k(!0),m(null);try{let a=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:f.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Authentication failed");o(!0),setTimeout(()=>{b?.(),q()},1500)}catch(a){m(a.message)}finally{k(!1)}},q=()=>{g(""),m(null),o(!1),c?.()};return(0,d.jsx)(h.aF,{isOpen:a,onClose:q,title:"iFlow Cookie Authentication",children:(0,d.jsx)("div",{className:"space-y-4",children:n?(0,d.jsxs)("div",{className:"text-center py-8",children:[(0,d.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,d.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,d.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,d.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,d.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,d.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,d.jsx)("li",{children:"Login to your account"}),(0,d.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,d.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,d.jsx)("li",{children:"Paste it below"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:j})]}),l&&(0,d.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,d.jsx)("p",{className:"text-sm text-error",children:l})}),(0,d.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:q,disabled:j,fullWidth:!0,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:p,loading:j,fullWidth:!0,children:"Authenticate"})]})]})})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func}},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\IFlowCookieModal.js","default")},81923:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ProviderInfoCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ProviderInfoCard.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroAuthModal.js","default")},83352:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(72738),i=c(91431),j=c(96919);let k=[...Object.keys(j.zN),...Object.keys(j.IS),...Object.keys(j.nJ),...Object.keys(j.fg)],l=Object.keys(j.IS).filter(a=>j.IS[a].noAuth);function m({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:n=[],title:o="Select Model",modelAliases:p={},kindFilter:q=null,addedModelValues:r=[],closeOnSelect:s=!0}){let t=(0,e.useMemo)(()=>q?n.filter(a=>{let b=j.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(q)}):n,[n,q]),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)([]),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)({}),E=(0,e.useMemo)(()=>({...j.zN,...j.IS,...j.nJ,...j.fg}),[]),F=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...t.map(a=>a.provider),...q?l.filter(a=>(j.Q2[a]?.serviceKinds||["llm"]).includes(q)):l])].sort((a,b)=>{let c=k.indexOf(a),d=k.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,j.wG)(e),g=E[e]||{name:e,color:"#666"},h=(0,j.mq)(e)||(0,j.gb)(e);if(q&&b.has(q)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(p).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b}));if(q&&c.has(q)&&0===(b=(0,i.KC)(e).filter(a=>a.type===q).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type}))).length&&d.has(q)&&(g.serviceKinds||["llm"]).includes(q)&&(b=[{id:e,name:g.name,value:f}]),b.length>0){let c=y.find(a=>a.id===e),d=c?.name||g.name;a[e]={name:d,alias:f,color:g.color,models:b}}}else if(h){if(q&&c.has(q))return;let b=n.find(a=>a.provider===e),d=y.find(a=>a.id===e),f=b?.name||d?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(p).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:j,isCustom:!0,hasModels:i.length>0}}else{var k;let b=(0,i.KC)(e),h=new Set(b.map(a=>a.id)),j=b.length>0,l=Object.entries(p).filter(([a,b])=>b.startsWith(`${f}/`)&&(!j||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=A.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type})),...l,...n],r=new Set,s=(k=o.filter(a=>!r.has(a.value)&&(r.add(a.value),!0)),q?c.has(q)?k.filter(a=>a.isPlaceholder||a.type===q):k:k.filter(a=>a.isPlaceholder||!a.type||"llm"===a.type));0===s.length&&q&&d.has(q)&&(g.serviceKinds||["llm"]).includes(q)&&(s=[{id:e,name:g.name,value:f}]),s.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:s})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...C[(0,j.wG)(b)]||[],...C[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[t,p,E,y,A,C,q,n]),G=(0,e.useMemo)(()=>{if(q)return[];if(!u.trim())return w;let a=u.toLowerCase();return w.filter(b=>[b.name,b.value,b.exposedModel,b.internalName,b.description,b.pickerType].map(a=>String(a||"").toLowerCase()).some(b=>b.includes(a)))},[w,u,q]),H=(0,e.useMemo)(()=>{let a=u.trim().toLowerCase(),b={};return Object.entries(F).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>r.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!r.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[F,u,r]),I=a=>{let d=a?.value||a?.name||a;r.includes(d)&&f?f(a):c(a),s&&(b(),v(""))},J=()=>{b(),v("")};return a?(0,d.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/65 p-4 backdrop-blur-sm",onMouseDown:a=>{a.target===a.currentTarget&&J()},role:"dialog","aria-modal":"true","aria-label":o,children:(0,d.jsxs)("div",{className:"flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",onMouseDown:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-border px-4 py-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"truncate text-base font-semibold text-text-main",children:o}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Click to add models to the combo. Click an added item again to remove it."})]}),(0,d.jsx)("button",{type:"button",onClick:J,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface hover:text-text-main","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden bg-white p-4 dark:bg-zinc-950",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:a=>v(a.target.value),className:"w-full rounded-xl border border-border bg-white py-2 pl-9 pr-3 text-sm text-text-main shadow-sm outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 dark:bg-zinc-900"})]})}),(0,d.jsxs)("div",{className:"max-h-[58vh] overflow-y-auto space-y-3 pr-1",children:[G.length>0&&(0,d.jsxs)("div",{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",G.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:G.map(a=>{let b=a.value||a.exposedModel||a.model||a.name||a.id,c=a.name||b,e=r.includes(b),f=g===b;return(0,d.jsxs)("button",{onClick:()=>I({id:b,name:c,value:b,combo:a}),className:`
|
|
2
2
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
|
|
3
3
|
${f?"bg-primary text-white border-primary":e?"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"}
|
|
4
4
|
`,title:a.internalName&&a.internalName!==b?`Internal: ${a.internalName}`:b,children:[e&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),(0,d.jsx)("span",{children:c}),a.isOllamaLocalCombo&&(0,d.jsx)("span",{className:`rounded-full px-1.5 py-0.5 text-[9px] ${f||e?"bg-white/20 text-white":"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"}`,children:"ollama"})]},`${a.pickerSource||"combo"}-${a.id||b}`)})})]}),Object.entries(H).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.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,d.jsx)(h.A,{src:(0,j.mq)(a)||(0,j.gb)(a)?null:`/providers/${a}.png`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=g===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>I(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|