switchboard-router 0.9.37 → 0.9.39
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/static/chunks/{1321-e736c179ab757d66.js → 1321-227ff10ac053e663.js} +1 -1
- package/app/{.next-cli-build/static/chunks/1330-86c9bc7148028421.js → .next/static/chunks/1330-e1ec0f07ea113880.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-2050b8c10234b86e.js +1 -0
- package/app/.next/static/chunks/app/layout-26e1615874db4cd7.js +1 -0
- package/app/.next/static/chunks/{webpack-57b54315eb9fa808.js → webpack-0aaec50204921747.js} +1 -1
- package/app/.next/static/css/225b03fdf274c037.css +1 -0
- package/app/{.next-cli-build/static/css/0978fa117f5c78e3.css → .next/static/css/5c8909d9cd96e270.css} +1 -1
- package/app/.next/static/media/0202600ddc0c26b4-s.p.woff2 +0 -0
- package/app/.next/static/media/0332c089697ea3ad-s.p.woff2 +0 -0
- package/app/.next/static/media/124eba111847a60f-s.p.woff2 +0 -0
- package/app/.next/static/media/42c1e8b6f014576e-s.p.woff2 +0 -0
- package/app/.next/static/media/527eba3de31447ec-s.p.woff2 +0 -0
- package/app/.next/static/media/64bcbd4d7db4ef3a-s.p.woff2 +0 -0
- package/app/.next/static/media/a03e0948a34ab92a-s.p.woff2 +0 -0
- 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 +9 -9
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- 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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +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/combos/routing/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- 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 +1 -1
- 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/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/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/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/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 +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- 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 +12 -9
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +12 -9
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/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/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
- 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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
- 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 +2 -2
- 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/cowork-mcp-registry/route.js +1 -1
- 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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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/gemini-cli-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-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 +1 -1
- 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 +2 -2
- 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/cli-tools/pi-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/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/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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/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/routable/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.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.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.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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/defaults/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/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/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/skills/[id]/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/token-saver/vault-stats/route.js.nft.json +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.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.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.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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +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.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 +12 -9
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +12 -9
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
- 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 +12 -9
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +12 -9
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +12 -9
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +12 -9
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- 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 +12 -9
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +12 -9
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
- 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 +13 -10
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +13 -10
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +10 -7
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
- package/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/app/.next-cli-build/server/chunks/1351.js +1 -1
- package/app/.next-cli-build/server/chunks/{3423.js → 2847.js} +1 -1
- package/app/.next-cli-build/server/chunks/3735.js +1 -1
- package/app/.next-cli-build/server/chunks/403.js +1 -1
- package/app/.next-cli-build/server/chunks/{9995.js → 4160.js} +1 -1
- package/app/.next-cli-build/server/chunks/4330.js +1 -1
- package/app/.next-cli-build/server/chunks/5139.js +1 -1
- package/app/.next-cli-build/server/chunks/5195.js +1 -1
- package/app/.next-cli-build/server/chunks/5565.js +1 -1
- package/app/.next-cli-build/server/chunks/5624.js +1 -1
- package/app/.next-cli-build/server/chunks/5717.js +1 -1
- package/app/.next-cli-build/server/chunks/5781.js +2 -2
- package/app/.next-cli-build/server/chunks/7133.js +1 -1
- package/app/.next-cli-build/server/chunks/7201.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8915.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +6 -6
- package/app/.next-cli-build/server/chunks/9261.js +3 -3
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +2 -2
- package/app/.next-cli-build/server/next-font-manifest.js +1 -1
- package/app/.next-cli-build/server/next-font-manifest.json +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/{1321-e736c179ab757d66.js → 1321-227ff10ac053e663.js} +1 -1
- package/app/{.next/static/chunks/1330-86c9bc7148028421.js → .next-cli-build/static/chunks/1330-e1ec0f07ea113880.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2050b8c10234b86e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/layout-26e1615874db4cd7.js +1 -0
- package/app/.next-cli-build/static/chunks/{webpack-57b54315eb9fa808.js → webpack-0aaec50204921747.js} +1 -1
- package/app/.next-cli-build/static/css/225b03fdf274c037.css +1 -0
- package/app/{.next/static/css/0978fa117f5c78e3.css → .next-cli-build/static/css/5c8909d9cd96e270.css} +1 -1
- package/app/.next-cli-build/static/media/0202600ddc0c26b4-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/0332c089697ea3ad-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/124eba111847a60f-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/42c1e8b6f014576e-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/527eba3de31447ec-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/64bcbd4d7db4ef3a-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/a03e0948a34ab92a-s.p.woff2 +0 -0
- package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
- package/app/package.json +1 -1
- package/app/public/fonts/IBM-Plex-LICENSE.txt +93 -0
- package/package.json +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-40db6db68022a0cc.js +0 -1
- package/app/.next/static/chunks/app/layout-1cdcf5d484625046.js +0 -1
- package/app/.next/static/css/5aec38c92e666771.css +0 -1
- package/app/.next/static/media/011e180705008d6f-s.woff2 +0 -0
- package/app/.next/static/media/20535187d867b7b9-s.woff2 +0 -0
- package/app/.next/static/media/26d4368bf94c0ec4-s.p.woff2 +0 -0
- package/app/.next/static/media/2801417b65625cf5-s.woff2 +0 -0
- package/app/.next/static/media/28793f5c5e3d822d-s.woff2 +0 -0
- package/app/.next/static/media/5356a6a4f2c8c8d8-s.woff2 +0 -0
- package/app/.next/static/media/58f386aa6b1a2a92-s.woff2 +0 -0
- package/app/.next/static/media/73cb51aac9c97f90-s.woff2 +0 -0
- package/app/.next/static/media/7b19b489dc6743ba-s.woff2 +0 -0
- package/app/.next/static/media/7ba5fb2a8c88521c-s.woff2 +0 -0
- package/app/.next/static/media/92eeb95d069020cc-s.woff2 +0 -0
- package/app/.next/static/media/98e207f02528a563-s.p.woff2 +0 -0
- package/app/.next/static/media/99dcf268bda04fe5-s.woff2 +0 -0
- package/app/.next/static/media/b3bf17a9041d9433-s.woff2 +0 -0
- package/app/.next/static/media/c9c3823090ec8b55-s.woff2 +0 -0
- package/app/.next/static/media/d26bbd13d6b70f89-s.woff2 +0 -0
- package/app/.next/static/media/d29838c109ef09b4-s.woff2 +0 -0
- package/app/.next/static/media/d3ebbfd689654d3a-s.p.woff2 +0 -0
- package/app/.next/static/media/db96af6b531dc71f-s.p.woff2 +0 -0
- package/app/.next/static/media/e40af3453d7c920a-s.woff2 +0 -0
- package/app/.next/static/media/ef4d5661765d0e49-s.woff2 +0 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-40db6db68022a0cc.js +0 -1
- package/app/.next-cli-build/static/chunks/app/layout-1cdcf5d484625046.js +0 -1
- package/app/.next-cli-build/static/css/5aec38c92e666771.css +0 -1
- package/app/.next-cli-build/static/media/011e180705008d6f-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/20535187d867b7b9-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/26d4368bf94c0ec4-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/2801417b65625cf5-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/28793f5c5e3d822d-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/5356a6a4f2c8c8d8-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/58f386aa6b1a2a92-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/73cb51aac9c97f90-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/7b19b489dc6743ba-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/7ba5fb2a8c88521c-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/92eeb95d069020cc-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/98e207f02528a563-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/99dcf268bda04fe5-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/b3bf17a9041d9433-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/c9c3823090ec8b55-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/d26bbd13d6b70f89-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/d29838c109ef09b4-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/d3ebbfd689654d3a-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/db96af6b531dc71f-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/e40af3453d7c920a-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/ef4d5661765d0e49-s.woff2 +0 -0
- /package/app/.next/static/{FRqKbMdZFJJUhaMdpLFMG → NvDkTo00u9NnH7x0us5x_}/_buildManifest.js +0 -0
- /package/app/.next/static/{FRqKbMdZFJJUhaMdpLFMG → NvDkTo00u9NnH7x0us5x_}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{FRqKbMdZFJJUhaMdpLFMG → NvDkTo00u9NnH7x0us5x_}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{FRqKbMdZFJJUhaMdpLFMG → NvDkTo00u9NnH7x0us5x_}/_ssgManifest.js +0 -0
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`,children:[S.includes(e.name)&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name,(0,r.jsx)("span",{className:"rounded bg-black/10 px-1 py-px text-[9px] font-normal opacity-70 dark:bg-white/10",children:"combo"})]},e.id)})})]}),Object.entries(ea).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)(d.A,{src:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:ee?`(${t.models.length} of ${t.totalModels??t.models.length})`:`(${t.models.length})`})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=l===e.value,a=e.isPlaceholder;return(0,r.jsx)("button",{onClick:()=>er(e),title:a?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
5
5
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
6
|
${a?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-on-primary border-primary":S.includes(e.value)?"bg-primary border-primary text-on-primary hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
-
`,children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[S.includes(e.value)&&!a&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,r.jsx)(c.default,{caps:F(e.value)})]}):(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)(c.default,{caps:F(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(ea).length&&0===Y.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",role:"status",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:ee?`No models match '${T.trim()}'`:"No models found"})]})]})]})}y.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,onSelect:l().func.isRequired,onDeselect:l().func,selectedModel:l().string,activeProviders:l().arrayOf(l().shape({provider:l().string.isRequired})),title:l().string,modelAliases:l().object,kindFilter:l().string,addedModelValues:l().arrayOf(l().string),closeOnSelect:l().bool,selectionHint:l().string,excludeCombo:l().string}},73579:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(92542),c=a(56061),u=a(88105),m=a(98);function x({isOpen:e,connection:t,onSave:a,onClose:n}){let[i,p]=(0,s.useState)({name:"",priority:1,apiKey:"",maxConcurrentRequests:""}),[h,f]=(0,s.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,g]=(0,s.useState)({accountId:""}),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(!1),[N,w]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),[O,I]=(0,s.useState)(null),[A,E]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(t){p({name:t.name||"",priority:t.priority||1,apiKey:"",maxConcurrentRequests:null==t.maxConcurrentRequests?"":String(t.maxConcurrentRequests)}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&g({accountId:t.providerSpecificData.accountId||""});let e=u.Q2?.[t.provider];e?.regions&&y(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),w(null),I(null)}},[t]);let W=t?.authType==="oauth",F=t?.provider==="azure",T=t?.provider==="cloudflare-ai",P=!!t&&((0,u.mq)(t.provider)||(0,u.gb)(t.provider)),M=t&&u.Q2?.[t.provider]?.regions||null,R=()=>{if(M&&v)return{...t?.providerSpecificData||{},region:v}},q=async()=>{if(t?.provider){k(!0),w(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();w(a.valid?"success":"failed")}catch{w("failed")}finally{k(!1)}}},$=async()=>{if(t?.provider&&i.apiKey){S(!0),I(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:i.apiKey,...F?{providerSpecificData:h}:{},...T?{providerSpecificData:b}:{},...M?{providerSpecificData:R()}:{}})}),a=await e.json();I(a.valid?"success":"failed")}catch{I("failed")}finally{S(!1)}}},z=async()=>{if(t){E(!0);try{let e={name:i.name,priority:i.priority,maxConcurrentRequests:""===i.maxConcurrentRequests?null:Math.min(1024,Math.max(1,Number.parseInt(i.maxConcurrentRequests,10)||1))};if(!W&&i.apiKey){e.apiKey=i.apiKey;let a="success"===O;if(!a)try{S(!0),I(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:i.apiKey,...F?{providerSpecificData:h}:{},...T?{providerSpecificData:b}:{},...M?{providerSpecificData:R()}:{}})});a=!!(await e.json()).valid,I(a?"success":"failed")}catch{I("failed")}finally{S(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}F&&(e.providerSpecificData={azureEndpoint:h.azureEndpoint,apiVersion:h.apiVersion,deployment:h.deployment,organization:h.organization}),T&&(e.providerSpecificData={accountId:b.accountId}),M&&v&&(e.providerSpecificData=R()),await a(e)}finally{E(!1)}}};return t?(0,r.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:n,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:i.name,onChange:e=>p({...i,name:e.target.value}),placeholder:W?"Account name":"Production Key"}),W&&t.email&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,r.jsx)("p",{className:"font-medium",children:t.email})]}),(0,r.jsx)(o.default,{label:"Priority",type:"number",min:1,value:i.priority,onChange:e=>p({...i,priority:Number.parseInt(e.target.value,10)||1})}),(0,r.jsx)(o.default,{label:"Concurrent request cap",type:"number",min:1,max:1024,value:i.maxConcurrentRequests,onChange:e=>p({...i,maxConcurrentRequests:e.target.value}),placeholder:"Unlimited",hint:"Blank means unlimited. Balanced scheduler uses this as a process-local best-effort cap based on observed in-flight requests; brief concurrent selections may exceed it."}),!W&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{label:"API Key",type:"password",autoComplete:"off",value:i.apiKey,onChange:e=>p({...i,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(d.default,{onClick:$,disabled:!i.apiKey||C||A,variant:"secondary",children:C?"Checking...":"Check"})})]}),O&&(0,r.jsx)(c.default,{variant:"success"===O?"success":"error",children:"success"===O?"Valid":"Invalid"})]}),F&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"Azure Endpoint",value:h.azureEndpoint,onChange:e=>f({...h,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,r.jsx)(o.default,{label:"Deployment Name",value:h.deployment,onChange:e=>f({...h,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,r.jsx)(o.default,{label:"API Version",value:h.apiVersion,onChange:e=>f({...h,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,r.jsx)(o.default,{label:"Organization",value:h.organization,onChange:e=>f({...h,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),M&&(0,r.jsx)(m.default,{label:"Region",value:v,onChange:e=>y(e.target.value),options:M.map(e=>({value:e.id,label:e.label}))}),!P&&!F&&!T&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:q,variant:"secondary",disabled:j,children:j?"Testing...":"Test Connection"}),N&&(0,r.jsx)(c.default,{variant:"success"===N?"success":"error",children:"success"===N?"Valid":"Failed"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:z,fullWidth:!0,disabled:A,children:A?"Saving...":"Save"}),(0,r.jsx)(d.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,maxConcurrentRequests:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),onSave:i().func.isRequired,onClose:i().func.isRequired}},76361:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(73321),i=a(65921),l=a(92622),o=a(8823),d=a(81127),c=a(77251);function u(){let e=(0,c.I)(e=>e.request),t=(0,c.I)(e=>e.settle);return(0,r.jsx)(d.ConfirmModal,{isOpen:!!e,onClose:()=>t(!1),onConfirm:()=>t(!0),title:e?.title||"Confirm",message:e?.message||"Continue?",confirmText:e?.confirmText||"Confirm",cancelText:e?.cancelText||"Cancel",variant:e?.variant||"danger"})}function m({children:e,endpointHost:t}){let[a,d]=(0,s.useState)(!1),c=(0,n.usePathname)(),x=(0,i.i)(e=>e.notifications),p=(0,i.i)(e=>e.removeNotification),h="/dashboard/basic-chat"===c;return(0,s.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden",style:{background:"#16130E"},children:[(0,r.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",role:"status","aria-live":"polite","aria-relevant":"additions",children:x.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-[#74C08A]/35 bg-[#74C08A]/10 text-[#74C08A]",icon:"check_circle"}:"error"===t?{wrapper:"border-[#E07070]/35 bg-[#E07070]/10 text-[#E07070]",icon:"error"}:"warning"===t?{wrapper:"border-[#E5B454]/35 bg-[#E5B454]/10 text-[#E5B454]",icon:"warning"}:{wrapper:"border-[#8A9EB8]/35 bg-[#8A9EB8]/10 text-[#8A9EB8]",icon:"info"};return(0,r.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${a.wrapper}`,style:{background:"#1E1A13"},..."error"===e.type?{role:"alert"}:{},children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,r.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,r.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,r.jsx)("button",{type:"button",onClick:()=>p(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),(0,r.jsx)(u,{}),a&&(0,r.jsx)("button",{type:"button","aria-label":"Close menu",className:"fixed inset-0 z-40 bg-black/40 lg:hidden cursor-default",onClick:()=>d(!1)}),(0,r.jsx)("div",{className:"hidden lg:flex h-full",children:(0,r.jsx)(l.default,{endpointHost:t})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${a?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(l.default,{endpointHost:t,onClose:()=>d(!1)})}),(0,r.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative isolate",children:[(0,r.jsx)(o.default,{onMenuClick:()=>d(!0)},c),(0,r.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${h?"flex flex-col overflow-hidden":""}`,style:{background:"#16130E"},children:(0,r.jsx)("div",{className:h?"flex-1 w-full h-full flex flex-col":"w-full",style:h?void 0:{padding:22},children:e})})]})]})}},80752:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(40197),o=a(81127);function d({icon:e,label:t,onClick:a,trailing:s,danger:n}){return(0,r.jsxs)("button",{role:"menuitem",onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${n?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[20px] ${n?"":"text-text-muted"}`,children:e}),(0,r.jsx)("span",{className:"flex-1 text-left",children:t}),s&&(0,r.jsx)("span",{className:"text-base",children:s})]})}function c(){let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)(!1),[i,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(!1),x=(0,s.useRef)(null),p=async()=>{m(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}m(!1),c(!1)};return(0,s.useEffect)(()=>{let a=e=>{x.current&&!x.current.contains(e.target)&&t(!1)};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative",ref:x,children:[(0,r.jsx)("button",{onClick:()=>t(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu","aria-label":"Menu","aria-haspopup":"menu","aria-expanded":e,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),e&&(0,r.jsxs)("div",{role:"menu",className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,r.jsx)(d,{icon:"history",label:"Change Log",onClick:()=>{t(!1),n(!0)}}),(0,r.jsx)(d,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{t(!1),c(!0)}})]})]}),(0,r.jsx)(l.default,{isOpen:a,onClose:()=>n(!1)}),(0,r.jsx)(o.ConfirmModal,{isOpen:i,onClose:()=>c(!1),onConfirm:p,title:"Shutdown",message:"Are you sure you want to close the proxy server?",confirmText:"Shutdown",cancelText:"Cancel",variant:"danger",loading:u})]})}d.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>c,default:()=>d});var r=a(95155),s=a(12115),n=a(31474),i=a(92542),l=a(97677),o=a(34131);function d({isOpen:e,onClose:t,title:a,children:i,footer:c,size:u="md",closeOnOverlay:m=!0,showTrafficLights:x=!0,className:p,"aria-label":h}){let f=(0,o.sp)({isOpen:e,onClose:t}),b=(0,s.useId)();return e?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":h,"aria-labelledby":h?void 0:a?b:void 0,tabIndex:-1,className:(0,n.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in","outline-none",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[u],p),children:[(a||x)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[x&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,r.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,r.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,r.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,r.jsx)("h2",{id:b,className:"text-lg font-semibold text-text-main",children:a})]}),(0,r.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),c&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:c})]})]}):null}function c({isOpen:e,onClose:t,onConfirm:a,title:s="Confirm",message:n,confirmText:l="Confirm",cancelText:o="Cancel",variant:u="danger",loading:m=!1}){return(0,r.jsx)(d,{isOpen:e,onClose:t,title:s,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{variant:"ghost",onClick:t,disabled:m,children:o}),(0,r.jsx)(i.default,{variant:u,onClick:a,loading:m,children:l})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:n})})}},81231:(e,t,a)=>{a.d(t,{Iz:()=>l,M0:()=>u,R3:()=>c,qi:()=>m,uJ:()=>o,vK:()=>d});var r=a(36861),s=a(68501),n=a(88105),i=a(97650);function l(e,t=""){return new Set((Array.isArray(e)?e:[]).map(e=>(0,r.v)(e,t)).filter(Boolean))}function o(e,t,a=""){return e.has((0,r.v)(t,a))}function d(e,t){let a=String(t||"").trim().toLowerCase();if(!a)return e||{};let r={};for(let[t,s]of Object.entries(e||{})){let e=Array.isArray(s?.models)?s.models:[];if(s?.name&&String(s.name).toLowerCase().includes(a)){r[t]={...s,models:[...e]};continue}let n=e.filter(e=>String(e?.name||"").toLowerCase().includes(a)||String(e?.id||"").toLowerCase().includes(a)||String(e?.value||"").toLowerCase().includes(a));0!==n.length&&(r[t]={...s,models:n})}return r}function c({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:r=[],type:l="llm",includeLegacyAliases:o=!0,legacyStorageAliases:d=[]}){let u=new Set(r.map(e=>e.id)),m=new Set,x=[],p=new Set([a,...d.filter(e=>"string"==typeof e&&e&&e!==a)]),h=a?n.js[a]:null;h&&(p.add(h),i.Xg[h]&&p.add(i.Xg[h]));let f=new Set(e.filter(e=>e?.providerAlias===a).map(e=>e?.id));for(let t of e){if(!t?.id||!p.has(t.providerAlias)||t.providerAlias!==a&&f.has(t.id))continue;let e=(0,s.ki)(t?.kind||t?.type||"llm");if(l&&e!==l||u.has(t.id))continue;let r=`${a}/${t.id}`;m.has(r)||(m.add(r),x.push({id:t.id,name:t.name||t.id,fullModel:r,source:"custom",type:e}))}if(!o)return x;let b=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(b))continue;let t=a.slice(b.length);!t||u.has(t)||m.has(a)||(m.add(a),x.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:l||"llm"}))}return x}function u({providerAlias:e,builtInModels:t=[],customModels:a=[],modelAliases:r={},liveModels:s=[],liveCatalogLoaded:n=!1,legacyStorageAliases:i=[]}){let l=[],o=new Map,d=e=>{!e?.id||!e?.value||o.has(e.value)||(o.set(e.value,e),l.push(e))};for(let a of t)a?.id&&d({...a,name:a.name||a.id,value:`${e}/${a.id}`});for(let s of c({customModels:a,modelAliases:r,providerAlias:e,builtInModels:t,type:"llm",legacyStorageAliases:i}))d({id:s.id,name:s.name||s.alias||s.id,value:s.fullModel,type:s.type,isCustom:!0});if(!n)return l;let m=[],x=new Set,p=`${e}/`;for(let e of s){if("string"!=typeof e?.id||!e.id.startsWith(p))continue;let t=e.id.slice(p.length);if(!t||x.has(e.id))continue;x.add(e.id);let a=o.get(e.id);m.push({...a||{},id:t,name:e.name||a?.name||t,value:e.id,kind:e.kind||a?.kind,capabilities:e.capabilities||a?.capabilities,isCustom:a?.isCustom===!0})}return m}function m({providerId:e,providerAlias:t,customModels:a=[],modelAliases:r={},liveModels:s=[],liveCatalogLoaded:n=!1}){let i=new Map,l=[],o=e=>{!e?.id||!e?.value||i.has(e.value)||(i.set(e.value,e),l.push(e))};for(let[a,s]of Object.entries(r||{})){let r=`${e}/`;if("string"!=typeof s||!s.startsWith(r))continue;let n=s.slice(r.length);o({id:n,name:a,value:`${t}/${n}`})}for(let r of a)r?.id&&r.providerAlias===e&&o({id:r.id,name:r.name||r.id,value:`${t}/${r.id}`,isCustom:!0});if(!n)return l;let d=`${t}/`,c=[],u=new Set;for(let e of s){if("string"!=typeof e?.id||!e.id.startsWith(d)||u.has(e.id))continue;let t=e.id.slice(d.length);if(!t)continue;u.add(e.id);let a=i.get(e.id);c.push({...a||{},id:t,name:e.name||a?.name||t,value:e.id,kind:e.kind||a?.kind,capabilities:e.capabilities||a?.capabilities,isCustom:a?.isCustom===!0})}return c.length>0?c:l}},90882:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(11059),u=a(78559);function m({isOpen:e,provider:t,providerInfo:a,onSuccess:n,onClose:i,oauthMeta:x,idcConfig:p}){let[h,f]=(0,s.useState)("waiting"),[b,g]=(0,s.useState)(null),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(null),[O,I]=(0,s.useState)(!1),A=(0,s.useRef)(null),E=(0,s.useRef)(!1),W=(0,s.useRef)(0),F=(0,s.useRef)(!1),{copied:T,copy:P}=(0,c.C)(),[M,R]=(0,s.useState)(!1),[q,$]=(0,s.useState)("/callback?code=..."),z=(0,s.useRef)(!1);(0,s.useEffect)(()=>{R("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),$(`${window.location.origin}/callback?code=...`)},[]);let L=(0,s.useCallback)(async(e,a)=>{if(b)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:b.redirectUri,codeVerifier:b.codeVerifier,state:a,...x?{meta:x}:{}})}),s=await r.json();if(!r.ok)throw Error(s.error);f("success"),n?.()}catch(e){k(e.message),f("error")}},[b,t,n,x]),_=(0,s.useCallback)(async e=>{if(b?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:b.state})}),a=await t.json();if(!t.ok)throw Error(a.error);f("success"),n?.()}catch(e){k(e.message),f("error")}},[b,n]),D=(0,s.useCallback)(async(e,a,r,s,i,l)=>{E.current=!1,I(!0);let o=Date.now()+(Number.isFinite(i)&&i>0?i:12e4);for(;Date.now()<o;){if(E.current||l!==W.current||(await new Promise(e=>setTimeout(e,1e3*r)),E.current||l!==W.current))return void I(!1);try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:s})}),o=await i.json();if(l!==W.current)return;if(o.success){E.current=!0,f("success"),I(!1),n?.();return}if("expired_token"===o.error||"access_denied"===o.error)throw Error(o.errorDescription||o.error);"slow_down"===o.error&&(r=Math.min(r+5,30))}catch(e){k(e.message),f("error"),I(!1);return}}k("Authorization timeout"),f("error"),I(!1)},[t,n]),U=(0,s.useCallback)(async()=>{if(!t)return;let e=++W.current;try{let a;if(k(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy-cn","qoder","grok-cli","muse"].includes(t)){w(!0),f("waiting");let a=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&p?.startUrl&&(a.searchParams.set("start_url",p.startUrl),p.region&&a.searchParams.set("region",p.region),a.searchParams.set("auth_method","idc"));let r=await fetch(a.toString()),s=await r.json();if(e!==W.current)return;if(!r.ok)throw Error(s.error);S(s);let n=s.verification_uri_complete||s.verification_uri;n&&window.open(n,"_blank","noopener,noreferrer");let i="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl,_profileArn:p?.profileArn}:"qoder"===t?{_qoderNonce:s._qoderNonce,_qoderMachineId:s._qoderMachineId,_qoderVerifier:s.codeVerifier}:"kimi-coding"===t?{_kimiDeviceId:s._kimiDeviceId}:null;D(s.device_code,s.codeVerifier,s.interval||5,i,Number.isFinite(s.expires_in)&&s.expires_in>0?1e3*s.expires_in:void 0,e);return}let r=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${r}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",a),x&&Object.entries(x).forEach(([e,t])=>{t&&"clientSecret"!==e&&s.searchParams.set(e,t)});let n=await fetch(s.toString()),i=await n.json();if(e!==W.current)return;if(!n.ok)throw Error(i.error);let l=!1,o=!1;if("codex"===t)try{let e=new URL("/api/oauth/codex/start-proxy",window.location.origin);e.searchParams.set("app_port",r),e.searchParams.set("state",i.state),e.searchParams.set("code_verifier",i.codeVerifier),e.searchParams.set("redirect_uri",a);let t=await fetch(e.toString()),s=await t.json();l=s.success,o=!!s.serverSide}catch{l=!1}let d=!1,c=!1;if("xai"===t)try{let e=new URL("/api/oauth/xai/start-proxy",window.location.origin);e.searchParams.set("app_port",r),e.searchParams.set("state",i.state),e.searchParams.set("code_verifier",i.codeVerifier),e.searchParams.set("redirect_uri",a);let t=await fetch(e.toString()),s=await t.json();if(d=s.success,c=!!s.serverSide,!d&&"port_busy"===s.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;d=!1}if(e!==W.current)return;g({...i,redirectUri:a,codexServerSide:o,xaiServerSide:c}),"codex"===t&&l||"xai"===t&&d||M&&"codex"!==t&&"xai"!==t?(f("waiting"),A.current=window.open(i.authUrl,"oauth_popup","width=600,height=700"),A.current||f("input")):(f("input"),window.open(i.authUrl,"_blank"))}catch(t){if(e!==W.current)return;k(t.message),f("error")}},[t,M,D,x,p]);(0,s.useEffect)(()=>{e&&t?F.current||(F.current=!0,g(null),y(""),k(null),w(!1),S(null),I(!1),E.current=!1,U()):e||(W.current+=1,E.current=!0,F.current=!1,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,U]),(0,s.useEffect)(()=>{let e=b?.codexServerSide?"codex":b?.xaiServerSide?"xai":null;if(!e||!b?.state||z.current)return;let t=!1,a=0,r=async()=>{if(!t&&!z.current){a+=1;try{let a=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(b.state)}`),r=await a.json();if(t||z.current)return;if("done"===r.status){z.current=!0,f("success"),n?.();return}if("error"===r.status){z.current=!0,k(r.error||"Authentication failed"),f("error");return}}catch{}if(a>=200){z.current=!0,k("Authentication timeout"),f("error");return}setTimeout(r,1500)}};return setTimeout(r,1500),()=>{t=!0}},[b,n]),(0,s.useEffect)(()=>{let e;if(!b)return;z.current=!1;let t=async e=>{if(z.current)return;let{code:t,token:a,state:r,error:s,errorDescription:n}=e;if(s){z.current=!0,k(n||s),f("error");return}(a||t)&&(z.current=!0,await L(a||t,r))},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(a||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){(0,u.s)("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",r),e&&e.close()}},[b,L]);let K=async()=>{try{k(null);let e=v.trim();if(e.startsWith("eyJ")&&e.includes("."))return void await L(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await _(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await L(e,null);let a=new URL(e),r=a.searchParams.get("code"),s=a.searchParams.get("token"),n=a.searchParams.get("state"),i=a.searchParams.get("error");if(i)throw Error(a.searchParams.get("error_description")||i);if(!r&&!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await L(s||r,n)}catch(e){k(e.message),f("error")}},B=(0,s.useCallback)(()=>{W.current+=1,E.current=!0,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),i()},[i,t]);if(!t||!a)return null;let V="xai"===t,J="kimchi"===t,G=C?.verification_uri_complete||C?.verification_uri||"",H=V?"Connect Grok Build OAuth":`Connect ${a.name}`,Q=V?"http://127.0.0.1:56121/callback?code=... or copied code":J?`${q.replace("code=...","token=...")} or copied token`:q;return(0,r.jsx)(l.default,{isOpen:e,title:H,onClose:B,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===h||"input"===h)&&!N&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:V?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,r.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,r.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",V?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{value:b?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(o.default,{variant:"secondary",icon:"auth_url"===T?"check":"content_copy",onClick:()=>P(b?.authUrl,"auth_url"),disabled:!b?.authUrl,children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":J?"callback URL or copied token":"callback URL"," here"]}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":J?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,r.jsx)(d.default,{value:v,onChange:e=>y(e.target.value),placeholder:Q,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:K,fullWidth:!0,disabled:!v,children:"Connect"}),(0,r.jsx)(o.default,{onClick:B,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===h&&N&&C&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:G}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"login_url"===T?"check":"content_copy",onClick:()=>P(G,"login_url"),disabled:!G}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(G,"_blank","noopener,noreferrer"),disabled:!G,children:"Open"})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:C.user_code}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"user_code"===T?"check":"content_copy",onClick:()=>P(C.user_code,"user_code")})]})]})]}),O&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,r.jsx)(o.default,{onClick:B,fullWidth:!0,children:"Done"})]}),"error"===h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:j}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:U,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(o.default,{onClick:B,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}m.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string,profileArn:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),s=a(14051),n=a.n(s),i=a(61929);function l({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(i.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}l.propTypes={children:n().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(98500),n=a.n(s),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),s=a(31474);let n={primary:"bg-brand-500 hover:bg-brand-400 text-[#1B1710] border border-brand-500/80 shadow-sm disabled:bg-surface-3 disabled:text-text-muted disabled:border-transparent",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40 bg-transparent",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main border border-transparent",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-8 px-3 text-xs rounded-[7px]",md:"h-9 px-3.5 text-sm rounded-[8px]",lg:"h-11 px-5 text-sm rounded-[10px]"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:u=!1,fullWidth:m=!1,className:x,...p}){return(0,r.jsxs)("button",{type:"button",className:(0,s.cn)("inline-flex items-center justify-center gap-1.5 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",n[t],i[a],m&&"w-full",x),disabled:c||u,...p,children:[u?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none animate-spin shrink-0",style:{fontSize:18},children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none shrink-0",style:{fontSize:18},children:o}):null,e?(0,r.jsx)("span",{className:"leading-none",children:e}):null,d&&!u?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none shrink-0",style:{fontSize:18},children:d}):null]})}},92622:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(98500),o=a.n(l),d=a(73321),c=a(90620),u=a(11059),m=a(52337),x=a(31474),p=a(81127);function h(){let{pending:e}=(0,l.useLinkStatus)();return(0,r.jsx)("span",{"aria-hidden":"true",className:(0,x.cn)("console-nav-dot",e&&"animate-pulse")})}let f=null,b=[{id:"operate",label:"Operate",items:[{href:"/dashboard",label:"Overview",match:e=>"/dashboard"===e},{href:"/dashboard/basic-chat",label:"Chat",match:e=>e.startsWith("/dashboard/basic-chat")},{href:"/dashboard/combos",label:"Combos",match:e=>e.startsWith("/dashboard/combos")},{href:"/dashboard/usage",label:"Usage",match:e=>e.startsWith("/dashboard/usage")},{href:"/dashboard/quota",label:"Quota",match:e=>e.startsWith("/dashboard/quota")}]},{id:"connect",label:"Connect",items:[{href:"/dashboard/providers",label:"Providers",match:e=>e.startsWith("/dashboard/providers")},{href:"/dashboard/endpoint",label:"Endpoint & keys",match:e=>e.startsWith("/dashboard/endpoint")}]},{id:"tools",label:"Tools",items:[{href:"/dashboard/token-saver",label:"Token saver",match:e=>e.startsWith("/dashboard/token-saver")},{href:"/dashboard/media-providers",label:"Media",match:e=>e.startsWith("/dashboard/media-providers")},{href:"/dashboard/skills",label:"Skills",match:e=>e.startsWith("/dashboard/skills")},{href:"/dashboard/agent-library",label:"Agent library",match:e=>e.startsWith("/dashboard/agent-library")},{href:"/dashboard/cli-tools",label:"CLI tools",match:e=>e.startsWith("/dashboard/cli-tools")},{href:"/dashboard/profile",label:"Settings",match:e=>e.startsWith("/dashboard/profile")}]}];function g({onClose:e,endpointHost:t}){let a=(0,d.usePathname)(),[n,i]=(0,s.useState)(!1),[l,x]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),[j,k]=(0,s.useState)(!1),[N,w]=(0,s.useState)(0),C=(0,s.useRef)(null),{online:S}=(0,m._)(),O=n||!S,[I,A]=(0,s.useState)(t||`127.0.0.1:${c.h0.appPort}`),{copied:E,copy:W}=(0,u.C)(2e3),F=c.h0.installCmdLatest;(0,s.useEffect)(()=>{A(window.location.host||`127.0.0.1:${c.h0.appPort}`)},[]),(0,s.useEffect)(()=>{(!f&&(f=fetch("/api/version").then(e=>e.json()).catch(()=>null)),f).then(e=>{x(e||null)}).catch(()=>{x(null)})},[]);let T=l&&!0===l.hasUpdate&&l.latestVersion&&l.currentVersion&&l.latestVersion!==l.currentVersion?l:null,P=async()=>{if(C.current)return;try{await navigator.clipboard.writeText(F)}catch{}W(F);let e=c.h0.shutdownCountdownSec;w(e),C.current=setInterval(()=>{w(e-=1),e<=0&&(clearInterval(C.current),C.current=null,fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),i(!0))},1e3)};return(0,s.useEffect)(()=>()=>{C.current&&clearInterval(C.current)},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"flex flex-col min-h-full",style:{width:236,flex:"0 0 236px",background:"#1A160F",borderRight:"1px solid #332C1E"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-[11px]",style:{padding:"16px 18px",borderBottom:"1px solid #2A2418"},children:[(0,r.jsxs)(o(),{href:"/dashboard",onClick:e,prefetch:!1,className:"flex items-center gap-[11px] min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center justify-center shrink-0",style:{width:27,height:27,borderRadius:7,background:"#E5B454",color:"#1B1710",fontWeight:700,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:15},children:"S"}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0",style:{lineHeight:1.15},children:[(0,r.jsx)("span",{style:{fontWeight:600,fontSize:14,letterSpacing:"0.2px",color:"#ECE4D2"},children:c.vQ.name}),(0,r.jsxs)("span",{style:{fontSize:10.5,color:"var(--color-text-subtle)",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},title:l?.currentVersion?`Switchboard v${l.currentVersion}${l.latestVersion?` (latest: v${l.latestVersion})`:""}`:void 0,children:[l?.currentVersion?`v${l.currentVersion} \xb7 `:"","routing gateway"]})]})]}),e?(0,r.jsx)("button",{type:"button",onClick:e,className:"lg:hidden ml-auto text-text-subtle hover:text-[#ECE4D2]","aria-label":"Close menu",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})}):null]}),T&&(0,r.jsxs)("div",{className:"mx-2.5 mt-2 rounded-lg border border-[#332C1E] bg-[#211C14] px-2.5 py-2",children:[(0,r.jsxs)("span",{className:"text-[11px] font-semibold text-[#E5B454]",children:["↑ v",T.latestVersion," available"]}),(0,r.jsx)("button",{type:"button",onClick:()=>y(!0),className:"mt-1 block text-[11px] text-[#A99E86] hover:text-[#E5B454]",children:"Update now"})]}),(0,r.jsxs)("nav",{className:"flex-1 overflow-y-auto custom-scrollbar flex flex-col",style:{padding:"12px 10px",gap:2},children:[b.map(t=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"console-nav-section",children:t.label}),t.items.map(t=>{let s=t.match(a);return(0,r.jsxs)(o(),{href:t.href,onClick:e,prefetch:!1,className:"console-nav-item","data-active":s?"true":"false","aria-current":s?"page":void 0,children:[(0,r.jsx)(h,{}),t.label]},t.href)})]},t.id)),(0,r.jsxs)("div",{style:{marginTop:16,padding:"11px 12px",border:"1px dashed #332C1E",borderRadius:8},children:[(0,r.jsx)("div",{style:{fontSize:10,letterSpacing:"1.4px",color:"var(--color-text-subtle)",textTransform:"uppercase",fontWeight:600,marginBottom:6},children:"Diagnostics"}),(0,r.jsxs)("div",{style:{fontSize:11,color:"var(--color-text-subtle)",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",lineHeight:1.7},children:[(0,r.jsx)(o(),{href:"/dashboard/console-log",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"console"})," \xb7 ",(0,r.jsx)(o(),{href:"/dashboard/translator",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"translator"})," \xb7 ",(0,r.jsx)(o(),{href:"/dashboard/mitm",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"mitm"})]})]})]}),(0,r.jsx)("div",{style:{padding:12,borderTop:"1px solid #2A2418"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",style:{background:"#211C14",border:"1px solid #2A2418",borderRadius:8,padding:"9px 11px"},children:[(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)("span",{style:{fontSize:9.5,letterSpacing:"1px",color:"var(--color-text-subtle)",textTransform:"uppercase"},children:"Endpoint"}),(0,r.jsx)("span",{className:"truncate",style:{fontSize:11,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",color:"#A99E86"},children:I})]}),(0,r.jsx)("span",{className:O?"console-offline-dot":"console-online-dot",title:O?"offline":"online",role:"status","aria-label":O?"Gateway offline":"Gateway online",children:(0,r.jsx)("span",{className:"sr-only",children:O?"offline":"online"})})]})})]}),(0,r.jsx)(p.ConfirmModal,{isOpen:v,onClose:()=>y(!1),onConfirm:()=>{y(!1),k(!0)},title:"Update Switchboard",message:"Copy the install command and restart the server after update.",confirmText:"Continue"}),j&&(0,r.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50 p-4",children:(0,r.jsxs)("div",{className:"card-soft max-w-md w-full p-5 space-y-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Manual update"}),(0,r.jsx)("code",{className:"block text-[11px] font-mono text-primary break-all bg-surface-2 p-2 rounded",children:F}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:P,disabled:N>0,className:"px-3 py-1.5 rounded-lg bg-primary text-[#1B1710] text-xs font-semibold disabled:opacity-60",children:[E?"Copied":"Copy & shutdown",N>0?` (${N})`:""]}),(0,r.jsx)("button",{type:"button",onClick:()=>{C.current&&(clearInterval(C.current),C.current=null),k(!1),w(0)},className:"px-3 py-1.5 rounded-lg border border-border text-text-muted text-xs",children:"Cancel"})]}),n&&(0,r.jsx)("p",{className:"text-[11px] text-text-subtle font-mono",children:"Server shutting down…"})]})})]})}g.propTypes={onClose:i().func}},94230:(e,t,a)=>{a.d(t,{default:()=>u});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(11059);function u({isOpen:e,provider:t,onSuccess:a,onClose:n}){let[i,m]=(0,s.useState)("loading"),[x,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(null),[b,g]=(0,s.useState)(""),[v,y]=(0,s.useState)(null),{copied:j,copy:k}=(0,c.C)(),N=(0,s.useRef)(!1);(0,s.useEffect)(()=>{e||(N.current=!1)},[e]),(0,s.useEffect)(()=>{e&&t&&(async()=>{try{y(null),m("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);f(a),p(a.authUrl),m("input"),N.current||(N.current=!0,window.open(a.authUrl,"_blank"))}catch(e){y(e.message),m("error")}})()},[e,t]);let w=async()=>{try{let e;y(null);try{e=new URL(b)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let s=e.searchParams.get("error");if(s)throw Error(e.searchParams.get("error_description")||s);if(!r)throw Error("No authorization code found in URL");let n=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:h.codeVerifier,provider:t})}),i=await n.json();if(!n.ok)throw Error(i.error);m("success"),a?.()}catch(e){y(e.message),m("error")}},C="google"===t?"Google":"GitHub";return(0,r.jsx)(l.default,{isOpen:e,title:`Connect Kiro via ${C}`,onClose:n,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",C," authentication"]})]}),"input"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{value:x,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(o.default,{variant:"secondary",icon:"auth_url"===j?"check":"content_copy",onClick:()=>k(x,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(d.default,{value:b,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:w,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(o.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",C," has been connected."]}),(0,r.jsx)(o.default,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:v}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:()=>m("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(o.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}u.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(90882);let u="https://gitlab.com";function m({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let i,[x,p]=(0,s.useState)(null),[h,f]=(0,s.useState)(u),[b,g]=(0,s.useState)(""),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(null),[O,I]=(0,s.useState)(!1),[A,E]=(0,s.useState)(null),W=()=>{p(null),f(u),g(""),y(""),k(""),S(null),w(!1),I(!1),E(null),n()},F=async()=>{if(!j.trim())return void S("Personal Access Token is required");w(!0),S(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j.trim(),baseUrl:h.trim()||u})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),W()}catch(e){S(e.message)}finally{w(!1)}};return e?O&&A?(0,r.jsx)(c.default,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:A,onSuccess:()=>{a?.(),W()},onClose:()=>{I(!1),E(null)}}):(0,r.jsx)(l.default,{isOpen:e,title:"Connect GitLab Duo",onClose:W,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("button",{onClick:()=>p("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,r.jsxs)("button",{onClick:()=>p("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,r.jsx)("a",{href:`${h.trim()||u}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,r.jsx)(d.default,{label:"GitLab Base URL",value:h,onChange:e=>f(e.target.value),placeholder:u}),(0,r.jsx)(d.default,{label:"Client ID",value:b,onChange:e=>g(e.target.value),placeholder:"Your OAuth application client ID"}),(0,r.jsx)(d.default,{label:"Client Secret (optional for PKCE)",value:v,onChange:e=>y(e.target.value),placeholder:"Leave empty for public PKCE app"}),C&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:C}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:()=>{b.trim()?(S(null),E({baseUrl:h.trim()||u,clientId:b.trim(),clientSecret:v.trim()}),I(!0)):S("Client ID is required")},fullWidth:!0,disabled:!b.trim(),children:"Authorize"}),(0,r.jsx)(o.default,{onClick:()=>{p(null),S(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,r.jsx)("a",{href:`${h.trim()||u}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,r.jsx)(d.default,{label:"GitLab Base URL",value:h,onChange:e=>f(e.target.value),placeholder:u}),(0,r.jsx)(d.default,{label:"Personal Access Token",value:j,onChange:e=>k(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),C&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:C}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:F,fullWidth:!0,disabled:!j.trim()||N,loading:N,children:"Connect"}),(0,r.jsx)(o.default,{onClick:()=>{p(null),S(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}m.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(92542),c=a(56061),u=a(78559);let m="https://api.openai.com/v1";function x({isOpen:e,onClose:t,onCreated:a,onSaved:n,node:i}){let p=!!i,[h,f]=(0,s.useState)({name:"",baseUrl:m}),[b,g]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null),[j,k]=(0,s.useState)(""),[N,w]=(0,s.useState)(""),[C,S]=(0,s.useState)(!1),[O,I]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(I(null),y(null),k(""),w(""),p?f({name:i.name||"",baseUrl:i.baseUrl||m}):f({name:"",baseUrl:m}))},[e,p,i]);let A=async()=>{if(h.name.trim()&&h.baseUrl.trim()){g(!0),y(null);try{let e=p?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=p?"PUT":"POST",r={name:h.name.trim(),baseUrl:h.baseUrl.trim()};p||(r.type="custom-embedding");let s=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),l=null;try{l=await s.json()}catch{l=null}if(s.ok)p?n?.(l?.node):a?.(l?.node);else{let e=l?.error||`Failed to save custom embedding (${s.status})`;y(e),(0,u.s)(e)}}catch(t){let e="Error saving custom embedding node";y(e),(0,u.s)(`${e}:`,t)}finally{g(!1)}}},E=async()=>{S(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:j,type:"custom-embedding",modelId:N.trim()||void 0})}),t=await e.json();I(t)}catch{I({valid:!1,error:"Network error"})}finally{S(!1)}};return(0,r.jsx)(l.default,{isOpen:e,title:p?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:h.name,onChange:e=>f({...h,name:e.target.value}),placeholder:"Voyage AI",hint:"Friendly label for this embedding provider."}),(0,r.jsx)(o.default,{label:"Base URL",value:h.baseUrl,onChange:e=>f({...h,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"OpenAI-compatible embeddings base URL (Voyage, Cohere, Jina, Mistral…)."}),p&&i?.prefix?(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Model IDs use prefix ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded font-mono",children:i.prefix})," ","(auto-assigned)."]}):null,(0,r.jsx)(o.default,{label:"API Key (for Check)",type:"password",autoComplete:"off",value:j,onChange:e=>k(e.target.value)}),(0,r.jsx)(o.default,{label:"Model ID (for Check)",value:N,onChange:e=>w(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0",hint:"Required for validation. Sends a small embeddings request."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:E,disabled:!j||!N.trim()||C||!h.baseUrl.trim(),variant:"secondary",children:C?"Checking...":"Check"}),(()=>{if(!O)return null;let{valid:e,error:t,dimensions:a}=O;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{variant:"success",children:"Valid"}),a&&(0,r.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(c.default,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),v&&(0,r.jsx)("div",{role:"alert",className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:v})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:A,fullWidth:!0,disabled:!h.name.trim()||!h.baseUrl.trim()||b,children:b?p?"Saving...":"Creating...":p?"Save":"Create"}),(0,r.jsx)(d.default,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}x.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97677:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(12115);function n({text:e,children:t,position:a="top",color:i}){let l=(0,s.useId)(),o=i?"":"bg-gray-900",d=(0,s.isValidElement)(t)?(0,s.cloneElement)(t,{"aria-describedby":[t.props["aria-describedby"],l].filter(Boolean).join(" ")}):t;return(0,r.jsxs)("div",{className:"relative inline-flex group/tt",children:[d,(0,r.jsx)("div",{id:l,role:"tooltip",className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${o} text-white opacity-0 group-hover/tt:opacity-100 group-has-focus-visible/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:i?{backgroundColor:i}:{},children:e})]})}},98542:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d,title:c,"aria-label":u}){let m={sm:{track:"w-8 h-4",thumb:"size-3",on:"translate-x-4",off:"translate-x-0.5"},md:{track:"w-11 h-6",thumb:"size-5",on:"translate-x-5",off:"translate-x-0.5"},lg:{track:"w-14 h-7",thumb:"size-6",on:"translate-x-7",off:"translate-x-0.5"}},x=m[o]||m.md;return(0,r.jsxs)("div",{className:(0,s.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":u,title:c,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,s.cn)("relative inline-flex shrink-0 cursor-pointer items-center rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/35",e?"bg-brand-500":"bg-surface-3 border border-border",x.track,l&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,s.cn)("pointer-events-none inline-block rounded-full shadow-sm",e?"bg-[#1B1710]":"bg-[#ECE4D2]","transform transition duration-200 ease-in-out",e?x.on:x.off,x.thumb,"mt-0.5")})}),(a||i)&&(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[a&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
|
7
|
+
`,children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[S.includes(e.value)&&!a&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,r.jsx)(c.default,{caps:F(e.value)})]}):(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)(c.default,{caps:F(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(ea).length&&0===Y.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",role:"status",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:ee?`No models match '${T.trim()}'`:"No models found"})]})]})]})}y.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,onSelect:l().func.isRequired,onDeselect:l().func,selectedModel:l().string,activeProviders:l().arrayOf(l().shape({provider:l().string.isRequired})),title:l().string,modelAliases:l().object,kindFilter:l().string,addedModelValues:l().arrayOf(l().string),closeOnSelect:l().bool,selectionHint:l().string,excludeCombo:l().string}},73579:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(92542),c=a(56061),u=a(88105),m=a(98);function x({isOpen:e,connection:t,onSave:a,onClose:n}){let[i,p]=(0,s.useState)({name:"",priority:1,apiKey:"",maxConcurrentRequests:""}),[h,f]=(0,s.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,g]=(0,s.useState)({accountId:""}),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(!1),[N,w]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),[O,I]=(0,s.useState)(null),[A,E]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(t){p({name:t.name||"",priority:t.priority||1,apiKey:"",maxConcurrentRequests:null==t.maxConcurrentRequests?"":String(t.maxConcurrentRequests)}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&g({accountId:t.providerSpecificData.accountId||""});let e=u.Q2?.[t.provider];e?.regions&&y(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),w(null),I(null)}},[t]);let W=t?.authType==="oauth",F=t?.provider==="azure",T=t?.provider==="cloudflare-ai",P=!!t&&((0,u.mq)(t.provider)||(0,u.gb)(t.provider)),M=t&&u.Q2?.[t.provider]?.regions||null,R=()=>{if(M&&v)return{...t?.providerSpecificData||{},region:v}},q=async()=>{if(t?.provider){k(!0),w(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();w(a.valid?"success":"failed")}catch{w("failed")}finally{k(!1)}}},$=async()=>{if(t?.provider&&i.apiKey){S(!0),I(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:i.apiKey,...F?{providerSpecificData:h}:{},...T?{providerSpecificData:b}:{},...M?{providerSpecificData:R()}:{}})}),a=await e.json();I(a.valid?"success":"failed")}catch{I("failed")}finally{S(!1)}}},z=async()=>{if(t){E(!0);try{let e={name:i.name,priority:i.priority,maxConcurrentRequests:""===i.maxConcurrentRequests?null:Math.min(1024,Math.max(1,Number.parseInt(i.maxConcurrentRequests,10)||1))};if(!W&&i.apiKey){e.apiKey=i.apiKey;let a="success"===O;if(!a)try{S(!0),I(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:i.apiKey,...F?{providerSpecificData:h}:{},...T?{providerSpecificData:b}:{},...M?{providerSpecificData:R()}:{}})});a=!!(await e.json()).valid,I(a?"success":"failed")}catch{I("failed")}finally{S(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}F&&(e.providerSpecificData={azureEndpoint:h.azureEndpoint,apiVersion:h.apiVersion,deployment:h.deployment,organization:h.organization}),T&&(e.providerSpecificData={accountId:b.accountId}),M&&v&&(e.providerSpecificData=R()),await a(e)}finally{E(!1)}}};return t?(0,r.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:n,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:i.name,onChange:e=>p({...i,name:e.target.value}),placeholder:W?"Account name":"Production Key"}),W&&t.email&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,r.jsx)("p",{className:"font-medium",children:t.email})]}),(0,r.jsx)(o.default,{label:"Priority",type:"number",min:1,value:i.priority,onChange:e=>p({...i,priority:Number.parseInt(e.target.value,10)||1})}),(0,r.jsx)(o.default,{label:"Concurrent request cap",type:"number",min:1,max:1024,value:i.maxConcurrentRequests,onChange:e=>p({...i,maxConcurrentRequests:e.target.value}),placeholder:"Unlimited",hint:"Blank means unlimited. Balanced scheduler uses this as a process-local best-effort cap based on observed in-flight requests; brief concurrent selections may exceed it."}),!W&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{label:"API Key",type:"password",autoComplete:"off",value:i.apiKey,onChange:e=>p({...i,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(d.default,{onClick:$,disabled:!i.apiKey||C||A,variant:"secondary",children:C?"Checking...":"Check"})})]}),O&&(0,r.jsx)(c.default,{variant:"success"===O?"success":"error",children:"success"===O?"Valid":"Invalid"})]}),F&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"Azure Endpoint",value:h.azureEndpoint,onChange:e=>f({...h,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,r.jsx)(o.default,{label:"Deployment Name",value:h.deployment,onChange:e=>f({...h,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,r.jsx)(o.default,{label:"API Version",value:h.apiVersion,onChange:e=>f({...h,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,r.jsx)(o.default,{label:"Organization",value:h.organization,onChange:e=>f({...h,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),M&&(0,r.jsx)(m.default,{label:"Region",value:v,onChange:e=>y(e.target.value),options:M.map(e=>({value:e.id,label:e.label}))}),!P&&!F&&!T&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:q,variant:"secondary",disabled:j,children:j?"Testing...":"Test Connection"}),N&&(0,r.jsx)(c.default,{variant:"success"===N?"success":"error",children:"success"===N?"Valid":"Failed"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:z,fullWidth:!0,disabled:A,children:A?"Saving...":"Save"}),(0,r.jsx)(d.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,maxConcurrentRequests:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),onSave:i().func.isRequired,onClose:i().func.isRequired}},76361:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(73321),i=a(65921),l=a(92622),o=a(8823),d=a(81127),c=a(77251);function u(){let e=(0,c.I)(e=>e.request),t=(0,c.I)(e=>e.settle);return(0,r.jsx)(d.ConfirmModal,{isOpen:!!e,onClose:()=>t(!1),onConfirm:()=>t(!0),title:e?.title||"Confirm",message:e?.message||"Continue?",confirmText:e?.confirmText||"Confirm",cancelText:e?.cancelText||"Cancel",variant:e?.variant||"danger"})}function m({children:e,endpointHost:t}){let[a,d]=(0,s.useState)(!1),c=(0,n.usePathname)(),x=(0,i.i)(e=>e.notifications),p=(0,i.i)(e=>e.removeNotification),h="/dashboard/basic-chat"===c;return(0,s.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden",style:{background:"#16130E"},children:[(0,r.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",role:"status","aria-live":"polite","aria-relevant":"additions",children:x.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-[#74C08A]/35 bg-[#74C08A]/10 text-[#74C08A]",icon:"check_circle"}:"error"===t?{wrapper:"border-[#E07070]/35 bg-[#E07070]/10 text-[#E07070]",icon:"error"}:"warning"===t?{wrapper:"border-[#E5B454]/35 bg-[#E5B454]/10 text-[#E5B454]",icon:"warning"}:{wrapper:"border-[#8A9EB8]/35 bg-[#8A9EB8]/10 text-[#8A9EB8]",icon:"info"};return(0,r.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${a.wrapper}`,style:{background:"#1E1A13"},..."error"===e.type?{role:"alert"}:{},children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,r.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,r.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,r.jsx)("button",{type:"button",onClick:()=>p(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),(0,r.jsx)(u,{}),a&&(0,r.jsx)("button",{type:"button","aria-label":"Close menu",className:"fixed inset-0 z-40 bg-black/40 lg:hidden cursor-default",onClick:()=>d(!1)}),(0,r.jsx)("div",{className:"hidden lg:flex h-full",children:(0,r.jsx)(l.default,{endpointHost:t})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${a?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(l.default,{endpointHost:t,onClose:()=>d(!1)})}),(0,r.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative isolate",children:[(0,r.jsx)(o.default,{onMenuClick:()=>d(!0)},c),(0,r.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${h?"flex flex-col overflow-hidden":""}`,style:{background:"#16130E"},children:(0,r.jsx)("div",{className:h?"flex-1 w-full h-full flex flex-col":"w-full",style:h?void 0:{padding:22},children:e})})]})]})}},80752:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(40197),o=a(81127);function d({icon:e,label:t,onClick:a,trailing:s,danger:n}){return(0,r.jsxs)("button",{role:"menuitem",onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${n?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[20px] ${n?"":"text-text-muted"}`,children:e}),(0,r.jsx)("span",{className:"flex-1 text-left",children:t}),s&&(0,r.jsx)("span",{className:"text-base",children:s})]})}function c(){let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)(!1),[i,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(!1),x=(0,s.useRef)(null),p=async()=>{m(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}m(!1),c(!1)};return(0,s.useEffect)(()=>{let a=e=>{x.current&&!x.current.contains(e.target)&&t(!1)};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative",ref:x,children:[(0,r.jsx)("button",{onClick:()=>t(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu","aria-label":"Menu","aria-haspopup":"menu","aria-expanded":e,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),e&&(0,r.jsxs)("div",{role:"menu",className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,r.jsx)(d,{icon:"history",label:"Change Log",onClick:()=>{t(!1),n(!0)}}),(0,r.jsx)(d,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{t(!1),c(!0)}})]})]}),(0,r.jsx)(l.default,{isOpen:a,onClose:()=>n(!1)}),(0,r.jsx)(o.ConfirmModal,{isOpen:i,onClose:()=>c(!1),onConfirm:p,title:"Shutdown",message:"Are you sure you want to close the proxy server?",confirmText:"Shutdown",cancelText:"Cancel",variant:"danger",loading:u})]})}d.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>c,default:()=>d});var r=a(95155),s=a(12115),n=a(31474),i=a(92542),l=a(97677),o=a(34131);function d({isOpen:e,onClose:t,title:a,children:i,footer:c,size:u="md",closeOnOverlay:m=!0,showTrafficLights:x=!0,className:p,"aria-label":h}){let f=(0,o.sp)({isOpen:e,onClose:t}),b=(0,s.useId)();return e?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":h,"aria-labelledby":h?void 0:a?b:void 0,tabIndex:-1,className:(0,n.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in","outline-none",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[u],p),children:[(a||x)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[x&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,r.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,r.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,r.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,r.jsx)("h2",{id:b,className:"text-lg font-semibold text-text-main",children:a})]}),(0,r.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),c&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:c})]})]}):null}function c({isOpen:e,onClose:t,onConfirm:a,title:s="Confirm",message:n,confirmText:l="Confirm",cancelText:o="Cancel",variant:u="danger",loading:m=!1}){return(0,r.jsx)(d,{isOpen:e,onClose:t,title:s,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{variant:"ghost",onClick:t,disabled:m,children:o}),(0,r.jsx)(i.default,{variant:u,onClick:a,loading:m,children:l})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:n})})}},81231:(e,t,a)=>{a.d(t,{Iz:()=>l,M0:()=>u,R3:()=>c,qi:()=>m,uJ:()=>o,vK:()=>d});var r=a(36861),s=a(68501),n=a(88105),i=a(97650);function l(e,t=""){return new Set((Array.isArray(e)?e:[]).map(e=>(0,r.v)(e,t)).filter(Boolean))}function o(e,t,a=""){return e.has((0,r.v)(t,a))}function d(e,t){let a=String(t||"").trim().toLowerCase();if(!a)return e||{};let r={};for(let[t,s]of Object.entries(e||{})){let e=Array.isArray(s?.models)?s.models:[];if(s?.name&&String(s.name).toLowerCase().includes(a)){r[t]={...s,models:[...e]};continue}let n=e.filter(e=>String(e?.name||"").toLowerCase().includes(a)||String(e?.id||"").toLowerCase().includes(a)||String(e?.value||"").toLowerCase().includes(a));0!==n.length&&(r[t]={...s,models:n})}return r}function c({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:r=[],type:l="llm",includeLegacyAliases:o=!0,legacyStorageAliases:d=[]}){let u=new Set(r.map(e=>e.id)),m=new Set,x=[],p=new Set([a,...d.filter(e=>"string"==typeof e&&e&&e!==a)]),h=a?n.js[a]:null;h&&(p.add(h),i.Xg[h]&&p.add(i.Xg[h]));let f=new Set(e.filter(e=>e?.providerAlias===a).map(e=>e?.id));for(let t of e){if(!t?.id||!p.has(t.providerAlias)||t.providerAlias!==a&&f.has(t.id))continue;let e=(0,s.ki)(t?.kind||t?.type||"llm");if(l&&e!==l||u.has(t.id))continue;let r=`${a}/${t.id}`;m.has(r)||(m.add(r),x.push({id:t.id,name:t.name||t.id,fullModel:r,source:"custom",type:e}))}if(!o)return x;let b=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(b))continue;let t=a.slice(b.length);!t||u.has(t)||m.has(a)||(m.add(a),x.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:l||"llm"}))}return x}function u({providerAlias:e,builtInModels:t=[],customModels:a=[],modelAliases:r={},liveModels:s=[],liveCatalogLoaded:n=!1,legacyStorageAliases:i=[]}){let l=[],o=new Map,d=e=>{!e?.id||!e?.value||o.has(e.value)||(o.set(e.value,e),l.push(e))};for(let a of t)a?.id&&d({...a,name:a.name||a.id,value:`${e}/${a.id}`});for(let s of c({customModels:a,modelAliases:r,providerAlias:e,builtInModels:t,type:"llm",legacyStorageAliases:i}))d({id:s.id,name:s.name||s.alias||s.id,value:s.fullModel,type:s.type,isCustom:!0});if(!n)return l;let m=[],x=new Set,p=`${e}/`;for(let e of s){if("string"!=typeof e?.id||!e.id.startsWith(p))continue;let t=e.id.slice(p.length);if(!t||x.has(e.id))continue;x.add(e.id);let a=o.get(e.id);m.push({...a||{},id:t,name:e.name||a?.name||t,value:e.id,kind:e.kind||a?.kind,capabilities:e.capabilities||a?.capabilities,isCustom:a?.isCustom===!0})}return m}function m({providerId:e,providerAlias:t,customModels:a=[],modelAliases:r={},liveModels:s=[],liveCatalogLoaded:n=!1}){let i=new Map,l=[],o=e=>{!e?.id||!e?.value||i.has(e.value)||(i.set(e.value,e),l.push(e))};for(let[a,s]of Object.entries(r||{})){let r=`${e}/`;if("string"!=typeof s||!s.startsWith(r))continue;let n=s.slice(r.length);o({id:n,name:a,value:`${t}/${n}`})}for(let r of a)r?.id&&r.providerAlias===e&&o({id:r.id,name:r.name||r.id,value:`${t}/${r.id}`,isCustom:!0});if(!n)return l;let d=`${t}/`,c=[],u=new Set;for(let e of s){if("string"!=typeof e?.id||!e.id.startsWith(d)||u.has(e.id))continue;let t=e.id.slice(d.length);if(!t)continue;u.add(e.id);let a=i.get(e.id);c.push({...a||{},id:t,name:e.name||a?.name||t,value:e.id,kind:e.kind||a?.kind,capabilities:e.capabilities||a?.capabilities,isCustom:a?.isCustom===!0})}return c}},90882:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(11059),u=a(78559);function m({isOpen:e,provider:t,providerInfo:a,onSuccess:n,onClose:i,oauthMeta:x,idcConfig:p}){let[h,f]=(0,s.useState)("waiting"),[b,g]=(0,s.useState)(null),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(null),[O,I]=(0,s.useState)(!1),A=(0,s.useRef)(null),E=(0,s.useRef)(!1),W=(0,s.useRef)(0),F=(0,s.useRef)(!1),{copied:T,copy:P}=(0,c.C)(),[M,R]=(0,s.useState)(!1),[q,$]=(0,s.useState)("/callback?code=..."),z=(0,s.useRef)(!1);(0,s.useEffect)(()=>{R("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),$(`${window.location.origin}/callback?code=...`)},[]);let L=(0,s.useCallback)(async(e,a)=>{if(b)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:b.redirectUri,codeVerifier:b.codeVerifier,state:a,...x?{meta:x}:{}})}),s=await r.json();if(!r.ok)throw Error(s.error);f("success"),n?.()}catch(e){k(e.message),f("error")}},[b,t,n,x]),_=(0,s.useCallback)(async e=>{if(b?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:b.state})}),a=await t.json();if(!t.ok)throw Error(a.error);f("success"),n?.()}catch(e){k(e.message),f("error")}},[b,n]),D=(0,s.useCallback)(async(e,a,r,s,i,l)=>{E.current=!1,I(!0);let o=Date.now()+(Number.isFinite(i)&&i>0?i:12e4);for(;Date.now()<o;){if(E.current||l!==W.current||(await new Promise(e=>setTimeout(e,1e3*r)),E.current||l!==W.current))return void I(!1);try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:s})}),o=await i.json();if(l!==W.current)return;if(o.success){E.current=!0,f("success"),I(!1),n?.();return}if("expired_token"===o.error||"access_denied"===o.error)throw Error(o.errorDescription||o.error);"slow_down"===o.error&&(r=Math.min(r+5,30))}catch(e){k(e.message),f("error"),I(!1);return}}k("Authorization timeout"),f("error"),I(!1)},[t,n]),U=(0,s.useCallback)(async()=>{if(!t)return;let e=++W.current;try{let a;if(k(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy-cn","qoder","grok-cli","muse"].includes(t)){w(!0),f("waiting");let a=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&p?.startUrl&&(a.searchParams.set("start_url",p.startUrl),p.region&&a.searchParams.set("region",p.region),a.searchParams.set("auth_method","idc"));let r=await fetch(a.toString()),s=await r.json();if(e!==W.current)return;if(!r.ok)throw Error(s.error);S(s);let n=s.verification_uri_complete||s.verification_uri;n&&window.open(n,"_blank","noopener,noreferrer");let i="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl,_profileArn:p?.profileArn}:"qoder"===t?{_qoderNonce:s._qoderNonce,_qoderMachineId:s._qoderMachineId,_qoderVerifier:s.codeVerifier}:"kimi-coding"===t?{_kimiDeviceId:s._kimiDeviceId}:null;D(s.device_code,s.codeVerifier,s.interval||5,i,Number.isFinite(s.expires_in)&&s.expires_in>0?1e3*s.expires_in:void 0,e);return}let r=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${r}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",a),x&&Object.entries(x).forEach(([e,t])=>{t&&"clientSecret"!==e&&s.searchParams.set(e,t)});let n=await fetch(s.toString()),i=await n.json();if(e!==W.current)return;if(!n.ok)throw Error(i.error);let l=!1,o=!1;if("codex"===t)try{let e=new URL("/api/oauth/codex/start-proxy",window.location.origin);e.searchParams.set("app_port",r),e.searchParams.set("state",i.state),e.searchParams.set("code_verifier",i.codeVerifier),e.searchParams.set("redirect_uri",a);let t=await fetch(e.toString()),s=await t.json();l=s.success,o=!!s.serverSide}catch{l=!1}let d=!1,c=!1;if("xai"===t)try{let e=new URL("/api/oauth/xai/start-proxy",window.location.origin);e.searchParams.set("app_port",r),e.searchParams.set("state",i.state),e.searchParams.set("code_verifier",i.codeVerifier),e.searchParams.set("redirect_uri",a);let t=await fetch(e.toString()),s=await t.json();if(d=s.success,c=!!s.serverSide,!d&&"port_busy"===s.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;d=!1}if(e!==W.current)return;g({...i,redirectUri:a,codexServerSide:o,xaiServerSide:c}),"codex"===t&&l||"xai"===t&&d||M&&"codex"!==t&&"xai"!==t?(f("waiting"),A.current=window.open(i.authUrl,"oauth_popup","width=600,height=700"),A.current||f("input")):(f("input"),window.open(i.authUrl,"_blank"))}catch(t){if(e!==W.current)return;k(t.message),f("error")}},[t,M,D,x,p]);(0,s.useEffect)(()=>{e&&t?F.current||(F.current=!0,g(null),y(""),k(null),w(!1),S(null),I(!1),E.current=!1,U()):e||(W.current+=1,E.current=!0,F.current=!1,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,U]),(0,s.useEffect)(()=>{let e=b?.codexServerSide?"codex":b?.xaiServerSide?"xai":null;if(!e||!b?.state||z.current)return;let t=!1,a=0,r=async()=>{if(!t&&!z.current){a+=1;try{let a=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(b.state)}`),r=await a.json();if(t||z.current)return;if("done"===r.status){z.current=!0,f("success"),n?.();return}if("error"===r.status){z.current=!0,k(r.error||"Authentication failed"),f("error");return}}catch{}if(a>=200){z.current=!0,k("Authentication timeout"),f("error");return}setTimeout(r,1500)}};return setTimeout(r,1500),()=>{t=!0}},[b,n]),(0,s.useEffect)(()=>{let e;if(!b)return;z.current=!1;let t=async e=>{if(z.current)return;let{code:t,token:a,state:r,error:s,errorDescription:n}=e;if(s){z.current=!0,k(n||s),f("error");return}(a||t)&&(z.current=!0,await L(a||t,r))},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(a||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){(0,u.s)("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",r),e&&e.close()}},[b,L]);let K=async()=>{try{k(null);let e=v.trim();if(e.startsWith("eyJ")&&e.includes("."))return void await L(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await _(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await L(e,null);let a=new URL(e),r=a.searchParams.get("code"),s=a.searchParams.get("token"),n=a.searchParams.get("state"),i=a.searchParams.get("error");if(i)throw Error(a.searchParams.get("error_description")||i);if(!r&&!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await L(s||r,n)}catch(e){k(e.message),f("error")}},B=(0,s.useCallback)(()=>{W.current+=1,E.current=!0,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),i()},[i,t]);if(!t||!a)return null;let V="xai"===t,J="kimchi"===t,G=C?.verification_uri_complete||C?.verification_uri||"",H=V?"Connect Grok Build OAuth":`Connect ${a.name}`,Q=V?"http://127.0.0.1:56121/callback?code=... or copied code":J?`${q.replace("code=...","token=...")} or copied token`:q;return(0,r.jsx)(l.default,{isOpen:e,title:H,onClose:B,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===h||"input"===h)&&!N&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:V?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,r.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,r.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",V?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{value:b?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(o.default,{variant:"secondary",icon:"auth_url"===T?"check":"content_copy",onClick:()=>P(b?.authUrl,"auth_url"),disabled:!b?.authUrl,children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":J?"callback URL or copied token":"callback URL"," here"]}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":J?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,r.jsx)(d.default,{value:v,onChange:e=>y(e.target.value),placeholder:Q,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:K,fullWidth:!0,disabled:!v,children:"Connect"}),(0,r.jsx)(o.default,{onClick:B,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===h&&N&&C&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:G}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"login_url"===T?"check":"content_copy",onClick:()=>P(G,"login_url"),disabled:!G}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(G,"_blank","noopener,noreferrer"),disabled:!G,children:"Open"})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:C.user_code}),(0,r.jsx)(o.default,{size:"sm",variant:"ghost",icon:"user_code"===T?"check":"content_copy",onClick:()=>P(C.user_code,"user_code")})]})]})]}),O&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,r.jsx)(o.default,{onClick:B,fullWidth:!0,children:"Done"})]}),"error"===h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:j}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:U,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(o.default,{onClick:B,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}m.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string,profileArn:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),s=a(14051),n=a.n(s),i=a(61929);function l({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(i.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}l.propTypes={children:n().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(98500),n=a.n(s),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),s=a(31474);let n={primary:"bg-brand-500 hover:bg-brand-400 text-[#1B1710] border border-brand-500/80 shadow-sm disabled:bg-surface-3 disabled:text-text-muted disabled:border-transparent",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40 bg-transparent",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main border border-transparent",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-8 px-3 text-xs rounded-[7px]",md:"h-9 px-3.5 text-sm rounded-[8px]",lg:"h-11 px-5 text-sm rounded-[10px]"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:u=!1,fullWidth:m=!1,className:x,...p}){return(0,r.jsxs)("button",{type:"button",className:(0,s.cn)("inline-flex items-center justify-center gap-1.5 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",n[t],i[a],m&&"w-full",x),disabled:c||u,...p,children:[u?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none animate-spin shrink-0",style:{fontSize:18},children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none shrink-0",style:{fontSize:18},children:o}):null,e?(0,r.jsx)("span",{className:"leading-none",children:e}):null,d&&!u?(0,r.jsx)("span",{className:"material-symbols-outlined leading-none shrink-0",style:{fontSize:18},children:d}):null]})}},92622:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(98500),o=a.n(l),d=a(73321),c=a(90620),u=a(11059),m=a(52337),x=a(31474),p=a(81127);function h(){let{pending:e}=(0,l.useLinkStatus)();return(0,r.jsx)("span",{"aria-hidden":"true",className:(0,x.cn)("console-nav-dot",e&&"animate-pulse")})}let f=null,b=[{id:"operate",label:"Operate",items:[{href:"/dashboard",label:"Overview",match:e=>"/dashboard"===e},{href:"/dashboard/basic-chat",label:"Chat",match:e=>e.startsWith("/dashboard/basic-chat")},{href:"/dashboard/combos",label:"Combos",match:e=>e.startsWith("/dashboard/combos")},{href:"/dashboard/usage",label:"Usage",match:e=>e.startsWith("/dashboard/usage")},{href:"/dashboard/quota",label:"Quota",match:e=>e.startsWith("/dashboard/quota")}]},{id:"connect",label:"Connect",items:[{href:"/dashboard/providers",label:"Providers",match:e=>e.startsWith("/dashboard/providers")},{href:"/dashboard/endpoint",label:"Endpoint & keys",match:e=>e.startsWith("/dashboard/endpoint")}]},{id:"tools",label:"Tools",items:[{href:"/dashboard/token-saver",label:"Token saver",match:e=>e.startsWith("/dashboard/token-saver")},{href:"/dashboard/media-providers",label:"Media",match:e=>e.startsWith("/dashboard/media-providers")},{href:"/dashboard/skills",label:"Skills",match:e=>e.startsWith("/dashboard/skills")},{href:"/dashboard/agent-library",label:"Agent library",match:e=>e.startsWith("/dashboard/agent-library")},{href:"/dashboard/cli-tools",label:"CLI tools",match:e=>e.startsWith("/dashboard/cli-tools")},{href:"/dashboard/profile",label:"Settings",match:e=>e.startsWith("/dashboard/profile")}]}];function g({onClose:e,endpointHost:t}){let a=(0,d.usePathname)(),[n,i]=(0,s.useState)(!1),[l,x]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),[j,k]=(0,s.useState)(!1),[N,w]=(0,s.useState)(0),C=(0,s.useRef)(null),{online:S}=(0,m._)(),O=n||!S,[I,A]=(0,s.useState)(t||`127.0.0.1:${c.h0.appPort}`),{copied:E,copy:W}=(0,u.C)(2e3),F=c.h0.installCmdLatest;(0,s.useEffect)(()=>{A(window.location.host||`127.0.0.1:${c.h0.appPort}`)},[]),(0,s.useEffect)(()=>{(!f&&(f=fetch("/api/version").then(e=>e.json()).catch(()=>null)),f).then(e=>{x(e||null)}).catch(()=>{x(null)})},[]);let T=l&&!0===l.hasUpdate&&l.latestVersion&&l.currentVersion&&l.latestVersion!==l.currentVersion?l:null,P=async()=>{if(C.current)return;try{await navigator.clipboard.writeText(F)}catch{}W(F);let e=c.h0.shutdownCountdownSec;w(e),C.current=setInterval(()=>{w(e-=1),e<=0&&(clearInterval(C.current),C.current=null,fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),i(!0))},1e3)};return(0,s.useEffect)(()=>()=>{C.current&&clearInterval(C.current)},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"flex flex-col min-h-full",style:{width:236,flex:"0 0 236px",background:"#1A160F",borderRight:"1px solid #332C1E"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-[11px]",style:{padding:"16px 18px",borderBottom:"1px solid #2A2418"},children:[(0,r.jsxs)(o(),{href:"/dashboard",onClick:e,prefetch:!1,className:"flex items-center gap-[11px] min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center justify-center shrink-0",style:{width:27,height:27,borderRadius:7,background:"#E5B454",color:"#1B1710",fontWeight:700,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:15},children:"S"}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0",style:{lineHeight:1.15},children:[(0,r.jsx)("span",{style:{fontWeight:600,fontSize:14,letterSpacing:"0.2px",color:"#ECE4D2"},children:c.vQ.name}),(0,r.jsxs)("span",{style:{fontSize:10.5,color:"var(--color-text-subtle)",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},title:l?.currentVersion?`Switchboard v${l.currentVersion}${l.latestVersion?` (latest: v${l.latestVersion})`:""}`:void 0,children:[l?.currentVersion?`v${l.currentVersion} \xb7 `:"","routing gateway"]})]})]}),e?(0,r.jsx)("button",{type:"button",onClick:e,className:"lg:hidden ml-auto text-text-subtle hover:text-[#ECE4D2]","aria-label":"Close menu",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})}):null]}),T&&(0,r.jsxs)("div",{className:"mx-2.5 mt-2 rounded-lg border border-[#332C1E] bg-[#211C14] px-2.5 py-2",children:[(0,r.jsxs)("span",{className:"text-[11px] font-semibold text-[#E5B454]",children:["↑ v",T.latestVersion," available"]}),(0,r.jsx)("button",{type:"button",onClick:()=>y(!0),className:"mt-1 block text-[11px] text-[#A99E86] hover:text-[#E5B454]",children:"Update now"})]}),(0,r.jsxs)("nav",{className:"flex-1 overflow-y-auto custom-scrollbar flex flex-col",style:{padding:"12px 10px",gap:2},children:[b.map(t=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"console-nav-section",children:t.label}),t.items.map(t=>{let s=t.match(a);return(0,r.jsxs)(o(),{href:t.href,onClick:e,prefetch:!1,className:"console-nav-item","data-active":s?"true":"false","aria-current":s?"page":void 0,children:[(0,r.jsx)(h,{}),t.label]},t.href)})]},t.id)),(0,r.jsxs)("div",{style:{marginTop:16,padding:"11px 12px",border:"1px dashed #332C1E",borderRadius:8},children:[(0,r.jsx)("div",{style:{fontSize:10,letterSpacing:"1.4px",color:"var(--color-text-subtle)",textTransform:"uppercase",fontWeight:600,marginBottom:6},children:"Diagnostics"}),(0,r.jsxs)("div",{style:{fontSize:11,color:"var(--color-text-subtle)",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",lineHeight:1.7},children:[(0,r.jsx)(o(),{href:"/dashboard/console-log",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"console"})," \xb7 ",(0,r.jsx)(o(),{href:"/dashboard/translator",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"translator"})," \xb7 ",(0,r.jsx)(o(),{href:"/dashboard/mitm",onClick:e,prefetch:!1,className:"hover:text-[#E5B454]",children:"mitm"})]})]})]}),(0,r.jsx)("div",{style:{padding:12,borderTop:"1px solid #2A2418"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",style:{background:"#211C14",border:"1px solid #2A2418",borderRadius:8,padding:"9px 11px"},children:[(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)("span",{style:{fontSize:9.5,letterSpacing:"1px",color:"var(--color-text-subtle)",textTransform:"uppercase"},children:"Endpoint"}),(0,r.jsx)("span",{className:"truncate",style:{fontSize:11,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",color:"#A99E86"},children:I})]}),(0,r.jsx)("span",{className:O?"console-offline-dot":"console-online-dot",title:O?"offline":"online",role:"status","aria-label":O?"Gateway offline":"Gateway online",children:(0,r.jsx)("span",{className:"sr-only",children:O?"offline":"online"})})]})})]}),(0,r.jsx)(p.ConfirmModal,{isOpen:v,onClose:()=>y(!1),onConfirm:()=>{y(!1),k(!0)},title:"Update Switchboard",message:"Copy the install command and restart the server after update.",confirmText:"Continue"}),j&&(0,r.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50 p-4",children:(0,r.jsxs)("div",{className:"card-soft max-w-md w-full p-5 space-y-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Manual update"}),(0,r.jsx)("code",{className:"block text-[11px] font-mono text-primary break-all bg-surface-2 p-2 rounded",children:F}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:P,disabled:N>0,className:"px-3 py-1.5 rounded-lg bg-primary text-[#1B1710] text-xs font-semibold disabled:opacity-60",children:[E?"Copied":"Copy & shutdown",N>0?` (${N})`:""]}),(0,r.jsx)("button",{type:"button",onClick:()=>{C.current&&(clearInterval(C.current),C.current=null),k(!1),w(0)},className:"px-3 py-1.5 rounded-lg border border-border text-text-muted text-xs",children:"Cancel"})]}),n&&(0,r.jsx)("p",{className:"text-[11px] text-text-subtle font-mono",children:"Server shutting down…"})]})})]})}g.propTypes={onClose:i().func}},94230:(e,t,a)=>{a.d(t,{default:()=>u});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(11059);function u({isOpen:e,provider:t,onSuccess:a,onClose:n}){let[i,m]=(0,s.useState)("loading"),[x,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(null),[b,g]=(0,s.useState)(""),[v,y]=(0,s.useState)(null),{copied:j,copy:k}=(0,c.C)(),N=(0,s.useRef)(!1);(0,s.useEffect)(()=>{e||(N.current=!1)},[e]),(0,s.useEffect)(()=>{e&&t&&(async()=>{try{y(null),m("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);f(a),p(a.authUrl),m("input"),N.current||(N.current=!0,window.open(a.authUrl,"_blank"))}catch(e){y(e.message),m("error")}})()},[e,t]);let w=async()=>{try{let e;y(null);try{e=new URL(b)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let s=e.searchParams.get("error");if(s)throw Error(e.searchParams.get("error_description")||s);if(!r)throw Error("No authorization code found in URL");let n=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:h.codeVerifier,provider:t})}),i=await n.json();if(!n.ok)throw Error(i.error);m("success"),a?.()}catch(e){y(e.message),m("error")}},C="google"===t?"Google":"GitHub";return(0,r.jsx)(l.default,{isOpen:e,title:`Connect Kiro via ${C}`,onClose:n,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",C," authentication"]})]}),"input"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{value:x,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(o.default,{variant:"secondary",icon:"auth_url"===j?"check":"content_copy",onClick:()=>k(x,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(d.default,{value:b,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:w,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(o.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",C," has been connected."]}),(0,r.jsx)(o.default,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:v}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:()=>m("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(o.default,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}u.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(92542),d=a(11910),c=a(90882);let u="https://gitlab.com";function m({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let i,[x,p]=(0,s.useState)(null),[h,f]=(0,s.useState)(u),[b,g]=(0,s.useState)(""),[v,y]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(null),[O,I]=(0,s.useState)(!1),[A,E]=(0,s.useState)(null),W=()=>{p(null),f(u),g(""),y(""),k(""),S(null),w(!1),I(!1),E(null),n()},F=async()=>{if(!j.trim())return void S("Personal Access Token is required");w(!0),S(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j.trim(),baseUrl:h.trim()||u})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),W()}catch(e){S(e.message)}finally{w(!1)}};return e?O&&A?(0,r.jsx)(c.default,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:A,onSuccess:()=>{a?.(),W()},onClose:()=>{I(!1),E(null)}}):(0,r.jsx)(l.default,{isOpen:e,title:"Connect GitLab Duo",onClose:W,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("button",{onClick:()=>p("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,r.jsxs)("button",{onClick:()=>p("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,r.jsx)("a",{href:`${h.trim()||u}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,r.jsx)(d.default,{label:"GitLab Base URL",value:h,onChange:e=>f(e.target.value),placeholder:u}),(0,r.jsx)(d.default,{label:"Client ID",value:b,onChange:e=>g(e.target.value),placeholder:"Your OAuth application client ID"}),(0,r.jsx)(d.default,{label:"Client Secret (optional for PKCE)",value:v,onChange:e=>y(e.target.value),placeholder:"Leave empty for public PKCE app"}),C&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:C}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:()=>{b.trim()?(S(null),E({baseUrl:h.trim()||u,clientId:b.trim(),clientSecret:v.trim()}),I(!0)):S("Client ID is required")},fullWidth:!0,disabled:!b.trim(),children:"Authorize"}),(0,r.jsx)(o.default,{onClick:()=>{p(null),S(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,r.jsx)("a",{href:`${h.trim()||u}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,r.jsx)(d.default,{label:"GitLab Base URL",value:h,onChange:e=>f(e.target.value),placeholder:u}),(0,r.jsx)(d.default,{label:"Personal Access Token",value:j,onChange:e=>k(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),C&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:C}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{onClick:F,fullWidth:!0,disabled:!j.trim()||N,loading:N,children:"Connect"}),(0,r.jsx)(o.default,{onClick:()=>{p(null),S(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}m.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(92542),c=a(56061),u=a(78559);let m="https://api.openai.com/v1";function x({isOpen:e,onClose:t,onCreated:a,onSaved:n,node:i}){let p=!!i,[h,f]=(0,s.useState)({name:"",baseUrl:m}),[b,g]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null),[j,k]=(0,s.useState)(""),[N,w]=(0,s.useState)(""),[C,S]=(0,s.useState)(!1),[O,I]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(I(null),y(null),k(""),w(""),p?f({name:i.name||"",baseUrl:i.baseUrl||m}):f({name:"",baseUrl:m}))},[e,p,i]);let A=async()=>{if(h.name.trim()&&h.baseUrl.trim()){g(!0),y(null);try{let e=p?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=p?"PUT":"POST",r={name:h.name.trim(),baseUrl:h.baseUrl.trim()};p||(r.type="custom-embedding");let s=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),l=null;try{l=await s.json()}catch{l=null}if(s.ok)p?n?.(l?.node):a?.(l?.node);else{let e=l?.error||`Failed to save custom embedding (${s.status})`;y(e),(0,u.s)(e)}}catch(t){let e="Error saving custom embedding node";y(e),(0,u.s)(`${e}:`,t)}finally{g(!1)}}},E=async()=>{S(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:j,type:"custom-embedding",modelId:N.trim()||void 0})}),t=await e.json();I(t)}catch{I({valid:!1,error:"Network error"})}finally{S(!1)}};return(0,r.jsx)(l.default,{isOpen:e,title:p?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:h.name,onChange:e=>f({...h,name:e.target.value}),placeholder:"Voyage AI",hint:"Friendly label for this embedding provider."}),(0,r.jsx)(o.default,{label:"Base URL",value:h.baseUrl,onChange:e=>f({...h,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"OpenAI-compatible embeddings base URL (Voyage, Cohere, Jina, Mistral…)."}),p&&i?.prefix?(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Model IDs use prefix ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded font-mono",children:i.prefix})," ","(auto-assigned)."]}):null,(0,r.jsx)(o.default,{label:"API Key (for Check)",type:"password",autoComplete:"off",value:j,onChange:e=>k(e.target.value)}),(0,r.jsx)(o.default,{label:"Model ID (for Check)",value:N,onChange:e=>w(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0",hint:"Required for validation. Sends a small embeddings request."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:E,disabled:!j||!N.trim()||C||!h.baseUrl.trim(),variant:"secondary",children:C?"Checking...":"Check"}),(()=>{if(!O)return null;let{valid:e,error:t,dimensions:a}=O;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{variant:"success",children:"Valid"}),a&&(0,r.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(c.default,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),v&&(0,r.jsx)("div",{role:"alert",className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:v})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:A,fullWidth:!0,disabled:!h.name.trim()||!h.baseUrl.trim()||b,children:b?p?"Saving...":"Creating...":p?"Save":"Create"}),(0,r.jsx)(d.default,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}x.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97677:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(12115);function n({text:e,children:t,position:a="top",color:i}){let l=(0,s.useId)(),o=i?"":"bg-gray-900",d=(0,s.isValidElement)(t)?(0,s.cloneElement)(t,{"aria-describedby":[t.props["aria-describedby"],l].filter(Boolean).join(" ")}):t;return(0,r.jsxs)("div",{className:"relative inline-flex group/tt",children:[d,(0,r.jsx)("div",{id:l,role:"tooltip",className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${o} text-white opacity-0 group-hover/tt:opacity-100 group-has-focus-visible/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:i?{backgroundColor:i}:{},children:e})]})}},98542:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d,title:c,"aria-label":u}){let m={sm:{track:"w-8 h-4",thumb:"size-3",on:"translate-x-4",off:"translate-x-0.5"},md:{track:"w-11 h-6",thumb:"size-5",on:"translate-x-5",off:"translate-x-0.5"},lg:{track:"w-14 h-7",thumb:"size-6",on:"translate-x-7",off:"translate-x-0.5"}},x=m[o]||m.md;return(0,r.jsxs)("div",{className:(0,s.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":u,title:c,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,s.cn)("relative inline-flex shrink-0 cursor-pointer items-center rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/35",e?"bg-brand-500":"bg-surface-3 border border-border",x.track,l&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,s.cn)("pointer-events-none inline-block rounded-full shadow-sm",e?"bg-[#1B1710]":"bg-[#ECE4D2]","transform transition duration-200 ease-in-out",e?x.on:x.off,x.thumb,"mt-0.5")})}),(a||i)&&(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[a&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{17002:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},35497:(e,t,r)=>{"use strict";r.d(t,{x0:()=>k.default,Ex:()=>d.default,$n:()=>a.default,nh:()=>$.default,Zp:()=>l.default,Qv:()=>o.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>y.default,wI:()=>w.default,vj:()=>j.default,vE:()=>v.default,pd:()=>s.default,Mh:()=>f.default,uR:()=>m.default,Nf:()=>p.default,aF:()=>n.default,rq:()=>x.default,gw:()=>N.default,LF:()=>u.default,Wx:()=>A.default,gM:()=>g.default,Iz:()=>C.default,l6:()=>i.default,lM:()=>c.default,m_:()=>S.default,jK:()=>b.default});var a=r(92542),s=r(11910),i=r(98),l=r(84588),n=r(81127),o=r(25086);r(56319);var d=r(56061),c=r(98542);r(61929),r(21110),r(92622),r(8823),r(92173);var u=r(90882),x=r(72908),m=r(28815),h=r(45455),p=r(28058),b=r(4809);r(21931),r(80752),r(40197);var g=r(23615);r(44736);var f=r(62899);r(94230);var y=r(30815),v=r(23936),j=r(95088),w=r(73579),k=r(96748),N=r(4823),C=r(28067),S=r(97677),A=r(51825),$=r(29366);r(76361),r(91450)},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>F});var a=r(95155),s=r(12115),i=r(57250),l=r(97650);let n="quotaCacheData",o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{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 m(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(n,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[l,n]=(0,s.useState)(1),o=(0,s.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):y(e?.used,e?.total)})),[e]),d=(0,s.useMemo)(()=>"remaining-asc"===r?[...o].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...o].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10)),u=(e||[]).map(e=>e?.name).join("\n");if((0,s.useEffect)(()=>{n(1)},[r,u]),(0,s.useEffect)(()=>{n(e=>Math.min(e,c))},[c]),!e||0===e.length)return null;let x=d.slice((l-1)*10,10*l),m=0===d.length?0:(l-1)*10+1,h=Math.min(10*l,d.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=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:[d.length," quota",d.length>1?"s":""]}),i&&(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:x.map(e=>{var r;let s=(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"},i=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 s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),l=s%60;if(i<24)return`${i}h ${l}m`;let n=Math.floor(i/24);return`${n}d ${i%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${l}`}catch{return null}}(e.resetAt),n=!1!==e.recurring?`in ${i}`:`expires in ${i}`;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:`${p} 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:s.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${p} 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 ${s.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 ${s.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 ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${p} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?n:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium`,children:n}),l&&(0,a.jsx)("div",{className:`${f} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),c>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 ",m,"-",h," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(e=>Math.max(1,e-1)),disabled:1===l,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:()=>n(e=>Math.min(c,e+1)),disabled:l===c,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 j=r(98542),w=r(97677),k=r(84588),N=r(35497),C=r(88105),S=r(11059),A=r(78559),$=r(77251);let E={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},P={claude:"claudeAutoPing",codex:"codexAutoPing"},q={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota."};function T(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 M(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function D(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function F(){let{copied:e,copy:t}=(0,S.C)(),[r,F]=(0,s.useState)([]),[I,O]=(0,s.useState)({}),[_,z]=(0,s.useState)({}),[L,R]=(0,s.useState)({}),[U,K]=(0,s.useState)(!0),[H,J]=(0,s.useState)({claude:{},codex:{}}),[G,B]=(0,s.useState)(null),[W,V]=(0,s.useState)(!1),[X,Q]=(0,s.useState)(!1),[Y,Z]=(0,s.useState)(60),[ee,et]=(0,s.useState)(!0),[er,ea]=(0,s.useState)(null),[es,ei]=(0,s.useState)(null),[el,en]=(0,s.useState)(null),[eo,ed]=(0,s.useState)(null),[ec,eu]=(0,s.useState)(null),[ex,em]=(0,s.useState)(!1),[eh,ep]=(0,s.useState)(null),[eb,eg]=(0,s.useState)("all"),[ef,ey]=(0,s.useState)([]),[ev,ej]=(0,s.useState)("all"),[ew,ek]=(0,s.useState)("default"),[eN,eC]=(0,s.useState)(!1),[eS,eA]=(0,s.useState)(!1),[e$,eE]=(0,s.useState)(!1),[eP,eq]=(0,s.useState)(1),[eT,eM]=(0,s.useState)(20),[eD,eF]=(0,s.useState)(String(20)),[eI,eO]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[e_,ez]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eL=(0,s.useRef)(null),eR=(0,s.useRef)(null),eU=(0,s.useRef)(0),eK=(0,s.useCallback)(async(e=eP)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eT),accountStatus:ev,sort:"priority"});"all"!==eb&&a.set("provider",eb);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),l=i.connections||[],n=(t=i.pagination,t||{page:1,pageSize:eT,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,l.length);return F(l),ey(i.providerOptions||[]),eO(n),ez(o),eq((r=i.pagination,r?.page||e)),l}catch(e){return(0,A.s)("Error fetching connections:",e),F([]),ey([]),eO({page:1,pageSize:eT,total:0,totalPages:1}),ez({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ev,eP,eT,eb]),eH=(0,s.useCallback)(async(e,t,{force:r=!1}={})=>{z(t=>({...t,[e]:!0})),R(t=>({...t,[e]:null}));try{let a=`/api/usage/${e}${r?"?force=1":""}`,s=await fetch(a);if(!s.ok){let r=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return void(0,A.s)(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===s.status){(0,A.s)(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};O(t=>({...t,[e]:a})),f(e,a);return}throw Error(`HTTP ${s.status}: ${r}`)}let i=await s.json(),n=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.quotas&&Object.keys(t.quotas).length>0?Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})}):t.message&&r.push({name:"error",used:0,total:0,resetAt:null,message:t.message});break;case"vercel-ai-gateway":case"ollama":case"deepseek":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})});break;case"codebuddy-cn":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,recurring:!1!==t.recurring})});break;case"kimi":case"kimi-coding":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,l.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,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,i),o={quotas:n,plan:i.plan||null,message:i.stale&&n.length>0?null:i.message||null,warning:i.stale&&n.length>0?`Showing last known usage. ${i.message||"Refresh unavailable."}`:null,raw:i};O(t=>({...t,[e]:o})),f(e,o)}catch(r){(0,A.s)(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),R(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{z(t=>({...t,[e]:!1}))}},[]),eJ=(0,s.useCallback)(async(e,t)=>{await eH(e,t,{force:!0}),B(new Date)},[eH]),eG=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!el){en(e),R(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 eH(e,t),B(new Date)}catch(t){R(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{en(null)}}},[eH,el]),eB=(0,s.useCallback)(async e=>{eu({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eu({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eu({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eW=(0,s.useCallback)(async e=>{let t=x(r.find(t=>t.id===e)||{})||e;if(await (0,$.l)({message:`Delete connection “${t}”?`,confirmText:"Continue"})){ea(e);try{let t=await fetch(`/api/providers/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Failed to delete connection (HTTP ${t.status})`)}O(t=>{let r={...t};return delete r[e],r}),z(t=>{let r={...t};return delete r[e],r}),R(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(n,JSON.stringify(t)))}catch(e){(0,A.s)("Error deleting cache entry:",e)}await b(eK,eP)}catch(e){(0,A.s)("Error deleting connection:",e)}finally{ea(null)}}},[r,eK,eP]),eV=(0,s.useCallback)(async(e,t)=>{ei(e);try{let r=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Failed to update connection (HTTP ${r.status})`)}O(e=>({...e})),await b(eK,eP)}catch(e){(0,A.s)("Error updating connection status:",e)}finally{ei(null)}},[eK,eP]),eX=(0,s.useCallback)(async e=>{if(!eh?.id)return;let t=eh.id,r=eh.provider;try{let a=await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error||`Failed to save connection (HTTP ${a.status})`)}await eK(),em(!1),ep(null),C.wb.includes(r)&&await eH(t,r)}catch(e){(0,A.s)("Error saving connection:",e)}},[eh,eK,eH]),eQ=(0,s.useCallback)(async(e=!1)=>{if(X)return;Q(!0),Z(60);let t=eU.current+=1,r=Math.round(10);try{let a=await eK(eP);z(h(a)),R(e=>p(e,a)),O(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eH(e.id,e.provider))),B(new Date)}catch(e){(0,A.s)("Error refreshing all providers:",e)}finally{Q(!1)}},[X,eK,eH,eP]);(0,s.useEffect)(()=>{(async()=>{et(!0);let e=await eK(eP);et(!1),z(h(e)),R(t=>p(t,e)),O(t=>p(t,e)),await Promise.all(e.map(e=>eH(e.id,e.provider))),B(new Date)})()},[eK,eH,eP]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(o);K(null===e||"true"===e),V(!0)},[]),(0,s.useEffect)(()=>{W&&window.localStorage.setItem(o,String(U))},[U,W]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>J({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}})).catch(()=>{})},[]);let eY=(0,s.useCallback)(async(e,t,r)=>{let a=P[t];if(!a)return;let s={...H[t]||{},[e]:r};J({...H,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:s},r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Failed to save auto-ping (HTTP ${r.status})`)}}catch(e){J(H),(0,A.s)("Error updating auto-ping:",e)}},[H]);(0,s.useEffect)(()=>{if(!W||!U){eL.current&&(clearInterval(eL.current),eL.current=null),eR.current&&(clearInterval(eR.current),eR.current=null);return}return eL.current=setInterval(()=>{eQ()},6e4),eR.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3),()=>{eL.current&&clearInterval(eL.current),eR.current&&clearInterval(eR.current)}},[U,eQ,W]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eL.current&&(clearInterval(eL.current),eL.current=null),eR.current&&(clearInterval(eR.current),eR.current=null)):U&&W&&(eL.current=setInterval(()=>eQ(),6e4),eR.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[U,eQ,W]);let eZ=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s){let r=e=>Number.isFinite(e)?e:Number.MAX_SAFE_INTEGER;return[...e].sort((e,a)=>{let i=r(m(e,t)),l=r(m(a,t)),n="remaining-asc"===s?i-l:l-i;return 0!==n?n:(x(e)||"").localeCompare(x(a)||"")})}if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let i=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},l=e=>Number.isFinite(e)?e:Number.MAX_SAFE_INTEGER;return[...e].sort((e,t)=>{let r=l(i(e))-l(i(t));return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,I,eN,eb,ew),[r,I,eN,eb,ew]),e0=e=>{let t=I[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=y(e.used,e.total))},e1=(0,s.useCallback)(async(e,t)=>{if(e.length&&!e$){eE(!0);try{let r=await Promise.all(e.map(async e=>{try{let r=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`HTTP ${r.status}`)}return{id:e,ok:!0}}catch(t){return{id:e,ok:!1,error:t}}})),a=r.filter(e=>!e.ok);a.length>0&&(0,A.s)(`Bulk toggle: ${r.length-a.length} of ${r.length} updated:`,a[0].error),await b(eK,eP)}catch(e){(0,A.s)("Error bulk toggling connections:",e)}finally{eE(!1)}}},[e$,eK,eP]),e5="all"===eb?"All providers":eb,e2=e_.eligibleConnections>0,e8=eZ.length>0,e3=e_.eligibleConnections?e_.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"===eb?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ev?"turned off":"active"===ev?"active":"matching"} accounts found for ${eb}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},e4=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}`}(eI),e6=!d.includes(eT);return ee||e2?ee||e8?(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:()=>eA(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":eS,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eb?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${eb}.png`,alt:eb,size:18,className:"size-[18px] rounded object-contain",fallbackText:eb.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e5})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eS&&(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:()=>eA(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eb&&eq(1),eg("all"),eA(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===eb?"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-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eb&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",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-72 overflow-y-auto pr-1",children:ef.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eb!==e&&eq(1),eg(e),eA(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${eb===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eb===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ev,onChange:e=>{let t=e.target.value;ev!==t&&eq(1),ej(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:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===eb&&(0,a.jsx)("select",{value:ew,onChange:e=>ek(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:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eC(e=>!e),"aria-pressed":eN,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eN?"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:()=>{e1(eZ.filter(e=>(e.isActive??!0)&&e0(e)).map(e=>e.id),!1)},disabled:e$,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:()=>{e1(eZ.filter(e=>!(e.isActive??!0)&&!e0(e)).map(e=>e.id),!0)},disabled:e$,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:()=>K(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:U?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${U?"text-primary":"text-text-muted"}`,children:U?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),U&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",Y,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eQ(!0),disabled:X,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] ${X?"animate-spin":""}`,children:"refresh"})})]})}),eN&&(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:eZ.map(r=>{let s,l,n,o=I[r.id],d=_[r.id],c=L[r.id],u=!1===r.isActive,m="codex"===r.provider,h=Number.isFinite(l="number"==typeof(s=o?.raw?.resetCredits?.availableCount)?s:Number(s))?Math.max(0,l):0,p=el===r.id,b=er===r.id||es===r.id||p;return(0,a.jsxs)(k.default,{padding:"none",className:`min-w-0 ${u?"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)(i.A,{src:`/providers/${r.provider}.png`,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,T(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:T(r)}):null,"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:(n=r.providerSpecificData?.authMethod)&&E[n]?E[n]:"api_key"===r.authType?"API Key":"OAuth"}),M(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:M(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"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:u?"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:[m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.default,{text:h>0?`Use one Codex reset credit. Available: ${h}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ed({connection:r,resetCreditCount:h}),disabled:h<=0||d||b,"aria-label":h>0?`Use one Codex reset credit. ${h} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${h>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"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-[15px] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:h})]})}),(0,a.jsx)(w.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eB(r),disabled:d||b,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),P[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(w.default,{text:q[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r.id,r.provider,H[r.provider]?.[r.id]!==!0),"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 ${H[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(w.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eJ(r.id,r.provider),disabled:d||b,"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)(w.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ep(r),em(!0)},disabled:b,"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)(w.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eW(r.id),disabled:b,"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] ${er===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)(j.default,{size:"sm",checked:r.isActive??!0,disabled:b,onChange:e=>eV(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"})}):c?(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:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsxs)(a.Fragment,{children:[o?.warning&&(0,a.jsx)("p",{role:"status",className:"mb-2 text-xs text-text-muted",children:o.warning}),(0,a.jsx)(v,{quotas:o?.quotas,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==ew})]})})]},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:e4}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:e6?"custom":String(eT),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eq(1),eM(r),eF(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:eD,onChange:e=>eF(e.target.value),onBlur:()=>{let e=Number.parseInt(eD,10);if(!Number.isFinite(e))return void eF(String(eT));let t=Math.min(500,Math.max(1,e));eq(1),eM(t),eF(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eD,10);if(!Number.isFinite(t))return void eF(String(eT));let r=Math.min(500,Math.max(1,t));eq(1),eM(r),eF(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 ",eI.page," / ",eI.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eq(1),disabled:eI.page<=1||ee||X,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:()=>eq(e=>Math.max(1,e-1)),disabled:eI.page<=1||ee||X,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:()=>eq(e=>Math.min(eI.totalPages,e+1)),disabled:eI.page>=eI.totalPages||ee||X,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:()=>eq(eI.totalPages),disabled:eI.page>=eI.totalPages||ee||X,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)(N.uo,{isOpen:!!eo,onClose:()=>{el||ed(null)},onConfirm:async()=>{let e=eo?.connection;e&&(await eG(e.id,e.provider),ed(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(eo?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eo?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!el}),(0,a.jsx)(N.aF,{isOpen:!!ec,onClose:()=>eu(null),title:"Codex Reset Credit Expiry",size:"full",children:ec&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"truncate text-xs text-text-muted",children:x(ec.connection)||"Codex account"}),ec.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ec.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ec.error}):ec.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl 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,a.jsxs)("span",{children:[ec.data.credits.length," reset credit",1===ec.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ec.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ec.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:D(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:D(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),s=r%24;return a>0?`${a}d ${s}h`:`${s}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})]})}),(0,a.jsx)(N.wI,{isOpen:ex,connection:eh,onSave:eX,onClose:()=>{em(!1),ep(null)}})]}):(0,a.jsx)(k.default,{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:e3.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e3.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e3.description})]})}):(0,a.jsx)(k.default,{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."})]})})}}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=17002)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>s});var n=r(12115);let a=e=>{let t,r=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,o={setState:n,getState:a,getInitialState:()=>s,subscribe:e=>(r.add(e),()=>r.delete(e))},s=t=e(n,a,o);return o},o=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},s=e=>e?o(e):o},5887:()=>{},17658:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,89008,23)),Promise.resolve().then(r.t.bind(r,26816,23)),Promise.resolve().then(r.t.bind(r,5887,23)),Promise.resolve().then(r.t.bind(r,51743,23)),Promise.resolve().then(r.bind(r,94635)),Promise.resolve().then(r.bind(r,21110))},26816:e=>{e.exports={style:{fontFamily:"'mono', 'mono Fallback'"},className:"__className_409bfd",variable:"__variable_409bfd"}},31692:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>a});let n=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>n(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},a=(e,t)=>(r,a,o)=>{let s,i={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,l=0,c=new Set,m=new Set,f=i.storage;if(!f)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...e)},a,o);let d=()=>{let e=i.partialize({...a()});return f.setItem(i.name,{state:e,version:i.version})},v=o.setState;o.setState=(e,t)=>(v(e,t),d());let h=e((...e)=>(r(...e),d()),a,o);o.getInitialState=()=>h;let b=()=>{var e,t;if(!f)return;let o=++l;u=!1,c.forEach(e=>{var t;return e(null!=(t=a())?t:h)});let v=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=a())?e:h))||void 0;return n(f.getItem.bind(f))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate){let t=i.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(o!==l)return;let[n,u]=e;if(r(s=i.merge(u,null!=(t=a())?t:h),!0),n)return d()}).then(()=>{o===l&&(null==v||v(a(),void 0),s=a(),u=!0,m.forEach(e=>e(s)))}).catch(e=>{o===l&&(null==v||v(void 0,e))})};return o.persist={setOptions:e=>{i={...i,...e},e.storage&&(f=e.storage)},clearStorage:()=>{null==f||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>u,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(m.add(e),()=>{m.delete(e)})},i.skipHydration||b(),s||h}},51743:()=>{},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},73321:(e,t,r)=>{"use strict";var n=r(74645);r.o(n,"notFound")&&r.d(t,{notFound:function(){return n.notFound}}),r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},89008:e=>{e.exports={style:{fontFamily:"'sans', 'sans Fallback'"},className:"__className_939b73",variable:"__variable_939b73"}},94635:(e,t,r)=>{"use strict";r.d(t,{RuntimeI18nProvider:()=>i});var n=r(95155),a=r(12115),o=r(73321),s=r(73006);function i({children:e}){let t=(0,o.usePathname)();return(0,a.useEffect)(()=>{(0,s.FE)()},[]),(0,a.useEffect)(()=>{t&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{(0,s.wn)()})})},[t]),(0,n.jsx)(n.Fragment,{children:e})}}},e=>{e.O(0,[8748,3334,1321,8441,3794,7358],()=>e(e.s=17658)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e,t,r,o,n,i,a,u,l={},c={};function f(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}},o=!0;try{l[e].call(r.exports,r,r.exports,f),o=!1}finally{o&&delete c[e]}return r.exports}f.m=l,e=[],f.O=(t,r,o,n)=>{if(r){n=n||0;for(var i=e.length;i>0&&e[i-1][2]>n;i--)e[i]=e[i-1];e[i]=[r,o,n];return}for(var a=1/0,i=0;i<e.length;i++){for(var[r,o,n]=e[i],u=!0,l=0;l<r.length;l++)(!1&n||a>=n)&&Object.keys(f.O).every(e=>f.O[e](r[l]))?r.splice(l--,1):(u=!1,n<a&&(a=n));if(u){e.splice(i--,1);var c=o();void 0!==c&&(t=c)}}return t},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var n=Object.create(null);f.r(n);var i={};t=t||[null,r({}),r([]),r(r)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,f.d(n,i),n},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>"static/chunks/"+e+".1ffc6ce531e066ce.js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},f.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var i,a,u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var c=u[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="_N_E:"+r){i=c;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.setAttribute("data-webpack","_N_E:"+r),i.src=f.tu(e)),o[e]=[t];var s=(t,r)=>{i.onerror=i.onload=null,clearTimeout(p);var n=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(r)),t)return t(r)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),a&&document.head.appendChild(i)},f.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.U=function(e){var t=new URL(e,"x:/"),r={};for(var o in t)r[o]=t[o];for(var o in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=()=>e,r)Object.defineProperty(this,o,{enumerable:!0,configurable:!0,value:r[o]})},f.U.prototype=URL.prototype,f.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("nextjs#bundler",n))),n),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",i={8068:0,
|
|
1
|
+
(()=>{"use strict";var e,t,r,o,n,i,a,u,l={},c={};function f(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}},o=!0;try{l[e].call(r.exports,r,r.exports,f),o=!1}finally{o&&delete c[e]}return r.exports}f.m=l,e=[],f.O=(t,r,o,n)=>{if(r){n=n||0;for(var i=e.length;i>0&&e[i-1][2]>n;i--)e[i]=e[i-1];e[i]=[r,o,n];return}for(var a=1/0,i=0;i<e.length;i++){for(var[r,o,n]=e[i],u=!0,l=0;l<r.length;l++)(!1&n||a>=n)&&Object.keys(f.O).every(e=>f.O[e](r[l]))?r.splice(l--,1):(u=!1,n<a&&(a=n));if(u){e.splice(i--,1);var c=o();void 0!==c&&(t=c)}}return t},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var n=Object.create(null);f.r(n);var i={};t=t||[null,r({}),r([]),r(r)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,f.d(n,i),n},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>"static/chunks/"+e+".1ffc6ce531e066ce.js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},f.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var i,a,u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var c=u[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="_N_E:"+r){i=c;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.setAttribute("data-webpack","_N_E:"+r),i.src=f.tu(e)),o[e]=[t];var s=(t,r)=>{i.onerror=i.onload=null,clearTimeout(p);var n=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(r)),t)return t(r)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),a&&document.head.appendChild(i)},f.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.U=function(e){var t=new URL(e,"x:/"),r={};for(var o in t)r[o]=t[o];for(var o in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=()=>e,r)Object.defineProperty(this,o,{enumerable:!0,configurable:!0,value:r[o]})},f.U.prototype=URL.prototype,f.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("nextjs#bundler",n))),n),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",i={8068:0,8748:0,3334:0,2574:0},f.f.j=(e,t)=>{var r=f.o(i,e)?i[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(2574|3334|8068|8748)$/.test(e))i[e]=0;else{var o=new Promise((t,o)=>r=i[e]=[t,o]);t.push(r[2]=o);var n=f.p+f.u(e),a=Error();f.l(n,t=>{if(f.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,r[1](a)}},"chunk-"+e,e)}},f.O.j=e=>0===i[e],a=(e,t)=>{var r,o,[n,a,u]=t,l=0;if(n.some(e=>0!==i[e])){for(r in a)f.o(a,r)&&(f.m[r]=a[r]);if(u)var c=u(f)}for(e&&e(t);l<n.length;l++)o=n[l],f.o(i,o)&&i[o]&&i[o][0](),i[o]=0;return f.O(c)},(u=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u))})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:sans;src:url(/_next/static/media/64bcbd4d7db4ef3a-s.p.woff2) format("woff2");font-display:swap;font-weight:400;font-style:normal}@font-face{font-family:sans;src:url(/_next/static/media/42c1e8b6f014576e-s.p.woff2) format("woff2");font-display:swap;font-weight:500;font-style:normal}@font-face{font-family:sans;src:url(/_next/static/media/0202600ddc0c26b4-s.p.woff2) format("woff2");font-display:swap;font-weight:600;font-style:normal}@font-face{font-family:sans;src:url(/_next/static/media/527eba3de31447ec-s.p.woff2) format("woff2");font-display:swap;font-weight:700;font-style:normal}@font-face{font-family:sans Fallback;src:local("Arial");ascent-override:101.35%;descent-override:27.19%;line-gap-override:0.00%;size-adjust:101.13%}.__className_939b73{font-family:sans,sans Fallback}.__variable_939b73{--font-sans:"sans","sans Fallback"}@font-face{font-family:mono;src:url(/_next/static/media/0332c089697ea3ad-s.p.woff2) format("woff2");font-display:swap;font-weight:400;font-style:normal}@font-face{font-family:mono;src:url(/_next/static/media/124eba111847a60f-s.p.woff2) format("woff2");font-display:swap;font-weight:500;font-style:normal}@font-face{font-family:mono;src:url(/_next/static/media/a03e0948a34ab92a-s.p.woff2) format("woff2");font-display:swap;font-weight:600;font-style:normal}@font-face{font-family:mono Fallback;src:local("Arial");ascent-override:77.95%;descent-override:20.91%;line-gap-override:0.00%;size-adjust:131.49%}.__className_409bfd{font-family:mono,mono Fallback}.__variable_409bfd{--font-mono:"mono","mono Fallback"}@font-face{font-family:Material Symbols Outlined;font-style:normal;font-weight:100 700;font-display:block;src:url(/_next/static/media/material-symbols-outlined.f656244e.woff2) format("woff2")}.material-symbols-outlined{font-family:Material Symbols Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}
|