vansrouter 0.7.8 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/react-loadable-manifest.json +4 -4
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +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 +4 -4
- 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 +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +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 +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.js +5 -5
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +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.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +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.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +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 +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +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/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +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/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +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.js.nft.json +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 +2 -2
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +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 +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- 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 +2 -2
- package/app/.next-cli-build/server/app/api/auth/check/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/reset-password/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 +4 -4
- 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 +2 -2
- 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/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- 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-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
- 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/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +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/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/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/locale/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 +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/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/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 +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/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +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 +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/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +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/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +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/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +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 +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 +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/kilo/free-models/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/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +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 +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/proxy-test/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 +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/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/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/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/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 +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 +3 -3
- 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/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +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/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +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/[id]/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 +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 +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 +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/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +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 +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 +2 -2
- 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/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +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 +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/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +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 +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 +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 +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 +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 +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 +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 +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/route.js.nft.json +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.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.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 +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- 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 +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
- 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 +8 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- 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 +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
- 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 +7 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +2 -2
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +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 +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +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 +6 -6
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page.js +1 -1
- package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
- package/app/.next-cli-build/server/chunks/1253.js +1 -1
- package/app/.next-cli-build/server/chunks/1536.js +1 -1
- package/app/.next-cli-build/server/chunks/2365.js +1 -1
- package/app/.next-cli-build/server/chunks/2554.js +4 -4
- package/app/.next-cli-build/server/chunks/2557.js +1 -1
- package/app/.next-cli-build/server/chunks/3424.js +1 -1
- package/app/.next-cli-build/server/chunks/383.js +1 -1
- package/app/.next-cli-build/server/chunks/4004.js +1 -1
- package/app/.next-cli-build/server/chunks/4029.js +1 -1
- package/app/.next-cli-build/server/chunks/403.js +1 -1
- package/app/.next-cli-build/server/chunks/404.js +1 -0
- package/app/.next-cli-build/server/chunks/4105.js +1 -1
- package/app/.next-cli-build/server/chunks/4418.js +1 -1
- package/app/.next-cli-build/server/chunks/4544.js +1 -1
- package/app/.next-cli-build/server/chunks/4574.js +2 -2
- package/app/.next-cli-build/server/chunks/5006.js +2 -2
- package/app/.next-cli-build/server/chunks/5204.js +4 -4
- package/app/.next-cli-build/server/chunks/5577.js +1 -1
- package/app/.next-cli-build/server/chunks/5598.js +1 -1
- package/app/.next-cli-build/server/chunks/6159.js +1 -1
- package/app/.next-cli-build/server/chunks/6723.js +1 -1
- package/app/.next-cli-build/server/chunks/6850.js +1 -0
- package/app/.next-cli-build/server/chunks/7916.js +1 -1
- package/app/.next-cli-build/server/chunks/818.js +1 -1
- package/app/.next-cli-build/server/chunks/8711.js +1 -1
- package/app/.next-cli-build/server/chunks/9294.js +9 -0
- package/app/.next-cli-build/server/chunks/9614.js +1 -1
- package/app/.next-cli-build/server/chunks/9984.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-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/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1049.3def0dd7804a4e6e.js → 1049.fe7b80c5fc82d475.js} +1 -1
- package/app/.next-cli-build/static/chunks/3700-6d19ded215c07e78.js +23 -0
- package/app/.next-cli-build/static/chunks/4385-3e455409e9263c2e.js +1 -0
- package/app/.next-cli-build/static/chunks/497-a4efc19d4e6d5742.js +1 -0
- package/app/.next-cli-build/static/chunks/5316-26a9be2b5b340adb.js +31 -0
- package/app/.next-cli-build/static/chunks/5737-d18fc416e283bc11.js +1 -0
- package/app/.next-cli-build/static/chunks/{9078.7b8723a1eed306a9.js → 9078.a9009d83d98ff33c.js} +2 -2
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-33b2a2889f8a6c95.js → page-13a7a53439c201d2.js} +4 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-91b12eb7fe88deb4.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-9caaf0fd0cbd7132.js +4 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-6544624e09f8231b.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-8af6425bd1f2dff0.js → page-794575f7237c2fd7.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-bb2e059c3f3dc49d.js → page-915b307dffadd9e1.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-9b704f6f5e9d5617.js +1 -0
- package/app/.next-cli-build/static/chunks/app/landing/page-6c0d2c845c953827.js +1 -0
- package/app/.next-cli-build/static/chunks/webpack-213376c75275a9d9.js +1 -0
- package/app/.next-cli-build/static/css/beef0e694f607395.css +1 -0
- package/app/package.json +1 -1
- package/app/public/providers/agentrouter.webp +0 -0
- package/app/public/providers/alicode-intl.webp +0 -0
- package/app/public/providers/alicode.webp +0 -0
- package/app/public/providers/amp.webp +0 -0
- package/app/public/providers/anthropic-m.webp +0 -0
- package/app/public/providers/anthropic.webp +0 -0
- package/app/public/providers/antigravity.webp +0 -0
- package/app/public/providers/assemblyai.webp +0 -0
- package/app/public/providers/aws-polly.webp +0 -0
- package/app/public/providers/azure.webp +0 -0
- package/app/public/providers/black-forest-labs.webp +0 -0
- package/app/public/providers/blackbox.webp +0 -0
- package/app/public/providers/brave-search.webp +0 -0
- package/app/public/providers/byteplus.webp +0 -0
- package/app/public/providers/cartesia.webp +0 -0
- package/app/public/providers/cerebras.webp +0 -0
- package/app/public/providers/chutes.webp +0 -0
- package/app/public/providers/claude.webp +0 -0
- package/app/public/providers/cline.webp +0 -0
- package/app/public/providers/cloudflare-ai.webp +0 -0
- package/app/public/providers/codebuddy-cn.webp +0 -0
- package/app/public/providers/codex.webp +0 -0
- package/app/public/providers/cohere.webp +0 -0
- package/app/public/providers/comfyui.webp +0 -0
- package/app/public/providers/commandcode.webp +0 -0
- package/app/public/providers/continue.webp +0 -0
- package/app/public/providers/copilot.webp +0 -0
- package/app/public/providers/coqui.webp +0 -0
- package/app/public/providers/cursor.webp +0 -0
- package/app/public/providers/deepgram.webp +0 -0
- package/app/public/providers/deepseek-tui.webp +0 -0
- package/app/public/providers/deepseek.webp +0 -0
- package/app/public/providers/droid.webp +0 -0
- package/app/public/providers/edge-tts.webp +0 -0
- package/app/public/providers/elevenlabs.webp +0 -0
- package/app/public/providers/exa.webp +0 -0
- package/app/public/providers/fal-ai.webp +0 -0
- package/app/public/providers/firecrawl.webp +0 -0
- package/app/public/providers/fireworks.webp +0 -0
- package/app/public/providers/gemini-cli.webp +0 -0
- package/app/public/providers/gemini.webp +0 -0
- package/app/public/providers/gigachat.webp +0 -0
- package/app/public/providers/github.webp +0 -0
- package/app/public/providers/glm-cn.webp +0 -0
- package/app/public/providers/glm.webp +0 -0
- package/app/public/providers/google-pse.webp +0 -0
- package/app/public/providers/google-tts.webp +0 -0
- package/app/public/providers/grok-web.webp +0 -0
- package/app/public/providers/groq.webp +0 -0
- package/app/public/providers/hermes.webp +0 -0
- package/app/public/providers/heroku.webp +0 -0
- package/app/public/providers/huggingface.webp +0 -0
- package/app/public/providers/hyperbolic.webp +0 -0
- package/app/public/providers/iflow.webp +0 -0
- package/app/public/providers/inworld.webp +0 -0
- package/app/public/providers/jcode.webp +0 -0
- package/app/public/providers/jina-ai.webp +0 -0
- package/app/public/providers/jina-reader.webp +0 -0
- package/app/public/providers/kilocode.webp +0 -0
- package/app/public/providers/kimchi.webp +0 -0
- package/app/public/providers/kimi-coding.webp +0 -0
- package/app/public/providers/kimi.webp +0 -0
- package/app/public/providers/kiro.webp +0 -0
- package/app/public/providers/linkup.webp +0 -0
- package/app/public/providers/llamagate.webp +0 -0
- package/app/public/providers/local-device.webp +0 -0
- package/app/public/providers/mimo-free.webp +0 -0
- package/app/public/providers/minimax-cn.webp +0 -0
- package/app/public/providers/minimax.webp +0 -0
- package/app/public/providers/mistral.webp +0 -0
- package/app/public/providers/nanobanana.webp +0 -0
- package/app/public/providers/nanogpt.webp +0 -0
- package/app/public/providers/nebius.webp +0 -0
- package/app/public/providers/nscale.webp +0 -0
- package/app/public/providers/nvidia.webp +0 -0
- package/app/public/providers/oai-cc.webp +0 -0
- package/app/public/providers/oai-r.webp +0 -0
- package/app/public/providers/ollama-local.webp +0 -0
- package/app/public/providers/ollama.webp +0 -0
- package/app/public/providers/openai.webp +0 -0
- package/app/public/providers/openclaw.webp +0 -0
- package/app/public/providers/opencode-go.webp +0 -0
- package/app/public/providers/opencode.webp +0 -0
- package/app/public/providers/openrouter.webp +0 -0
- package/app/public/providers/ovhcloud.webp +0 -0
- package/app/public/providers/perplexity-web.webp +0 -0
- package/app/public/providers/perplexity.webp +0 -0
- package/app/public/providers/playht.webp +0 -0
- package/app/public/providers/predibase.webp +0 -0
- package/app/public/providers/qoder.webp +0 -0
- package/app/public/providers/qwen.webp +0 -0
- package/app/public/providers/recraft.webp +0 -0
- package/app/public/providers/roo.webp +0 -0
- package/app/public/providers/runwayml.webp +0 -0
- package/app/public/providers/sdwebui.webp +0 -0
- package/app/public/providers/searchapi.webp +0 -0
- package/app/public/providers/searxng.webp +0 -0
- package/app/public/providers/serper.webp +0 -0
- package/app/public/providers/siliconflow.webp +0 -0
- package/app/public/providers/stability-ai.webp +0 -0
- package/app/public/providers/tavily.webp +0 -0
- package/app/public/providers/together.webp +0 -0
- package/app/public/providers/topaz.webp +0 -0
- package/app/public/providers/tortoise.webp +0 -0
- package/app/public/providers/vertex-partner.webp +0 -0
- package/app/public/providers/vertex.webp +0 -0
- package/app/public/providers/volcengine-ark.webp +0 -0
- package/app/public/providers/voyage-ai.webp +0 -0
- package/app/public/providers/xai.webp +0 -0
- package/app/public/providers/xiaomi-mimo.webp +0 -0
- package/app/public/providers/xiaomi-tokenplan.webp +0 -0
- package/app/public/providers/youcom.webp +0 -0
- package/app/public/providers/zcode.webp +0 -0
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/3133.js +0 -1
- package/app/.next-cli-build/server/chunks/5290.js +0 -1
- package/app/.next-cli-build/server/chunks/6955.js +0 -9
- package/app/.next-cli-build/static/chunks/3700-507d735bbeafc1f1.js +0 -23
- package/app/.next-cli-build/static/chunks/4385-e7386da5593047d9.js +0 -1
- package/app/.next-cli-build/static/chunks/497-e70e37c356d2ad24.js +0 -1
- package/app/.next-cli-build/static/chunks/5316-fff7784e40086b07.js +0 -31
- package/app/.next-cli-build/static/chunks/5737-db655a51294730ae.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-bbef1a0c34a9ee9e.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-a10e1f3c70f5ab7f.js +0 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-6aa26f4fba64b6d2.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-24d2ff6ef38b5076.js +0 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-29ecb0d5c302e58c.js +0 -1
- package/app/.next-cli-build/static/chunks/webpack-79b65541449c3a45.js +0 -1
- package/app/.next-cli-build/static/css/1fc10f069b479895.css +0 -1
- package/app/public/providers/agentrouter.png +0 -0
- package/app/public/providers/alicode-intl.png +0 -0
- package/app/public/providers/alicode.png +0 -0
- package/app/public/providers/amp.png +0 -0
- package/app/public/providers/anthropic-m.png +0 -0
- package/app/public/providers/anthropic.png +0 -0
- package/app/public/providers/antigravity.png +0 -0
- package/app/public/providers/assemblyai.png +0 -0
- package/app/public/providers/aws-polly.png +0 -0
- package/app/public/providers/azure.png +0 -0
- package/app/public/providers/black-forest-labs.png +0 -0
- package/app/public/providers/blackbox.png +0 -0
- package/app/public/providers/brave-search.png +0 -0
- package/app/public/providers/byteplus.png +0 -0
- package/app/public/providers/cartesia.png +0 -0
- package/app/public/providers/cerebras.png +0 -0
- package/app/public/providers/chutes.png +0 -0
- package/app/public/providers/claude.png +0 -0
- package/app/public/providers/cline.png +0 -0
- package/app/public/providers/cloudflare-ai.png +0 -0
- package/app/public/providers/codebuddy-cn.png +0 -0
- package/app/public/providers/codex.png +0 -0
- package/app/public/providers/cohere.png +0 -0
- package/app/public/providers/comfyui.png +0 -0
- package/app/public/providers/commandcode.png +0 -0
- package/app/public/providers/continue.png +0 -0
- package/app/public/providers/copilot.png +0 -0
- package/app/public/providers/coqui.png +0 -0
- package/app/public/providers/cursor.png +0 -0
- package/app/public/providers/deepgram.png +0 -0
- package/app/public/providers/deepseek-tui.png +0 -0
- package/app/public/providers/deepseek.png +0 -0
- package/app/public/providers/droid.png +0 -0
- package/app/public/providers/edge-tts.png +0 -0
- package/app/public/providers/elevenlabs.png +0 -0
- package/app/public/providers/exa.png +0 -0
- package/app/public/providers/fal-ai.png +0 -0
- package/app/public/providers/firecrawl.png +0 -0
- package/app/public/providers/fireworks.png +0 -0
- package/app/public/providers/gemini-cli.png +0 -0
- package/app/public/providers/gemini.png +0 -0
- package/app/public/providers/github.png +0 -0
- package/app/public/providers/glm-cn.png +0 -0
- package/app/public/providers/glm.png +0 -0
- package/app/public/providers/google-pse.png +0 -0
- package/app/public/providers/google-tts.png +0 -0
- package/app/public/providers/grok-web.png +0 -0
- package/app/public/providers/groq.png +0 -0
- package/app/public/providers/hermes.png +0 -0
- package/app/public/providers/huggingface.png +0 -0
- package/app/public/providers/hyperbolic.png +0 -0
- package/app/public/providers/iflow.png +0 -0
- package/app/public/providers/inworld.png +0 -0
- package/app/public/providers/jcode.png +0 -0
- package/app/public/providers/jina-ai.png +0 -0
- package/app/public/providers/jina-reader.png +0 -0
- package/app/public/providers/kilocode.png +0 -0
- package/app/public/providers/kimchi.png +0 -0
- package/app/public/providers/kimi-coding.png +0 -0
- package/app/public/providers/kimi.png +0 -0
- package/app/public/providers/kiro.png +0 -0
- package/app/public/providers/linkup.png +0 -0
- package/app/public/providers/local-device.png +0 -0
- package/app/public/providers/mimo-free.png +0 -0
- package/app/public/providers/minimax-cn.png +0 -0
- package/app/public/providers/minimax.png +0 -0
- package/app/public/providers/mistral.png +0 -0
- package/app/public/providers/nanobanana.png +0 -0
- package/app/public/providers/nebius.png +0 -0
- package/app/public/providers/nvidia.png +0 -0
- package/app/public/providers/oai-cc.png +0 -0
- package/app/public/providers/oai-r.png +0 -0
- package/app/public/providers/ollama-local.png +0 -0
- package/app/public/providers/ollama.png +0 -0
- package/app/public/providers/openai.png +0 -0
- package/app/public/providers/openclaw.png +0 -0
- package/app/public/providers/opencode-go.png +0 -0
- package/app/public/providers/opencode.png +0 -0
- package/app/public/providers/openrouter.png +0 -0
- package/app/public/providers/perplexity-web.png +0 -0
- package/app/public/providers/perplexity.png +0 -0
- package/app/public/providers/playht.png +0 -0
- package/app/public/providers/qoder.png +0 -0
- package/app/public/providers/qwen.png +0 -0
- package/app/public/providers/recraft.png +0 -0
- package/app/public/providers/roo.png +0 -0
- package/app/public/providers/runwayml.png +0 -0
- package/app/public/providers/sdwebui.png +0 -0
- package/app/public/providers/searchapi.png +0 -0
- package/app/public/providers/searxng.png +0 -0
- package/app/public/providers/serper.png +0 -0
- package/app/public/providers/siliconflow.png +0 -0
- package/app/public/providers/stability-ai.png +0 -0
- package/app/public/providers/tavily.png +0 -0
- package/app/public/providers/together.png +0 -0
- package/app/public/providers/topaz.png +0 -0
- package/app/public/providers/tortoise.png +0 -0
- package/app/public/providers/vertex-partner.png +0 -0
- package/app/public/providers/vertex.png +0 -0
- package/app/public/providers/volcengine-ark.png +0 -0
- package/app/public/providers/voyage-ai.png +0 -0
- package/app/public/providers/xai.png +0 -0
- package/app/public/providers/xiaomi-mimo.png +0 -0
- package/app/public/providers/xiaomi-tokenplan.png +0 -0
- package/app/public/providers/youcom.png +0 -0
- package/app/public/providers/zcode.png +0 -0
- /package/app/.next-cli-build/static/{GKLmZnKWr8SmNlRLjgypS → s3-GQm3AGLpboXygnZn-r}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{GKLmZnKWr8SmNlRLjgypS → s3-GQm3AGLpboXygnZn-r}/_ssgManifest.js +0 -0
|
@@ -7,4 +7,4 @@ sk-key-only-auto-named`;function C({cloudflareData:e,setCloudflareData:t}){retur
|
|
|
7
7
|
"idToken": "eyJhbGc...",
|
|
8
8
|
"email": "user@example.com"
|
|
9
9
|
}
|
|
10
|
-
]`;function P({isOpen:e,onClose:t,onSuccess:a}){let[i,o]=(0,l.useState)(""),[r,n]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[p,x]=(0,l.useState)(null),h=()=>{r||(o(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let s=i.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void m((0,u.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:l})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{n(!1)}},y=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:i,onChange:e=>o(e.target.value),disabled:r}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),y.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:y.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:f,fullWidth:!0,disabled:r||!i.trim(),children:r?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,u.Tl)("Close")})]})]})})}function D(){let e,t=(0,i.useParams)(),a=(0,i.useRouter)(),o=t.id,{getCaps:h}=(0,x.y)(),[b,j]=(0,l.useState)([]),[w,k]=(0,l.useState)(!0),[C,S]=(0,l.useState)(null),[T,E]=(0,l.useState)([]),[O,D]=(0,l.useState)(!1),[_,U]=(0,l.useState)(!1),[z,B]=(0,l.useState)(!1),[M,R]=(0,l.useState)(""),[K,L]=(0,l.useState)(!1),[J,F]=(0,l.useState)(!1),[W,q]=(0,l.useState)(!1),[V,H]=(0,l.useState)(!1),[G,Q]=(0,l.useState)(null),[X,Y]=(0,l.useState)({}),[Z,ee]=(0,l.useState)([]),[et,ea]=(0,l.useState)(!1),[es,el]=(0,l.useState)({}),[ei,eo]=(0,l.useState)(""),[er,en]=(0,l.useState)(()=>new Set),[ed,ec]=(0,l.useState)(!1),[em,ep]=(0,l.useState)([]),[ex,eu]=(0,l.useState)("__none__"),[eh,ef]=(0,l.useState)(!1),[ey,eg]=(0,l.useState)(null),[eb,ev]=(0,l.useState)(""),[ej,ew]=(0,l.useState)("auto"),[eN,ek]=(0,l.useState)({enabled:!1,connections:{}}),[eC,eS]=(0,l.useState)([]),[eA,eT]=(0,l.useState)([]),[e$,eE]=(0,l.useState)([]),[eI,eO]=(0,l.useState)(null),[eP,eD]=(0,l.useState)(!1),[e_,eU]=(0,l.useState)(!1),[ez,eB]=(0,l.useState)(!1),[eM,eR]=(0,l.useState)(null),[eK,eL]=(0,l.useState)({}),[eJ,eF]=(0,l.useState)(null),eW=(0,l.useRef)(!1),[eq,eV]=(0,l.useState)(!1),{copied:eH,copy:eG}=(0,p.C)(),eQ="ag_risk_confirmed",eX=()=>{D(!0)},eY=()=>{"antigravity"===o&&"true"!==window.localStorage.getItem(eQ)?eD(!0):e5?eX():(R(""),B(!0))},eZ=()=>{R(""),B(!0)},e0=()=>{e5?eY():eZ()},e1=C?{id:C.id,name:C.name||("anthropic-compatible"===C.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===C.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===C.type?"AC":"OC",apiType:C.apiType,baseUrl:C.baseUrl,type:C.type}:c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o]||c.br[o],e2=e1?.authModes||[],e5=!!c.zN[o]||!!c.IS[o]||e2.includes("oauth"),e3=!!c.fg[o]||e2.includes("apikey"),e4=!!c.IS[o]?.noAuth,e8=(0,m.KC)(o),e6=(0,c.wG)(o),e7=(0,c.mq)(o),e9=(0,c.gb)(o),te=e7||e9,tt=!te&&e5&&e3,ta="xai"===o?"Grok Build OAuth":"OAuth",ts="xai"===o?"xAI API Key":"API Key";c.Q2[o]?.thinkingConfig||c.s9.extended;let tl=te?o:e6,ti=te?C?.prefix||o:e6,to=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}`,{cache:"no-store"}),t=await e.json();e.ok&&eE(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tl]),tr=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tl,ids:[e]})})).ok&&await to()}catch(e){console.log("Error disabling model:",e)}},tn=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling model:",e)}},td=async e=>{e.length&&eO({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eO(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tl,ids:e})})).ok&&await to()}catch(e){console.log("Error disabling all models:",e)}}})},tc=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling all models:",e)}},tm=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Y(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tp=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ee(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===o&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eT(e.models)}).catch(()=>{})},[o]);let tx=(0,l.useCallback)(async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await e.json(),i=await t.json(),r=await a.json(),n=s.ok?await s.json():{};if(e.ok){let e=(l.connections||[]).filter(e=>e.provider===o);j(e)}a.ok&&E(r.proxyPools||[]);let d=(n.providerStrategies||{})[o]||{};eg(d.fallbackStrategy||null),ev(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[o]||{};ew(c.mode||"auto");let m=n.claudeAutoPing||{};if(ek({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(i.nodes||[]).find(e=>e.id===o)||null;if(!e&&te)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===o)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{k(!1)}},[o,te]),tu=async e=>{try{let t=await fetch(`/api/provider-nodes/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(S(a.node),await tx(),q(!1))}catch(e){console.log("Error updating provider node:",e)}},th=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},l={};e&&(l.fallbackStrategy=e),"round-robin"===e&&""!==t&&(l.stickyRoundRobinLimit=Number(t)||3);let i={...s};0===Object.keys(l).length?delete i[o]:i[o]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("Error saving provider strategy:",e)}},tf=async e=>{ek(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,l.useEffect)(()=>{tx(),tm(),tp(),to()},[tx,tm,tp,to]),(0,l.useEffect)(()=>{let e=(c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o])?.modelsFetcher;e&&f(e).then(eS)},[o]);let ty=async(e,t,a=e6)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tm();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tg=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tm()}catch(e){console.log("Error deleting alias:",e)}},tb=async(e,t="llm",a=tl)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await tp(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tv=async(e,t="llm",a=tl)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await tp(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tj=async()=>{if(eq)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eV(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,u.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,u.Tl)("No models returned"));let l=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");Z.some(e=>e.providerAlias===tl&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(X).includes(`${tl}/${a}`)||(await tb(a,"llm",tl),l+=1)}0===l?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${l} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eV(!1)}},tw=async()=>{if(e_||0===b.length)return;let e=Object.fromEntries(b.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,eU(!0),eB(!1),eR(null),eL(e),eF({total:b.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<b.length;e+=1){if(eW.current){eF({total:b.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=b[e];eR(s.id),eL(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),l=await e.json(),i=!!l.valid;i?t+=1:a+=1,eL(e=>({...e,[s.id]:{state:i?"success":"failed",error:i?null:l.error||null}}))}catch(e){a+=1,eL(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}eF({total:b.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<b.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eR(null),eU(!1),eB(!1),eW.current=!1}},tN=async e=>{eO({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eO(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&j(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tk=()=>{let e=em.length;0!==e&&eO({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eO(null);let e=0,t=[...em];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}j(e=>e.filter(e=>!t.includes(e.id))),ep([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},tC=()=>{tx(),D(!1)},tS=async e=>{R("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tx(),B(!1);return}R(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),R("Failed to save connection")}},tA=async e=>{try{(await fetch(`/api/providers/${G.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tx(),F(!1))}catch(e){console.log("Error updating connection:",e)}},tT=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&j(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},t$=async(e,t)=>{let a=[...b];[a[e],a[t]]=[a[t],a[e]],j(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tx()}},tE=b.filter(e=>em.includes(e.id)),tI=b.length>0&&em.length===b.length,tO=()=>{tI?ep([]):ep(b.map(e=>e.id))};(0,l.useEffect)(()=>{ep(e=>e.filter(e=>b.some(t=>t.id===e)))},[b]),(()=>{if(0===tE.length)return;let e=new Set(tE.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=T.find(e=>e.id===t);return a?.name}})();let tP=()=>{eh||H(!1)},tD=async e=>{ef(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:s}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:s})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tx(),H(!1)}finally{ef(!1)}},t_=e=>tD(b.map(t=>({connectionId:t.id,proxyPoolId:e}))),tU=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[b.length>1&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs text-text-muted",children:[(0,s.jsx)("input",{type:"checkbox",checked:tI,onChange:tO,className:"h-3.5 w-3.5 rounded border-border accent-primary"}),(0,s.jsx)("span",{children:em.length>0?`${em.length} selected`:"Select all"})]}),b.map((e,t)=>{let a;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,em.includes(a)),onChange:()=>{var t;return t=e.id,void ep(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(N,{connection:e,proxyPools:T,isOAuth:e5,isFirst:0===t,isLast:t===b.length-1,onMoveUp:()=>t$(t,t-1),onMoveDown:()=>t$(t,t+1),onToggleActive:t=>tT(e.id,t),autoPing:"claude"===o&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var a;return a=e.id,void tf({...eN,connections:{...eN.connections,[a]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&j(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Q(e),F(!0)},onDelete:()=>tN(e.id),oneByOneStatus:eK[e.id]||null})})]},e.id)})]}),tz=T.filter(e=>!0===e.isActive),tB=(0,s.jsx)(d.Modal,{isOpen:V,onClose:tP,title:`Apply Proxy (${b.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{onClick:()=>{let e=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tD(b.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:eh||0===tz.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,s.jsxs)("button",{onClick:()=>t_(null),disabled:eh,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),T.map(e=>(0,s.jsxs)("button",{onClick:()=>t_(e.id),disabled:eh||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,s.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eh&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(d.Button,{onClick:tP,variant:"ghost",fullWidth:!0,disabled:eh,children:"Cancel"})]})}),tM=async e=>{if(!er.has(e)){en(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tl}/${e}`})}),a=await t.json();el(t=>({...t,[e]:a.ok?"ok":"error"})),eo(a.ok?"":a.error||"Model not reachable")}catch{el(t=>({...t,[e]:"error"})),eo("Network error")}finally{en(t=>{let a=new Set(t);return a.delete(e),a})}}};return w?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):e1?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e1.color}15`},children:et?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:e1.color},children:e1.textIcon||e1.id.slice(0,2).toUpperCase()}):(0,s.jsx)(n.default,{src:e7&&e1.apiType?"responses"===e1.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":e9?"/providers/anthropic-m.png":`/providers/${e1.id}.png`,alt:e1.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ea(!0)})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e1.name}),(e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website)&&(0,s.jsxs)("a",{href:e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e1.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[b.length," connection",1===b.length?"":"s"]})]})]})]}),e1.deprecated&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e1.deprecationNotice})]}),e1.notice?.text&&!e1.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e1.notice.text}),e1.notice.apiKeyUrl&&(0,s.jsx)("a",{href:e1.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),te&&C&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:e9?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[e9?"Messages API":"responses"===C.apiType?"Responses API":"Chat Completions"," \xb7 ",(C.baseUrl||"").replace(/\/$/,""),"/",e9?"messages":"responses"===C.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{R(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>q(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eO({title:"Delete Compatible Node",message:`Delete this ${e9?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eO(null);try{(await fetch(`/api/provider-nodes/${o}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),e4?(0,s.jsx)(d.NoAuthProxyCard,{providerId:o}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[b.length>0&&T.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>H(!0),children:"Apply Proxy"}),b.length>1&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete_sweep",onClick:tk,disabled:0===em.length,children:["Delete",em.length>0?` (${em.length})`:""]}),b.length>0&&(0,s.jsxs)(s.Fragment,{children:[em.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:tk,children:["Delete Selected (",em.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tw,disabled:e_,children:e_?"Testing Connection One-by-One...":"Test Connection One-by-One"}),e_&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{e_&&(eW.current=!0,eB(!0))},disabled:ez,children:ez?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,a=e?eb||"1":eb;e&&!eb&&ev("1"),eg(t),th(t,a)}}),"round-robin"===ey&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:eb,onChange:e=>{var t;ev(t=e.target.value),th("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===b.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e5?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tt&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ta," or ",ts,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tt?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:eY,children:ta}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:eZ,children:ts})]}):(0,s.jsxs)(s.Fragment,{children:[!te&&"iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),children:(0,u.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e0,children:te?"Add API Key":"iflow"===o?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[eJ&&(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",eJ.total]}),(0,s.jsxs)("span",{children:["Completed: ",eJ.completed]}),(0,s.jsxs)("span",{children:["Passed: ",eJ.passed]}),(0,s.jsxs)("span",{children:["Failed: ",eJ.failed]}),eJ.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),e_&&eM&&(0,s.jsxs)("span",{children:["Running: ",b.find(e=>e.id===eM)?.name||eM]})]})}),b.length>0&&(0,s.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tI,onChange:tO,className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tU,!te&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tt?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:eY,className:"w-full sm:w-auto",children:ta}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:eZ,className:"w-full sm:w-auto",children:ts})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e0,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!te&&(e=[...e8,...eA.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e$.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[e$.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tc,children:"Active All"}),e.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>td(e),children:"Disable All"})]}))]}),!!ei&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ei}),(()=>{let e,t,a;if(te)return(0,s.jsx)(v,{providerStorageAlias:tl,providerDisplayAlias:ti,modelAliases:X,customModels:Z,copied:eH,onCopy:eG,onSetAlias:ty,onDeleteAlias:tg,onAddCustomModel:e=>tb(e,"llm",tl),onDeleteCustomModel:e=>tv(e,"llm",tl),connections:b,isAnthropic:e9});let l=[...e8,...eA.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),i=new Set(e$),r=l.filter(e=>!i.has(e.id)),n=l.filter(e=>i.has(e.id)),d=y({customModels:Z,modelAliases:X,providerAlias:tl,builtInModels:e8,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,s.jsx)(g,{model:{id:e.id,name:e.name},fullModel:`${ti}/${e.id}`,alias:e.alias,copied:eH,onCopy:eG,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tv(e.id,"llm",tl):tg(e.alias)},testStatus:es[e.id],onTest:b.length>0||e4?()=>tM(e.id):void 0,isTesting:er.has(e.id),isCustom:!0,isFree:!1,caps:h(`${o}/${e.id}`)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tl}/${e.id}`,a=`${o}/${e.id}`,l=Object.entries(X).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(g,{model:e,fullModel:`${ti}/${e.id}`,alias:l,copied:eH,onCopy:eG,onSetAlias:t=>ty(e.id,t,tl),onDeleteAlias:()=>tg(l),testStatus:es[e.id],onTest:b.length>0||e4?()=>tM(e.id):void 0,isTesting:er.has(e.id),isFree:e.isFree,onDisable:()=>tr(e.id),caps:h(`${o}/${e.id}`)},e.id)}),(0,s.jsxs)("button",{onClick:()=>ec(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===o&&b.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:tj,disabled:eq,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:eq?{animation:"spin 1s linear infinite"}:void 0,children:eq?"progress_activity":"download"}),eq?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eC.length>0&&(e=new Set([...Object.values(X),...d.map(e=>e.fullModel)]),t=new Set(e8.map(e=>e.id)),0===(a=eC.filter(a=>!e.has(`${tl}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tb(e.id,"llm",tl)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,s.jsxs)("button",{onClick:()=>tn(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tB,"kiro"===o?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:O,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}):"cursor"===o?(0,s.jsx)(d.CursorAuthModal,{isOpen:O,onSuccess:tC,onClose:()=>D(!1)}):"gitlab"===o?(0,s.jsx)(d.GitLabAuthModal,{isOpen:O,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:O,provider:o,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}),"iflow"===o&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:_,onSuccess:()=>{tx(),U(!1)},onClose:()=>U(!1)}),(0,s.jsx)(A,{isOpen:z,provider:o,providerName:e1.name,isCompatible:te,isAnthropic:e9,authType:e1?.authType,authHint:e1?.authHint,website:e1?.website,proxyPools:T,error:M,onSave:tS,onBulkDone:tx,onClose:()=>{R(""),B(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:J,connection:G,proxyPools:T,onSave:tA,onClose:()=>F(!1)}),te&&(0,s.jsx)($,{isOpen:W,node:C,onSave:tu,onClose:()=>q(!1),isAnthropic:e9}),!te&&(0,s.jsx)(I,{isOpen:ed,providerAlias:tl,providerDisplayAlias:ti,onSave:async e=>{await tb(e,"llm",tl),ec(!1)},onClose:()=>ec(!1)}),"codex"===o&&(0,s.jsx)(P,{isOpen:K,onClose:()=>L(!1),onSuccess:tx}),(0,s.jsx)(d.ConfirmModal,{isOpen:eP,onClose:()=>eD(!1),onConfirm:()=>{(window.localStorage.setItem(eQ,"true"),eD(!1),e5)?eX():eZ()},title:"Risk Notice",message:e1?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!eI,onClose:()=>eO(null),onConfirm:eI?.onConfirm,title:eI?.title||"Confirm",message:eI?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},8810:(e,t,a)=>{Promise.resolve().then(a.bind(a,5399))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,7236,5737,2147,3204,7358],()=>e(e.s=8810)),_N_E=e.O()}]);
|
|
10
|
+
]`;function P({isOpen:e,onClose:t,onSuccess:a}){let[i,o]=(0,l.useState)(""),[r,n]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[p,x]=(0,l.useState)(null),h=()=>{r||(o(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let s=i.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void m((0,u.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:l})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{n(!1)}},y=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:i,onChange:e=>o(e.target.value),disabled:r}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),y.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:y.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:f,fullWidth:!0,disabled:r||!i.trim(),children:r?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,u.Tl)("Close")})]})]})})}function D(){let e,t=(0,i.useParams)(),a=(0,i.useRouter)(),o=t.id,{getCaps:h}=(0,x.y)(),[b,j]=(0,l.useState)([]),[w,k]=(0,l.useState)(!0),[C,S]=(0,l.useState)(null),[T,E]=(0,l.useState)([]),[O,D]=(0,l.useState)(!1),[_,U]=(0,l.useState)(!1),[z,B]=(0,l.useState)(!1),[M,R]=(0,l.useState)(""),[K,L]=(0,l.useState)(!1),[J,F]=(0,l.useState)(!1),[W,q]=(0,l.useState)(!1),[V,H]=(0,l.useState)(!1),[G,Q]=(0,l.useState)(null),[X,Y]=(0,l.useState)({}),[Z,ee]=(0,l.useState)([]),[et,ea]=(0,l.useState)(!1),[es,el]=(0,l.useState)({}),[ei,eo]=(0,l.useState)(""),[er,en]=(0,l.useState)(()=>new Set),[ed,ec]=(0,l.useState)(!1),[em,ep]=(0,l.useState)([]),[ex,eu]=(0,l.useState)("__none__"),[eh,ef]=(0,l.useState)(!1),[ey,eg]=(0,l.useState)(null),[eb,ev]=(0,l.useState)(""),[ej,ew]=(0,l.useState)("auto"),[eN,ek]=(0,l.useState)({enabled:!1,connections:{}}),[eC,eS]=(0,l.useState)([]),[eA,eT]=(0,l.useState)([]),[e$,eE]=(0,l.useState)([]),[eI,eO]=(0,l.useState)(null),[eP,eD]=(0,l.useState)(!1),[e_,eU]=(0,l.useState)(!1),[ez,eB]=(0,l.useState)(!1),[eM,eR]=(0,l.useState)(null),[eK,eL]=(0,l.useState)({}),[eJ,eF]=(0,l.useState)(null),eW=(0,l.useRef)(!1),[eq,eV]=(0,l.useState)(!1),{copied:eH,copy:eG}=(0,p.C)(),eQ="ag_risk_confirmed",eX=()=>{D(!0)},eY=()=>{"antigravity"===o&&"true"!==window.localStorage.getItem(eQ)?eD(!0):e5?eX():(R(""),B(!0))},eZ=()=>{R(""),B(!0)},e0=()=>{e5?eY():eZ()},e1=C?{id:C.id,name:C.name||("anthropic-compatible"===C.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===C.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===C.type?"AC":"OC",apiType:C.apiType,baseUrl:C.baseUrl,type:C.type}:c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o]||c.br[o],e2=e1?.authModes||[],e5=!!c.zN[o]||!!c.IS[o]||e2.includes("oauth"),e3=!!c.fg[o]||e2.includes("apikey"),e4=!!c.IS[o]?.noAuth,e8=(0,m.KC)(o),e6=(0,c.wG)(o),e7=(0,c.mq)(o),e9=(0,c.gb)(o),te=e7||e9,tt=!te&&e5&&e3,ta="xai"===o?"Grok Build OAuth":"OAuth",ts="xai"===o?"xAI API Key":"API Key";c.Q2[o]?.thinkingConfig||c.s9.extended;let tl=te?o:e6,ti=te?C?.prefix||o:e6,to=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}`,{cache:"no-store"}),t=await e.json();e.ok&&eE(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tl]),tr=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tl,ids:[e]})})).ok&&await to()}catch(e){console.log("Error disabling model:",e)}},tn=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling model:",e)}},td=async e=>{e.length&&eO({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eO(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tl,ids:e})})).ok&&await to()}catch(e){console.log("Error disabling all models:",e)}}})},tc=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tl)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling all models:",e)}},tm=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Y(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tp=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ee(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===o&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eT(e.models)}).catch(()=>{})},[o]);let tx=(0,l.useCallback)(async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await e.json(),i=await t.json(),r=await a.json(),n=s.ok?await s.json():{};if(e.ok){let e=(l.connections||[]).filter(e=>e.provider===o);j(e)}a.ok&&E(r.proxyPools||[]);let d=(n.providerStrategies||{})[o]||{};eg(d.fallbackStrategy||null),ev(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[o]||{};ew(c.mode||"auto");let m=n.claudeAutoPing||{};if(ek({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(i.nodes||[]).find(e=>e.id===o)||null;if(!e&&te)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===o)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{k(!1)}},[o,te]),tu=async e=>{try{let t=await fetch(`/api/provider-nodes/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(S(a.node),await tx(),q(!1))}catch(e){console.log("Error updating provider node:",e)}},th=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},l={};e&&(l.fallbackStrategy=e),"round-robin"===e&&""!==t&&(l.stickyRoundRobinLimit=Number(t)||3);let i={...s};0===Object.keys(l).length?delete i[o]:i[o]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("Error saving provider strategy:",e)}},tf=async e=>{ek(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,l.useEffect)(()=>{tx(),tm(),tp(),to()},[tx,tm,tp,to]),(0,l.useEffect)(()=>{let e=(c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o])?.modelsFetcher;e&&f(e).then(eS)},[o]);let ty=async(e,t,a=e6)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tm();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tg=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tm()}catch(e){console.log("Error deleting alias:",e)}},tb=async(e,t="llm",a=tl)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await tp(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tv=async(e,t="llm",a=tl)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await tp(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tj=async()=>{if(eq)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eV(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,u.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,u.Tl)("No models returned"));let l=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");Z.some(e=>e.providerAlias===tl&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(X).includes(`${tl}/${a}`)||(await tb(a,"llm",tl),l+=1)}0===l?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${l} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eV(!1)}},tw=async()=>{if(e_||0===b.length)return;let e=Object.fromEntries(b.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,eU(!0),eB(!1),eR(null),eL(e),eF({total:b.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<b.length;e+=1){if(eW.current){eF({total:b.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=b[e];eR(s.id),eL(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),l=await e.json(),i=!!l.valid;i?t+=1:a+=1,eL(e=>({...e,[s.id]:{state:i?"success":"failed",error:i?null:l.error||null}}))}catch(e){a+=1,eL(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}eF({total:b.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<b.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eR(null),eU(!1),eB(!1),eW.current=!1}},tN=async e=>{eO({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eO(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&j(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tk=()=>{let e=em.length;0!==e&&eO({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eO(null);let e=0,t=[...em];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}j(e=>e.filter(e=>!t.includes(e.id))),ep([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},tC=()=>{tx(),D(!1)},tS=async e=>{R("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tx(),B(!1);return}R(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),R("Failed to save connection")}},tA=async e=>{try{(await fetch(`/api/providers/${G.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tx(),F(!1))}catch(e){console.log("Error updating connection:",e)}},tT=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&j(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},t$=async(e,t)=>{let a=[...b];[a[e],a[t]]=[a[t],a[e]],j(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tx()}},tE=b.filter(e=>em.includes(e.id)),tI=b.length>0&&em.length===b.length,tO=()=>{tI?ep([]):ep(b.map(e=>e.id))};(0,l.useEffect)(()=>{ep(e=>e.filter(e=>b.some(t=>t.id===e)))},[b]),(()=>{if(0===tE.length)return;let e=new Set(tE.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=T.find(e=>e.id===t);return a?.name}})();let tP=()=>{eh||H(!1)},tD=async e=>{ef(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:s}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:s})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tx(),H(!1)}finally{ef(!1)}},t_=e=>tD(b.map(t=>({connectionId:t.id,proxyPoolId:e}))),tU=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[b.length>1&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs text-text-muted",children:[(0,s.jsx)("input",{type:"checkbox",checked:tI,onChange:tO,className:"h-3.5 w-3.5 rounded border-border accent-primary"}),(0,s.jsx)("span",{children:em.length>0?`${em.length} selected`:"Select all"})]}),b.map((e,t)=>{let a;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,em.includes(a)),onChange:()=>{var t;return t=e.id,void ep(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(N,{connection:e,proxyPools:T,isOAuth:e5,isFirst:0===t,isLast:t===b.length-1,onMoveUp:()=>t$(t,t-1),onMoveDown:()=>t$(t,t+1),onToggleActive:t=>tT(e.id,t),autoPing:"claude"===o&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var a;return a=e.id,void tf({...eN,connections:{...eN.connections,[a]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&j(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Q(e),F(!0)},onDelete:()=>tN(e.id),oneByOneStatus:eK[e.id]||null})})]},e.id)})]}),tz=T.filter(e=>!0===e.isActive),tB=(0,s.jsx)(d.Modal,{isOpen:V,onClose:tP,title:`Apply Proxy (${b.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{onClick:()=>{let e=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tD(b.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:eh||0===tz.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,s.jsxs)("button",{onClick:()=>t_(null),disabled:eh,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),T.map(e=>(0,s.jsxs)("button",{onClick:()=>t_(e.id),disabled:eh||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,s.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eh&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(d.Button,{onClick:tP,variant:"ghost",fullWidth:!0,disabled:eh,children:"Cancel"})]})}),tM=async e=>{if(!er.has(e)){en(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tl}/${e}`})}),a=await t.json();el(t=>({...t,[e]:a.ok?"ok":"error"})),eo(a.ok?"":a.error||"Model not reachable")}catch{el(t=>({...t,[e]:"error"})),eo("Network error")}finally{en(t=>{let a=new Set(t);return a.delete(e),a})}}};return w?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):e1?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e1.color}15`},children:et?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:e1.color},children:e1.textIcon||e1.id.slice(0,2).toUpperCase()}):(0,s.jsx)(n.default,{src:e7&&e1.apiType?"responses"===e1.apiType?"/providers/oai-r.webp":"/providers/oai-cc.webp":e9?"/providers/anthropic-m.webp":`/providers/${e1.id}.webp`,alt:e1.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ea(!0)})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e1.name}),(e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website)&&(0,s.jsxs)("a",{href:e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e1.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[b.length," connection",1===b.length?"":"s"]})]})]})]}),e1.deprecated&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e1.deprecationNotice})]}),e1.notice?.text&&!e1.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e1.notice.text}),e1.notice.apiKeyUrl&&(0,s.jsx)("a",{href:e1.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),te&&C&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:e9?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[e9?"Messages API":"responses"===C.apiType?"Responses API":"Chat Completions"," \xb7 ",(C.baseUrl||"").replace(/\/$/,""),"/",e9?"messages":"responses"===C.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{R(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>q(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eO({title:"Delete Compatible Node",message:`Delete this ${e9?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eO(null);try{(await fetch(`/api/provider-nodes/${o}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),e4?(0,s.jsx)(d.NoAuthProxyCard,{providerId:o}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[b.length>0&&T.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>H(!0),children:"Apply Proxy"}),b.length>1&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete_sweep",onClick:tk,disabled:0===em.length,children:["Delete",em.length>0?` (${em.length})`:""]}),b.length>0&&(0,s.jsxs)(s.Fragment,{children:[em.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:tk,children:["Delete Selected (",em.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tw,disabled:e_,children:e_?"Testing Connection One-by-One...":"Test Connection One-by-One"}),e_&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{e_&&(eW.current=!0,eB(!0))},disabled:ez,children:ez?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,a=e?eb||"1":eb;e&&!eb&&ev("1"),eg(t),th(t,a)}}),"round-robin"===ey&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:eb,onChange:e=>{var t;ev(t=e.target.value),th("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===b.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e5?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tt&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ta," or ",ts,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tt?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:eY,children:ta}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:eZ,children:ts})]}):(0,s.jsxs)(s.Fragment,{children:[!te&&"iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),children:(0,u.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e0,children:te?"Add API Key":"iflow"===o?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[eJ&&(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",eJ.total]}),(0,s.jsxs)("span",{children:["Completed: ",eJ.completed]}),(0,s.jsxs)("span",{children:["Passed: ",eJ.passed]}),(0,s.jsxs)("span",{children:["Failed: ",eJ.failed]}),eJ.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),e_&&eM&&(0,s.jsxs)("span",{children:["Running: ",b.find(e=>e.id===eM)?.name||eM]})]})}),b.length>0&&(0,s.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tI,onChange:tO,className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tU,!te&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tt?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:eY,className:"w-full sm:w-auto",children:ta}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:eZ,className:"w-full sm:w-auto",children:ts})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e0,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!te&&(e=[...e8,...eA.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e$.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[e$.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tc,children:"Active All"}),e.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>td(e),children:"Disable All"})]}))]}),!!ei&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ei}),(()=>{let e,t,a;if(te)return(0,s.jsx)(v,{providerStorageAlias:tl,providerDisplayAlias:ti,modelAliases:X,customModels:Z,copied:eH,onCopy:eG,onSetAlias:ty,onDeleteAlias:tg,onAddCustomModel:e=>tb(e,"llm",tl),onDeleteCustomModel:e=>tv(e,"llm",tl),connections:b,isAnthropic:e9});let l=[...e8,...eA.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),i=new Set(e$),r=l.filter(e=>!i.has(e.id)),n=l.filter(e=>i.has(e.id)),d=y({customModels:Z,modelAliases:X,providerAlias:tl,builtInModels:e8,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,s.jsx)(g,{model:{id:e.id,name:e.name},fullModel:`${ti}/${e.id}`,alias:e.alias,copied:eH,onCopy:eG,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tv(e.id,"llm",tl):tg(e.alias)},testStatus:es[e.id],onTest:b.length>0||e4?()=>tM(e.id):void 0,isTesting:er.has(e.id),isCustom:!0,isFree:!1,caps:h(`${o}/${e.id}`)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tl}/${e.id}`,a=`${o}/${e.id}`,l=Object.entries(X).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(g,{model:e,fullModel:`${ti}/${e.id}`,alias:l,copied:eH,onCopy:eG,onSetAlias:t=>ty(e.id,t,tl),onDeleteAlias:()=>tg(l),testStatus:es[e.id],onTest:b.length>0||e4?()=>tM(e.id):void 0,isTesting:er.has(e.id),isFree:e.isFree,onDisable:()=>tr(e.id),caps:h(`${o}/${e.id}`)},e.id)}),(0,s.jsxs)("button",{onClick:()=>ec(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===o&&b.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:tj,disabled:eq,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:eq?{animation:"spin 1s linear infinite"}:void 0,children:eq?"progress_activity":"download"}),eq?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eC.length>0&&(e=new Set([...Object.values(X),...d.map(e=>e.fullModel)]),t=new Set(e8.map(e=>e.id)),0===(a=eC.filter(a=>!e.has(`${tl}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tb(e.id,"llm",tl)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,s.jsxs)("button",{onClick:()=>tn(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tB,"kiro"===o?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:O,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}):"cursor"===o?(0,s.jsx)(d.CursorAuthModal,{isOpen:O,onSuccess:tC,onClose:()=>D(!1)}):"gitlab"===o?(0,s.jsx)(d.GitLabAuthModal,{isOpen:O,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:O,provider:o,providerInfo:e1,onSuccess:tC,onClose:()=>D(!1)}),"iflow"===o&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:_,onSuccess:()=>{tx(),U(!1)},onClose:()=>U(!1)}),(0,s.jsx)(A,{isOpen:z,provider:o,providerName:e1.name,isCompatible:te,isAnthropic:e9,authType:e1?.authType,authHint:e1?.authHint,website:e1?.website,proxyPools:T,error:M,onSave:tS,onBulkDone:tx,onClose:()=>{R(""),B(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:J,connection:G,proxyPools:T,onSave:tA,onClose:()=>F(!1)}),te&&(0,s.jsx)($,{isOpen:W,node:C,onSave:tu,onClose:()=>q(!1),isAnthropic:e9}),!te&&(0,s.jsx)(I,{isOpen:ed,providerAlias:tl,providerDisplayAlias:ti,onSave:async e=>{await tb(e,"llm",tl),ec(!1)},onClose:()=>ec(!1)}),"codex"===o&&(0,s.jsx)(P,{isOpen:K,onClose:()=>L(!1),onSuccess:tx}),(0,s.jsx)(d.ConfirmModal,{isOpen:eP,onClose:()=>eD(!1),onConfirm:()=>{(window.localStorage.setItem(eQ,"true"),eD(!1),e5)?eX():eZ()},title:"Risk Notice",message:e1?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!eI,onClose:()=>eO(null),onConfirm:eI?.onConfirm,title:eI?.title||"Confirm",message:eI?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},8810:(e,t,a)=>{Promise.resolve().then(a.bind(a,5399))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,7236,5737,2147,3204,7358],()=>e(e.s=8810)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{7048:(e,t,s)=>{Promise.resolve().then(s.bind(s,8663))},8271:(e,t,s)=>{"use strict";s.d(t,{Ju:()=>r});let a=new Map;async function r(e,t={}){let s=function(e,t={}){return`${t.method||"GET"}|${e}`}(e,t);if(a.has(s)){let{body:e,status:t,statusText:r,headers:l}=a.get(s);return new Response(e,{status:t,statusText:r,headers:l})}let l=await fetch(e,t),i=await l.clone().arrayBuffer(),n=l.headers,o=l.status,d=l.statusText;return a.set(s,{body:i,status:o,statusText:d,headers:n}),new Response(i,{status:o,statusText:d,headers:n})}},8663:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(5102),r=s(2030),l=s(497),i=s(1704),n=s(1434),o=s(1038),d=s(3885),c=s.n(d),m=s(5795),p=s(1389),x=s(8271);let u={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function h(){let[e,t]=(0,r.useState)(null),[s,i]=(0,r.useState)(!0),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),p=(0,r.useRef)(null),x=(0,m.i)(),h=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{i(!1)}},[]);(0,r.useEffect)(()=>{h();let e=setInterval(h,3e4);return()=>clearInterval(e)},[h]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return n&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[n]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(x.success(`Cooldown cleared for ${t}`),await h()):x.error("Failed to clear cooldown")}catch{x.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),v={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,a.jsx)("div",{className:"relative",ref:p,children:n&&(0,a.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,a.jsx)("button",{type:"button",onClick:h,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,a.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,a.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=u[e.status]||u.unknown,s=d===`${e.provider}:${e.model}`;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,a.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,a.jsx)(l.Button,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let f={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},g=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],b=function({variant:e,isOpen:t,onClose:s,onCreated:i}){let n=f[e],o=()=>({name:"",prefix:"",...n.hasApiType?{apiType:"chat"}:{},baseUrl:n.defaultBaseUrl}),[d,c]=(0,r.useState)(o),[m,p]=(0,r.useState)(!1),[x,u]=(0,r.useState)(""),[h,b]=(0,r.useState)(""),[v,y]=(0,r.useState)(!1),[j,N]=(0,r.useState)(null);(0,r.useEffect)(()=>{n.hasApiType?c(e=>({...e,baseUrl:n.defaultBaseUrl})):t&&(N(null),u(""),b(""))},[n.hasApiType?d.apiType:t]);let w=async()=>{if(d.name.trim()&&d.prefix.trim()&&d.baseUrl.trim()){p(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...n.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:n.type})}),t=await e.json();e.ok&&(i(t.node),c(o()),u(""),N(null))}catch(e){console.log(`Error creating ${n.errorLabel} node:`,e)}finally{p(!1)}}},k=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:x,type:n.type,modelId:h.trim()||void 0})}),t=await e.json();N(t)}catch{N({valid:!1,error:"Network error"})}finally{y(!1)}};return(0,a.jsx)(l.Modal,{isOpen:t,title:n.title,onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(l.Input,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:n.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,a.jsx)(l.Input,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:n.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),n.hasApiType&&(0,a.jsx)(l.Select,{label:"API Type",options:g,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,a.jsx)(l.Input,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:n.defaultBaseUrl,hint:n.baseUrlHint}),(0,a.jsx)(l.Input,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,a.jsx)(l.Input,{label:"Model ID (optional)",value:h,onChange:e=>b(e.target.value),placeholder:n.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,a.jsx)(l.Button,{onClick:k,disabled:!x||v||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:v?"Checking...":"Check"}),(()=>{if(!j)return null;let{valid:e,error:t,method:s}=j;return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Badge,{variant:"success",children:"Valid"}),"chat"===s&&(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)(l.Badge,{variant:"error",children:"Invalid"}),t&&(0,a.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(l.Button,{onClick:w,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||m,children:m?"Creating...":"Create"}),(0,a.jsx)(l.Button,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})};function v(e,t,s){let r=[];if(e>0&&r.push((0,a.jsxs)(l.Badge,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;r.push((0,a.jsx)(l.Badge,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===r.length?(0,a.jsx)("span",{className:"text-text-muted",children:"No connections"}):r}function y(){let[e,t]=(0,r.useState)([]),[s,i]=(0,r.useState)([]),[d,c]=(0,r.useState)(!0),[u,f]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[C,T]=(0,r.useState)(null),[A,I]=(0,r.useState)(null),P=(0,m.i)(),S=(0,p.C)(e=>e.query),$=(0,p.C)(e=>e.register),O=(0,p.C)(e=>e.unregister);(0,r.useEffect)(()=>($("Search providers..."),()=>O()),[$,O]);let U=e=>!S.trim()||e.toLowerCase().includes(S.trim().toLowerCase()),E=(e,t)=>[...e].sort(([e,s],[a,r])=>{let l=s.priority??999,i=r.priority??999;if(l!==i)return l-i;let n=_(e,t),o=_(a,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(s.name||"").localeCompare(r.name||"")});(0,r.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([(0,x.Ju)("/api/providers"),(0,x.Ju)("/api/provider-nodes")]),a=await e.json(),r=await s.json();e.ok&&t(a.connections||[]),s.ok&&i(r.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{c(!1)}})()},[]);let _=(t,s)=>{let a=Array.isArray(s)?s:[s],r=e.filter(e=>e.provider===t&&a.includes(e.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=r.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=r.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,d=r.length,c=d>0&&r.every(e=>!1===e.isActive),m=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:m?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let a=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===a||"403"===a)return"AUTH";if(a&&"ERR"!==a)return a;let r=(e.lastError||"").toLowerCase();return r.includes("runtime")||r.includes("not runnable")||r.includes("not installed")?"RUNTIME":r.includes("invalid api key")||r.includes("token invalid")||r.includes("revoked")||r.includes("unauthorized")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(m.lastErrorAt):null,allDisabled:c}},R=async(s,a,r)=>{let l=Array.isArray(a)?a:[a],i=e=>e.provider===s&&l.includes(e.authType),n=e.filter(i);t(e=>e.map(e=>i(e)?{...e,isActive:r}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})))},z=async(e,t=null)=>{if(!C){T("provider"===e?t:e),I(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),a=await s.json();if(I(a),a.summary){let{passed:e,failed:t,total:s}=a.summary;0===t?P.success(`All ${s} tests passed`):P.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){I({error:"Test request failed"}),P.error("Provider test failed")}finally{T(null)}}},B=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>U(e.name)),D=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>U(e.name)),L=E(Object.entries(n.zN).filter(([,e])=>!e.hidden&&U(e.name)),"oauth"),M=Object.entries(o.IS).filter(([,e])=>!e.hidden&&U(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),F=E(Object.entries(o.nJ).filter(([,e])=>!e.hidden&&U(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),J=Object.entries(n.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&U(e.name)).sort(([e,t],[s,a])=>{let r=_(e,"apikey").total>0?0:1,l=_(s,"apikey").total>0?0:1;return r!==l?r-l:(t.name||"").localeCompare(a.name||"")}),K=!!S.trim(),H=K||u?J:J.slice(0,20),W=J.length-20;if(d)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(l.CardSkeleton,{}),(0,a.jsx)(l.CardSkeleton,{})]});let q=L.length>0||M.length>0||F.length>0||J.length>0||B.length>0||D.length>0;return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!q&&(0,a.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,a.jsx)(l.Button,{size:"sm",icon:"add",onClick:()=>k(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,a.jsx)(l.Button,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===B.length&&0===D.length?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,a.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...B,...D].map(e=>(0,a.jsx)(N,{providerId:e.id,provider:e,stats:_(e.id,"apikey"),authType:"compatible",onToggle:t=>R(e.id,"apikey",t)},e.id))})]}),L.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)(h,{}),(0,a.jsxs)("button",{onClick:()=>z("oauth"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===C?" animate-spin":""}`,children:"play_arrow"}),"oauth"===C?"Testing...":"Test All"]})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:L.map(([e,t])=>(0,a.jsx)(j,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"oauth",onToggle:t=>R(e,"oauth",t)},e))})]}),(M.length>0||F.length>0)&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,a.jsxs)("button",{onClick:()=>z("free"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===C?" animate-spin":""}`,children:"play_arrow"}),"free"===C?"Testing...":"Test All"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[M.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,a.jsx)(j,{providerId:e,provider:t,stats:_(e,s),authType:"free",onToggle:t=>R(e,s,t)},e)}),F.map(([e,t])=>(0,a.jsx)(N,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>R(e,"apikey",t)},e))]})]}),J.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,a.jsxs)("button",{onClick:()=>z("apikey"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===C?" animate-spin":""}`,children:"play_arrow"}),"apikey"===C?"Testing...":"Test All"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,a.jsx)(N,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>R(e,"apikey",t)},e))}),!K&&!u&&W>0&&(0,a.jsxs)("button",{onClick:()=>f(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",J.length," providers"]})]}),(0,a.jsx)(b,{variant:"openai",isOpen:g,onClose:()=>v(!1),onCreated:e=>{i(t=>[...t,e]),v(!1)}}),(0,a.jsx)(b,{variant:"anthropic",isOpen:y,onClose:()=>k(!1),onCreated:e=>{i(t=>[...t,e]),k(!1)}}),A&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>I(null),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,a.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,a.jsx)("button",{onClick:()=>I(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,a.jsx)("div",{className:"p-5",children:(0,a.jsx)(w,{results:A})})]})]})]})}function j({providerId:e,provider:t,stats:s,authType:r,onToggle:n}){let{connected:o,error:d,errorCode:m,errorTime:p,allDisabled:x}=s,u=!!t.noAuth;return(0,a.jsx)(c(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(l.Card,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(i.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,a.jsx)(l.Badge,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,a.jsxs)(a.Fragment,{children:[v(o,d,m),p&&(0,a.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!x)},children:(0,a.jsx)(l.Toggle,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function N({providerId:e,provider:t,stats:s,authType:r,onToggle:n}){let{connected:d,error:m,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(o.JH),f=e.startsWith(o.DI);return(0,a.jsx)(c(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(l.Card,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(i.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,a.jsxs)(a.Fragment,{children:[v(d,m,p),h&&(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:"Messages"}),x&&(0,a.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!u)},children:(0,a.jsx)(l.Toggle,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function w({results:e}){if(e.error&&!e.results)return(0,a.jsxs)("div",{className:"text-center py-6",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,r=e.results||[];return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,a.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),r.map((e,t)=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,a.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,a.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,a.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===r.length&&(0,a.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=7048)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{7048:(e,t,s)=>{Promise.resolve().then(s.bind(s,8663))},8271:(e,t,s)=>{"use strict";s.d(t,{Ju:()=>r});let a=new Map;async function r(e,t={}){let s=function(e,t={}){return`${t.method||"GET"}|${e}`}(e,t);if(a.has(s)){let{body:e,status:t,statusText:r,headers:l}=a.get(s);return new Response(e,{status:t,statusText:r,headers:l})}let l=await fetch(e,t),i=await l.clone().arrayBuffer(),n=l.headers,o=l.status,d=l.statusText;return a.set(s,{body:i,status:o,statusText:d,headers:n}),new Response(i,{status:o,statusText:d,headers:n})}},8663:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(5102),r=s(2030),l=s(497),i=s(1704),n=s(1434),o=s(1038),d=s(3885),c=s.n(d),m=s(5795),p=s(1389),x=s(8271);let u={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function h(){let[e,t]=(0,r.useState)(null),[s,i]=(0,r.useState)(!0),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),p=(0,r.useRef)(null),x=(0,m.i)(),h=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{i(!1)}},[]);(0,r.useEffect)(()=>{h();let e=setInterval(h,3e4);return()=>clearInterval(e)},[h]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return n&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[n]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(x.success(`Cooldown cleared for ${t}`),await h()):x.error("Failed to clear cooldown")}catch{x.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,a.jsx)("div",{className:"relative",ref:p,children:n&&(0,a.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,a.jsx)("button",{type:"button",onClick:h,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,a.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,a.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=u[e.status]||u.unknown,s=d===`${e.provider}:${e.model}`;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,a.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,a.jsx)(l.Button,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let f={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},b=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],g=function({variant:e,isOpen:t,onClose:s,onCreated:i}){let n=f[e],o=()=>({name:"",prefix:"",...n.hasApiType?{apiType:"chat"}:{},baseUrl:n.defaultBaseUrl}),[d,c]=(0,r.useState)(o),[m,p]=(0,r.useState)(!1),[x,u]=(0,r.useState)(""),[h,g]=(0,r.useState)(""),[v,y]=(0,r.useState)(!1),[j,N]=(0,r.useState)(null);(0,r.useEffect)(()=>{n.hasApiType?c(e=>({...e,baseUrl:n.defaultBaseUrl})):t&&(N(null),u(""),g(""))},[n.hasApiType?d.apiType:t]);let w=async()=>{if(d.name.trim()&&d.prefix.trim()&&d.baseUrl.trim()){p(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...n.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:n.type})}),t=await e.json();e.ok&&(i(t.node),c(o()),u(""),N(null))}catch(e){console.log(`Error creating ${n.errorLabel} node:`,e)}finally{p(!1)}}},k=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:x,type:n.type,modelId:h.trim()||void 0})}),t=await e.json();N(t)}catch{N({valid:!1,error:"Network error"})}finally{y(!1)}};return(0,a.jsx)(l.Modal,{isOpen:t,title:n.title,onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(l.Input,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:n.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,a.jsx)(l.Input,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:n.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),n.hasApiType&&(0,a.jsx)(l.Select,{label:"API Type",options:b,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,a.jsx)(l.Input,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:n.defaultBaseUrl,hint:n.baseUrlHint}),(0,a.jsx)(l.Input,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>u(e.target.value)}),(0,a.jsx)(l.Input,{label:"Model ID (optional)",value:h,onChange:e=>g(e.target.value),placeholder:n.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,a.jsx)(l.Button,{onClick:k,disabled:!x||v||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:v?"Checking...":"Check"}),(()=>{if(!j)return null;let{valid:e,error:t,method:s}=j;return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Badge,{variant:"success",children:"Valid"}),"chat"===s&&(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)(l.Badge,{variant:"error",children:"Invalid"}),t&&(0,a.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(l.Button,{onClick:w,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||m,children:m?"Creating...":"Create"}),(0,a.jsx)(l.Button,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})};function v(e,t,s){let r=[];if(e>0&&r.push((0,a.jsxs)(l.Badge,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;r.push((0,a.jsx)(l.Badge,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===r.length?(0,a.jsx)("span",{className:"text-text-muted",children:"No connections"}):r}function y(){let[e,t]=(0,r.useState)([]),[s,i]=(0,r.useState)([]),[d,c]=(0,r.useState)(!0),[u,f]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[C,T]=(0,r.useState)(null),[A,I]=(0,r.useState)(null),P=(0,m.i)(),S=(0,p.C)(e=>e.query),$=(0,p.C)(e=>e.register),O=(0,p.C)(e=>e.unregister);(0,r.useEffect)(()=>($("Search providers..."),()=>O()),[$,O]);let U=e=>!S.trim()||e.toLowerCase().includes(S.trim().toLowerCase()),E=(e,t)=>[...e].sort(([e,s],[a,r])=>{let l=s.priority??999,i=r.priority??999;if(l!==i)return l-i;let n=_(e,t),o=_(a,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(s.name||"").localeCompare(r.name||"")});(0,r.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([(0,x.Ju)("/api/providers"),(0,x.Ju)("/api/provider-nodes")]),a=await e.json(),r=await s.json();e.ok&&t(a.connections||[]),s.ok&&i(r.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{c(!1)}})()},[]);let _=(t,s)=>{let a=Array.isArray(s)?s:[s],r=e.filter(e=>e.provider===t&&a.includes(e.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=r.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=r.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,d=r.length,c=d>0&&r.every(e=>!1===e.isActive),m=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:m?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let a=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===a||"403"===a)return"AUTH";if(a&&"ERR"!==a)return a;let r=(e.lastError||"").toLowerCase();return r.includes("runtime")||r.includes("not runnable")||r.includes("not installed")?"RUNTIME":r.includes("invalid api key")||r.includes("token invalid")||r.includes("revoked")||r.includes("unauthorized")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(m.lastErrorAt):null,allDisabled:c}},R=async(s,a,r)=>{let l=Array.isArray(a)?a:[a],i=e=>e.provider===s&&l.includes(e.authType),n=e.filter(i);t(e=>e.map(e=>i(e)?{...e,isActive:r}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})))},z=async(e,t=null)=>{if(!C){T("provider"===e?t:e),I(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),a=await s.json();if(I(a),a.summary){let{passed:e,failed:t,total:s}=a.summary;0===t?P.success(`All ${s} tests passed`):P.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){I({error:"Test request failed"}),P.error("Provider test failed")}finally{T(null)}}},B=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>U(e.name)),D=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>U(e.name)),L=E(Object.entries(n.zN).filter(([,e])=>!e.hidden&&U(e.name)),"oauth"),M=Object.entries(o.IS).filter(([,e])=>!e.hidden&&U(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),F=E(Object.entries(o.nJ).filter(([,e])=>!e.hidden&&U(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),J=Object.entries(n.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&U(e.name)).sort(([e,t],[s,a])=>{let r=_(e,"apikey").total>0?0:1,l=_(s,"apikey").total>0?0:1;return r!==l?r-l:(t.name||"").localeCompare(a.name||"")}),K=!!S.trim(),H=K||u?J:J.slice(0,20),W=J.length-20;if(d)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(l.CardSkeleton,{}),(0,a.jsx)(l.CardSkeleton,{})]});let q=L.length>0||M.length>0||F.length>0||J.length>0||B.length>0||D.length>0;return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!q&&(0,a.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,a.jsx)(l.Button,{size:"sm",icon:"add",onClick:()=>k(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,a.jsx)(l.Button,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===B.length&&0===D.length?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,a.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...B,...D].map(e=>(0,a.jsx)(N,{providerId:e.id,provider:e,stats:_(e.id,"apikey"),authType:"compatible",onToggle:t=>R(e.id,"apikey",t)},e.id))})]}),L.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)(h,{}),(0,a.jsxs)("button",{onClick:()=>z("oauth"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===C?" animate-spin":""}`,children:"play_arrow"}),"oauth"===C?"Testing...":"Test All"]})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:L.map(([e,t])=>(0,a.jsx)(j,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"oauth",onToggle:t=>R(e,"oauth",t)},e))})]}),(M.length>0||F.length>0)&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,a.jsxs)("button",{onClick:()=>z("free"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===C?" animate-spin":""}`,children:"play_arrow"}),"free"===C?"Testing...":"Test All"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[M.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,a.jsx)(j,{providerId:e,provider:t,stats:_(e,s),authType:"free",onToggle:t=>R(e,s,t)},e)}),F.map(([e,t])=>(0,a.jsx)(N,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>R(e,"apikey",t)},e))]})]}),J.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,a.jsxs)("button",{onClick:()=>z("apikey"),disabled:!!C,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===C?" animate-spin":""}`,children:"play_arrow"}),"apikey"===C?"Testing...":"Test All"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,a.jsx)(N,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>R(e,"apikey",t)},e))}),!K&&!u&&W>0&&(0,a.jsxs)("button",{onClick:()=>f(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",J.length," providers"]})]}),(0,a.jsx)(g,{variant:"openai",isOpen:b,onClose:()=>v(!1),onCreated:e=>{i(t=>[...t,e]),v(!1)}}),(0,a.jsx)(g,{variant:"anthropic",isOpen:y,onClose:()=>k(!1),onCreated:e=>{i(t=>[...t,e]),k(!1)}}),A&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>I(null),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,a.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,a.jsx)("button",{onClick:()=>I(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,a.jsx)("div",{className:"p-5",children:(0,a.jsx)(w,{results:A})})]})]})]})}function j({providerId:e,provider:t,stats:s,authType:r,onToggle:n}){let{connected:o,error:d,errorCode:m,errorTime:p,allDisabled:x}=s,u=!!t.noAuth;return(0,a.jsx)(c(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(l.Card,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(i.A,{src:`/providers/${t.id}.webp`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,a.jsx)(l.Badge,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,a.jsxs)(a.Fragment,{children:[v(o,d,m),p&&(0,a.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!x)},children:(0,a.jsx)(l.Toggle,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function N({providerId:e,provider:t,stats:s,authType:r,onToggle:n}){let{connected:d,error:m,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(o.JH),f=e.startsWith(o.DI);return(0,a.jsx)(c(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(l.Card,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(i.A,{src:h?"responses"===t.apiType?"/providers/oai-r.webp":"/providers/oai-cc.webp":f?"/providers/anthropic-m.webp":`/providers/${t.id}.webp`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,a.jsxs)(a.Fragment,{children:[v(d,m,p),h&&(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,a.jsx)(l.Badge,{variant:"default",size:"sm",children:"Messages"}),x&&(0,a.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!u)},children:(0,a.jsx)(l.Toggle,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function w({results:e}){if(e.error&&!e.results)return(0,a.jsxs)("div",{className:"text-center py-6",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,r=e.results||[];return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,a.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),r.map((e,t)=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,a.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,a.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,a.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===r.length&&(0,a.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=7048)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-9b704f6f5e9d5617.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{665:(e,t,r)=>{"use strict";r.d(t,{default:()=>M});var a=r(5102),i=r(2030),s=r(1704),n=r(2345);let l=new Set(["antigravity","gemini-cli"]),o="quotaCacheData",c="quotaAutoRefresh",d=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],m=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function h(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function p(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function b(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function g(e,t){return await e(t)}function f(){try{let e=window.localStorage.getItem(o);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function y(e,t){try{let r=f();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(o,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function v(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}let j=[];function k({quotas:e=j,compact:t=!1,sortMode:r="default",showSortLabel:s=!1}){let[n,l]=(0,i.useState)(1),o=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):v(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?o.toSorted((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?o.toSorted((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),d=Math.max(1,Math.ceil(c.length/10)),[u,m]=(0,i.useState)(r),[x,h]=(0,i.useState)(e),[p,b]=(0,i.useState)(d);if(r!==u||e!==x?(m(r),h(e),b(d),l(1)):d!==p&&(b(d),l(e=>Math.min(e,d))),!e||0===e.length)return null;let g=c.slice((n-1)*10,10*n),f=0===c.length?0:(n-1)*10+1,y=Math.min(10*n,c.length),w=t?"py-1 px-1.5":"py-2 px-3",N=t?"text-[11px]":"text-sm",S=t?"text-[11px]":"text-sm",C=t?"text-[10px] leading-tight":"text-xs";return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:g.map(e=>{var r;let i=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},s=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),n=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt);return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${w} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:i.emoji}),(0,a.jsx)("span",{className:`${N} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${w} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${i.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${i.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${i.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${w} w-[25%]`,children:"-"!==s||n?t?(0,a.jsx)("div",{className:`${S} text-text-primary font-medium truncate`,title:n||"",children:"-"!==s?`in ${s}`:n}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==s&&(0,a.jsxs)("div",{className:`${S} text-text-primary font-medium`,children:["in ",s]}),n&&(0,a.jsx)("div",{className:`${C} text-text-muted`,children:n})]}):(0,a.jsx)("div",{className:`${S} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),d>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",f,"-",y," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",n," / ",d]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.max(1,e-1)),disabled:1===n,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.min(d,e+1)),disabled:n===d,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var w=r(2252),N=r(8419),S=r(2758),C=r(497),A=r(1038),$=r(1577);let P={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"};function E(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function q(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function M(){let{copied:e,copy:t}=(0,$.C)(),[r,j]=(0,i.useState)([]),[M,D]=(0,i.useState)({}),[T,O]=(0,i.useState)({}),[I,_]=(0,i.useState)({}),[F,L]=(0,i.useState)(!0),[z,R]=(0,i.useState)({}),[U,K]=(0,i.useState)(null),[J,G]=(0,i.useState)(!1),[H,B]=(0,i.useState)(!1),[W,Y]=(0,i.useState)(60),[Q,V]=(0,i.useState)(!0),[X,Z]=(0,i.useState)(null),[ee,et]=(0,i.useState)(null),[er,ea]=(0,i.useState)(null),[ei,es]=(0,i.useState)(null),[en,el]=(0,i.useState)(!1),[eo,ec]=(0,i.useState)(null),[ed,eu]=(0,i.useState)([]),[em,ex]=(0,i.useState)("all"),[eh,ep]=(0,i.useState)([]),[eb,eg]=(0,i.useState)("all"),[ef,ey]=(0,i.useState)("all"),[ev,ej]=(0,i.useState)("default"),[ek,ew]=(0,i.useState)(!1),[eN,eS]=(0,i.useState)(!1),[eC,eA]=(0,i.useState)(!1),[e$,eP]=(0,i.useState)(1),[eE,eq]=(0,i.useState)(20),[eM,eD]=(0,i.useState)(String(20)),[eT,eO]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eI,e_]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eF=(0,i.useRef)(null),eL=(0,i.useRef)(null),ez=(0,i.useRef)(0),eR=(0,i.useCallback)(async(e=e$)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eE),accountStatus:ef,sort:"priority"});"all"!==em&&a.set("provider",em);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eE,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return j(n),ep(s.providerOptions||[]),eO(l),e_(o),eP((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),j([]),ep([]),eO({page:1,pageSize:eE,total:0,totalPages:1}),e_({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ef,ek,e$,eE,em]),eU=(0,i.useCallback)(async(e,t)=>{O(t=>({...t,[e]:!0})),_(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};D(t=>({...t,[e]:r})),y(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let i={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return(e.get(a)??999)-(e.get(i)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};D(t=>({...t,[e]:i})),y(e,i)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),_(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{O(t=>({...t,[e]:!1}))}},[]),eK=(0,i.useCallback)(async(e,t)=>{await eU(e,t),K(new Date)},[eU]),eJ=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!er){ea(e),_(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eU(e,t),K(new Date)}catch(t){_(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{ea(null)}}},[eU,er]),eG=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){Z(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){D(t=>{let r={...t};return delete r[e],r}),O(t=>{let r={...t};return delete r[e],r}),_(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(o,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eR,e$)}}catch(e){console.error("Error deleting connection:",e)}finally{Z(null)}}},[eR,e$]),eH=(0,i.useCallback)(async(e,t)=>{et(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(D(e=>({...e})),await g(eR,e$))}catch(e){console.error("Error updating connection status:",e)}finally{et(null)}},[eR,e$]),eB=(0,i.useCallback)(async e=>{if(!eo?.id)return;let t=eo.id,r=eo.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eR(),el(!1),ec(null),A.wb.includes(r)&&await eU(t,r))}catch(e){console.error("Error saving connection:",e)}},[eo,eR,eU]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&eu(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let eW=(0,i.useCallback)(async(e=!1)=>{if(H)return;B(!0),Y(60);let t=ez.current+=1,r=Math.round(3);try{let a=await eR(e$);O(p(a)),_(e=>b(e,a)),D(e=>b(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eU(e.id,e.provider))),K(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{B(!1)}},[H,eR,eU,e$]);(0,i.useEffect)(()=>{(async()=>{V(!0);let e=await eR(e$);V(!1),O(p(e)),_(t=>b(t,e)),D(t=>b(t,e)),await Promise.all(e.map(e=>eU(e.id,e.provider))),K(new Date)})()},[eR,eU,e$]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(c);L(null===e||"true"===e),G(!0)},[]),(0,i.useEffect)(()=>{J&&window.localStorage.setItem(c,String(F))},[F,J]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>R(e?.claudeAutoPing?.connections||{})).catch(()=>{})},[]);let eY=(0,i.useCallback)(async(e,t)=>{let r={...z,[e]:t};R(r);try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{}).claudeAutoPing||{},connections:r};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:t})})}catch{R(z)}},[z]);(0,i.useEffect)(()=>{if(!J||!F){eF.current&&(clearInterval(eF.current),eF.current=null),eL.current&&(clearInterval(eL.current),eL.current=null);return}return eF.current=setInterval(()=>{eW()},6e4),eL.current=setInterval(()=>{Y(e=>e<=1?60:e-1)},1e3),()=>{eF.current&&clearInterval(eF.current),eL.current&&clearInterval(eL.current)}},[F,eW,J]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(eF.current&&(clearInterval(eF.current),eF.current=null),eL.current&&(clearInterval(eL.current),eL.current=null)):F&&J&&(eF.current=setInterval(()=>eW(),6e4),eL.current=setInterval(()=>{Y(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[F,eW,J]),(0,i.useEffect)(()=>{eg("all")},[em]);let eQ=(0,i.useMemo)(()=>em&&l.has(em)?(0,n.KC)(em).map(e=>({id:e.id,name:e.name||e.id})):[],[em]),eV=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=h(e,t),s=h(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(x(e)||"").localeCompare(x(r)||"")});if(!r)return e;let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,M,ek,em,ev),[r,M,ek,em,ev]),eX=e=>{let t=M[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},eZ=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eC){eA(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await g(eR,e$)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eA(!1)}}},[eC,eR,e$]),e0="all"===em?"All providers":em,e1=eI.eligibleConnections>0,e5=eV.length>0,e2=eI.eligibleConnections?eI.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===em?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ef?"turned off":"active"===ef?"active":"matching"} accounts found for ${em}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},e8=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eT),e4=!d.includes(eE);return Q||e1?Q||e5?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eS(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eN,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===em?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${em}.webp`,alt:em,size:18,className:"size-[18px] rounded object-contain",fallbackText:em.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e0})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eN&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eS(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-1.5 w-52 overflow-hidden rounded-xl border border-black/10 bg-surface/95 p-1 shadow-lg shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-60",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==em&&eP(1),ex("all"),eS(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${"all"===em?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===em&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto pr-0.5",children:eh.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{em!==e&&eP(1),ex(e),eS(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${em===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.webp`,alt:e,size:18,className:"size-[18px] rounded object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),em===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ef,onChange:e=>{let t=e.target.value;ef!==t&&eP(1),ey(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===em&&(0,a.jsx)("select",{value:ev,onChange:e=>ej(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:m.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),l.has(em)&&eQ.length>0&&(0,a.jsxs)("select",{value:eb,onChange:e=>eg(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter quotas by model",children:[(0,a.jsx)("option",{value:"all",children:"All models"}),eQ.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>ew(e=>!e),"aria-pressed":ek,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${ek?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eZ(eV.filter(e=>(e.isActive??!0)&&eX(e)).map(e=>e.id),!1)},disabled:eC,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eZ(eV.filter(e=>!(e.isActive??!0)&&!eX(e)).map(e=>e.id),!0)},disabled:eC,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>L(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:F?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${F?"text-primary":"text-text-muted"}`,children:F?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),F&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",W,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eW(!0),disabled:H,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${H?"animate-spin":""}`,children:"refresh"})})]})}),ek&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eV.map(r=>{var i;let n,l,o,c=M[r.id],d=T[r.id],u=I[r.id],m=!1===r.isActive,h="codex"===r.provider,p=Number.isFinite(l="number"==typeof(n=c?.raw?.resetCredits?.availableCount)?n:Number(n))?Math.max(0,l):0,b=er===r.id,g=X===r.id||ee===r.id||b;return(0,a.jsxs)(S.A,{padding:"none",className:`min-w-0 ${m?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.webp`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,E(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:E(r)}):null,h&&(0,a.jsxs)("p",{className:"text-[11px] text-text-muted truncate",children:["Reset eligible: ",p]}),"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(o=r.providerSpecificData?.authMethod)&&P[o]?P[o]:"api_key"===r.authType?"API Key":"OAuth"}),q(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:q(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${m?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:m?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[h&&(0,a.jsx)(N.A,{text:`Codex reset credits remaining: ${p}`,children:(0,a.jsxs)("div",{className:`hidden h-8 items-center gap-1 rounded-lg border px-2 text-[11px] sm:flex ${p>0?"border-primary/30 bg-primary/5 text-primary":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"}),(0,a.jsx)("span",{className:"tabular-nums",children:p})]})}),h&&p>0&&(0,a.jsx)(N.A,{text:`Use one Codex reset credit. Available: ${p}`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>es({connection:r,resetCreditCount:p}),disabled:d||g,className:"flex h-8 items-center gap-1 rounded-lg border border-primary/30 px-2 text-[11px] text-primary transition-colors hover:bg-primary/10 disabled:opacity-50",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${b?"animate-spin":""}`,children:b?"progress_activity":"bolt"}),(0,a.jsx)("span",{className:"hidden lg:inline",children:"Reset limit"})]})}),"claude"===r.provider&&"oauth"===r.authType&&(0,a.jsx)(N.A,{text:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r.id,!0!==z[r.id]),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${!0===z[r.id]?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(N.A,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eK(r.id,r.provider),disabled:d||g,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(N.A,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ec(r),el(!0)},disabled:g,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(N.A,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eG(r.id),disabled:g,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${X===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(w.A,{size:"sm",checked:r.isActive??!0,disabled:g,onChange:e=>eH(r.id,e)})})]})]})}),(0,a.jsx)("div",{className:"px-2 py-1.5",children:d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):u?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:u})]}):c?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:c.message})}):(0,a.jsx)(k,{quotas:(i=c?.quotas,Array.isArray(i)&&"all"!==eb&&eb?i.filter(e=>(e&&(e.modelKey||e.name)||"")===eb):i||[]),compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==ev})})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e8}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:e4?"custom":String(eE),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eP(1),eq(r),eD(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eM,onChange:e=>eD(e.target.value),onBlur:()=>{let e=Number.parseInt(eM,10);if(!Number.isFinite(e))return void eD(String(eE));let t=Math.min(500,Math.max(1,e));eP(1),eq(t),eD(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eM,10);if(!Number.isFinite(t))return void eD(String(eE));let r=Math.min(500,Math.max(1,t));eP(1),eq(r),eD(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eT.page," / ",eT.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eP(1),disabled:eT.page<=1||Q||H,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(e=>Math.max(1,e-1)),disabled:eT.page<=1||Q||H,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(e=>Math.min(eT.totalPages,e+1)),disabled:eT.page>=eT.totalPages||Q||H,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(eT.totalPages),disabled:eT.page>=eT.totalPages||Q||H,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(C.ConfirmModal,{isOpen:!!ei,onClose:()=>{er||es(null)},onConfirm:async()=>{let e=ei?.connection;e&&(await eJ(e.id,e.provider),es(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(ei?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${ei?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!er}),(0,a.jsx)(C.EditConnectionModal,{isOpen:en,connection:eo,proxyPools:ed,onSave:eB,onClose:()=>{el(!1),ec(null)}})]}):(0,a.jsx)(S.A,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:e2.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e2.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e2.description})]})}):(0,a.jsx)(S.A,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}},9327:(e,t,r)=>{Promise.resolve().then(r.bind(r,665)),Promise.resolve().then(r.bind(r,7056))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=9327)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{1577:(e,t,s)=>{"use strict";s.d(t,{C:()=>a});var r=s(2030);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},1704:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var r=s(5102),a=s(2030),l=s(7837);function o({src:e,alt:t,size:s=32,className:n="",fallbackText:i="?",fallbackColor:d}){let[c,x]=(0,a.useState)(!1);return!e||c?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${n}`.trim(),style:{width:s,height:s,color:d,fontSize:Math.max(10,Math.floor(.38*s))},children:i}):(0,r.jsx)(l.default,{src:e,alt:t,width:s,height:s,className:n,onError:()=>x(!0),unoptimized:!0})}},3035:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(5102),a=s(3278),l=s(2030);function o(){let[e,t]=(0,l.useState)(!1),s=(0,a.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#141121]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#6366f1] to-[#8b5cf6] flex items-center justify-center text-white",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-5 h-5",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"white",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"white"})]})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"VansAI"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#6366f1] hover:bg-[#4f46e5] transition-all text-white text-sm font-bold shadow-[0_0_15px_rgba(99,102,241,0.4)] hover:shadow-[0_0_20px_rgba(99,102,241,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{type:"button",className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#141121]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{type:"button",onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-sm font-bold",children:"Get Started"})]})})]})}function n(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#6366f1]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#1a1433]/50 px-3 py-1 text-xs font-medium text-[#6366f1]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#6366f1] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{type:"button",className:"h-12 px-8 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-base font-bold transition-all shadow-[0_0_15px_rgba(99,102,241,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#3a2f27] bg-[#1a1433] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var i=s(1704);let d=[{id:"claude",name:"Claude Code",image:"/providers/claude.webp"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.webp"},{id:"cline",name:"Cline",image:"/providers/cline.webp"},{id:"cursor",name:"Cursor",image:"/providers/cursor.webp"}],c=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function x(){let[e,t]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%c.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#1a1433] border-2 border-[#6366f1] shadow-[0_0_40px_rgba(99,102,241,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-10 h-10",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"#6366f1",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"#6366f1"})]}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"VansAI"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#6366f1]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:d.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#1a1433] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#6366f1]/50 transition-all hover:scale-105",children:(0,r.jsx)(i.A,{src:e.image,alt:e.name,size:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:c.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#6366f1]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#1a1433] border border-[#3a2f27]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function h(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#1a1433]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How VansAI Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#6366f1] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border-2 border-[#6366f1] flex items-center justify-center shadow-[0_0_30px_rgba(99,102,241,0.2)] z-10 mx-auto",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-10 h-10",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"#6366f1",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"#6366f1"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#6366f1]",children:"2. VansAI Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let m=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function u(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:m.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#1a1433] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var f=s(1577);function p(){let{copied:e,copy:t}=(0,f.C)();return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#0f0d1a]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install VansAI, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install VansAI"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://127.0.0.1:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx VansRoute","landing")},"aria-label":"Copy command: npx VansRoute",children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx VansRoute"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Starting VansAI...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Server running on ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Dashboard: ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.9router/db/data.sqlite",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/VansRoute/db/data.sqlite"]})]})]})})]})})})}var b=s(3885),g=s.n(b);function j(){return(0,r.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#0f0d1a] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#6366f1] flex items-center justify-center text-white",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-4 h-4",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"white",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"white"})]})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"VansAI"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)(g(),{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://www.npmjs.com/package/vansrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 VansAI. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/vansrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function v(){let e=(0,a.useRouter)();return(0,r.jsxs)("div",{className:"relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#6366f1] selection:text-white",children:[(0,r.jsxs)("div",{className:"fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#141121]",children:[(0,r.jsx)("div",{className:"absolute inset-0 opacity-[0.06]",style:{backgroundImage:"linear-gradient(to right, #6366f1 1px, transparent 1px), linear-gradient(to bottom, #6366f1 1px, transparent 1px)",backgroundSize:"50px 50px"}}),(0,r.jsx)("div",{className:"absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#6366f1]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{className:"absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob-delayed-1"}),(0,r.jsx)("div",{className:"absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob-delayed-2"}),(0,r.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(circle at center, transparent 0%, rgba(20, 17, 33, 0.4) 100%)"}})]}),(0,r.jsxs)("div",{className:"relative z-10",children:[(0,r.jsx)(o,{}),(0,r.jsxs)("main",{children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n,{}),(0,r.jsx)("div",{className:"flex justify-center pb-20",children:(0,r.jsx)(x,{})})]}),(0,r.jsx)(p,{}),(0,r.jsx)(h,{}),(0,r.jsx)(u,{}),(0,r.jsxs)("section",{className:"py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-linear-to-t from-[#6366f1]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with VansAI. Open source and free to start."}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>e.push("/dashboard"),className:"w-full sm:w-auto h-14 px-10 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-lg font-bold transition-all shadow-[0_0_20px_rgba(99,102,241,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{type:"button",onClick:()=>window.open("https://github.com/Vanszs/VansRouter#readme","_blank"),className:"w-full sm:w-auto h-14 px-10 rounded-lg border border-[#3a2f27] hover:bg-[#1a1433] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(j,{})]})]})}},9214:(e,t,s)=>{Promise.resolve().then(s.bind(s,3035))}},e=>{e.O(0,[3885,9458,2147,3204,7358],()=>e(e.s=9214)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,t,r,a,o,n,c,i,f={},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}},a=!0;try{f[e].call(r.exports,r,r.exports,d),a=!1}finally{a&&delete u[e]}return r.exports}d.m=f,e=[],d.O=(t,r,a,o)=>{if(r){o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[r,a,o];return}for(var c=1/0,n=0;n<e.length;n++){for(var[r,a,o]=e[n],i=!0,f=0;f<r.length;f++)(!1&o||c>=o)&&Object.keys(d.O).every(e=>d.O[e](r[f]))?r.splice(f--,1):(i=!1,o<c&&(c=o));if(i){e.splice(n--,1);var u=a();void 0!==u&&(t=u)}}return t},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a||"object"==typeof e&&e&&(4&a&&e.__esModule||16&a&&"function"==typeof e.then))return e;var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,r)=>(d.f[r](e,t),t),[])),d.u=e=>7236===e?"static/chunks/7236-5d192cf1373fb7b7.js":5737===e?"static/chunks/5737-d18fc416e283bc11.js":"static/chunks/"+e+"."+({406:"11a045def1d3b77b",1049:"fe7b80c5fc82d475",1409:"b9b9883529318ba4",1567:"a91d2debb1187f20",2884:"39a847a6de39184f",3124:"46a9db1d92ccc4c2",3245:"d0758b9d4b1b5e8c",3257:"24031050423940b5",3386:"1d120faabbf9d807",3657:"648ef7012a4a028b",5560:"1044547418430d16",5709:"b74981916470568d",6474:"3878f14b16c23d75",6909:"bd99d4bad9fa33f9",8667:"1195f7bb7f8176aa",9078:"a9009d83d98ff33c",9146:"71dafc04b1c0ad03"})[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},d.l=(e,t,r,o)=>{if(a[e])return void a[e].push(t);if(void 0!==r)for(var n,c,i=document.getElementsByTagName("script"),f=0;f<i.length;f++){var u=i[f];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="_N_E:"+r){n=u;break}}n||(c=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,d.nc&&n.setAttribute("nonce",d.nc),n.setAttribute("data-webpack","_N_E:"+r),n.src=d.tu(e)),a[e]=[t];var l=(t,r)=>{n.onerror=n.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=l.bind(null,n.onerror),n.onload=l.bind(null,n.onload),c&&document.head.appendChild(n)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=()=>(void 0===o&&(o={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o),d.tu=e=>d.tt().createScriptURL(e),d.p="/_next/",n={8068:0,6525:0,186:0,2554:0},d.f.j=(e,t)=>{var r=d.o(n,e)?n[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(186|2554|6525|8068)$/.test(e))n[e]=0;else{var a=new Promise((t,a)=>r=n[e]=[t,a]);t.push(r[2]=a);var o=d.p+d.u(e),c=Error();d.l(o,t=>{if(d.o(n,e)&&(0!==(r=n[e])&&(n[e]=void 0),r)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+a+": "+o+")",c.name="ChunkLoadError",c.type=a,c.request=o,r[1](c)}},"chunk-"+e,e)}},d.O.j=e=>0===n[e],c=(e,t)=>{var r,a,[o,c,i]=t,f=0;if(o.some(e=>0!==n[e])){for(r in c)d.o(c,r)&&(d.m[r]=c[r]);if(i)var u=i(d)}for(e&&e(t);f<o.length;f++)a=o[f],d.o(n,a)&&n[a]&&n[a][0](),n[a]=0;return d.O(u)},(i=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),i.push=c.bind(null,i.push.bind(i))})();
|