@rabbi696/ezrouter 0.6.15 → 0.6.16
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/README.md +72 -1
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +27 -27
- package/app/.next-cli-build/build-manifest.json +2 -2
- 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/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/convoy/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +10 -6
- 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/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 +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/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/routing-health/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/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/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.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 +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +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/changelog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- 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/crush-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
- 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/devin-settings/route.js.nft.json +1 -1
- 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/forge-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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/omp-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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/smelt-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/export/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +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/combos/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/convoy/rules/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js +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 +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +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 +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 +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 +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/mcp-gateway/instances/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +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 +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/models/alias/route.js +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 +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/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +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 +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/enabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/enabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/callback/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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +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/grok-cli/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +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 +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/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +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 +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-health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing-health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/token-saver/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/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 +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/error-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +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 +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 +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 +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/alpha/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +3 -3
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.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 +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/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 +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.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 +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/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 +27 -27
- package/app/.next-cli-build/server/chunks/1253.js +1 -1
- package/app/.next-cli-build/server/chunks/1482.js +4 -2
- package/app/.next-cli-build/server/chunks/1531.js +1 -1
- package/app/.next-cli-build/server/chunks/1641.js +1 -0
- package/app/.next-cli-build/server/chunks/1733.js +1 -1
- package/app/.next-cli-build/server/chunks/1847.js +1 -1
- package/app/.next-cli-build/server/chunks/2269.js +1 -1
- package/app/.next-cli-build/server/chunks/2348.js +1 -1
- package/app/.next-cli-build/server/chunks/2898.js +1 -1
- package/app/.next-cli-build/server/chunks/3583.js +2 -2
- package/app/.next-cli-build/server/chunks/3593.js +2 -2
- package/app/.next-cli-build/server/chunks/369.js +22 -22
- package/app/.next-cli-build/server/chunks/3886.js +1 -1
- package/app/.next-cli-build/server/chunks/3912.js +1 -1
- package/app/.next-cli-build/server/chunks/3977.js +2 -2
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4378.js +3 -3
- package/app/.next-cli-build/server/chunks/4485.js +1 -1
- package/app/.next-cli-build/server/chunks/4574.js +1 -1
- package/app/.next-cli-build/server/chunks/4646.js +1 -1
- package/app/.next-cli-build/server/chunks/4704.js +2 -2
- package/app/.next-cli-build/server/chunks/4739.js +2 -2
- package/app/.next-cli-build/server/chunks/4768.js +1 -1
- package/app/.next-cli-build/server/chunks/4780.js +2 -2
- package/app/.next-cli-build/server/chunks/4803.js +2 -2
- package/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/app/.next-cli-build/server/chunks/4878.js +1 -1
- package/app/.next-cli-build/server/chunks/5011.js +1 -1
- package/app/.next-cli-build/server/chunks/507.js +2 -2
- package/app/.next-cli-build/server/chunks/5130.js +1 -1
- package/app/.next-cli-build/server/chunks/{8421.js → 5251.js} +1 -1
- package/app/.next-cli-build/server/chunks/5258.js +2 -2
- package/app/.next-cli-build/server/chunks/5434.js +1 -1
- package/app/.next-cli-build/server/chunks/5460.js +40 -0
- package/app/.next-cli-build/server/chunks/5704.js +254 -0
- package/app/.next-cli-build/server/chunks/5872.js +1 -0
- package/app/.next-cli-build/server/chunks/5875.js +1 -1
- package/app/.next-cli-build/server/chunks/6252.js +2 -2
- package/app/.next-cli-build/server/chunks/6420.js +1 -1
- package/app/.next-cli-build/server/chunks/6670.js +2 -2
- package/app/.next-cli-build/server/chunks/6769.js +1 -0
- package/app/.next-cli-build/server/chunks/6799.js +2 -2
- package/app/.next-cli-build/server/chunks/698.js +2 -2
- package/app/.next-cli-build/server/chunks/7073.js +2 -2
- package/app/.next-cli-build/server/chunks/7218.js +1 -1
- package/app/.next-cli-build/server/chunks/7239.js +2 -2
- package/app/.next-cli-build/server/chunks/7362.js +1 -1
- package/app/.next-cli-build/server/chunks/7594.js +6 -6
- package/app/.next-cli-build/server/chunks/7663.js +1 -1
- package/app/.next-cli-build/server/chunks/7677.js +1 -1
- package/app/.next-cli-build/server/chunks/7775.js +1 -1
- package/app/.next-cli-build/server/chunks/7811.js +1 -0
- package/app/.next-cli-build/server/chunks/7965.js +2 -2
- package/app/.next-cli-build/server/chunks/8062.js +2 -2
- package/app/.next-cli-build/server/chunks/8129.js +1 -1
- package/app/.next-cli-build/server/chunks/8231.js +1 -1
- package/app/.next-cli-build/server/chunks/8243.js +5 -5
- package/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/app/.next-cli-build/server/chunks/8469.js +2 -2
- package/app/.next-cli-build/server/chunks/8520.js +2 -2
- package/app/.next-cli-build/server/chunks/8644.js +1 -1
- package/app/.next-cli-build/server/chunks/8772.js +1 -1
- package/app/.next-cli-build/server/chunks/8976.js +1 -1
- package/app/.next-cli-build/server/chunks/9026.js +24 -24
- package/app/.next-cli-build/server/chunks/9062.js +1 -1
- package/app/.next-cli-build/server/chunks/9303.js +1 -1
- package/app/.next-cli-build/server/chunks/9485.js +1 -1
- package/app/.next-cli-build/server/chunks/9718.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/1321-73fdccd2b1bf151d.js +1 -0
- package/app/.next-cli-build/static/chunks/{5497-8766958582f95dc7.js → 5497-ff58e90f4053e184.js} +3 -3
- package/app/.next-cli-build/static/chunks/{6252-34f2d410651e1103.js → 6252-886aa8324e135e9c.js} +13 -13
- package/app/.next-cli-build/static/chunks/8105-9b41dc96e4b019cf.js +1 -0
- package/app/.next-cli-build/static/chunks/9227-4471c8f39a105c5f.js +5 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-89b4f70958736f2a.js → page-c35f746b4bd9fc90.js} +18 -14
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-fa195b4f7348e2d6.js → page-0868ecc0d2f1bd04.js} +2 -2
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-a31d9ca05cc3d528.js → page-6cb070834a750fdd.js} +1 -1
- package/app/CHANGELOG.md +54 -32
- package/app/package.json +1 -1
- package/app/public/CHANGELOG.md +54 -32
- package/app/src/mitm/server.js +24 -24
- package/cli.js +71 -69
- package/package.json +1 -1
- package/src/cli/commands/connect.js +157 -15
- package/src/cli/commands/connectTools.js +222 -4
- package/src/cli/commands/show.js +101 -0
- package/src/cli/menus/providers.js +8 -0
- package/app/.next-cli-build/server/chunks/3252.js +0 -1
- package/app/.next-cli-build/server/chunks/3267.js +0 -40
- package/app/.next-cli-build/server/chunks/6707.js +0 -1
- package/app/.next-cli-build/server/chunks/8450.js +0 -254
- package/app/.next-cli-build/server/chunks/9143.js +0 -1
- package/app/.next-cli-build/static/chunks/1321-043afc56cba448b8.js +0 -1
- package/app/.next-cli-build/static/chunks/8105-9dfc2c5ffef6e778.js +0 -1
- package/app/.next-cli-build/static/chunks/9227-af65f6ac1fca28c9.js +0 -3
- /package/app/.next-cli-build/static/{zQapcWqcr7oLVi5jh7t01 → Y5Sk8uSUyB0vJ-ZgW1X1U}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{zQapcWqcr7oLVi5jh7t01 → Y5Sk8uSUyB0vJ-ZgW1X1U}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{59736:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ep});var a=s(95155),i=s(12115),r=s(73321),l=s(98500),n=s.n(l),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(57151),x=s(47224),h=s(40228),f=s(47218);let g=["none","low","medium","high"],y=["none","thinking"],b=["none","low","medium","high","max"],v=["none","low","medium","high","xhigh","max"],j={qoder:v,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":v,"claude-budget":v,"gemini-level":["minimal","low","medium","high"],"gemini-budget":g,zai:y,qwen:g,kimi:b,opencode:b,deepseek:["none","high","max"],minimax:y,hunyuan:g,step:g,nous:g,meta:["minimal","low","medium","high","xhigh"],ollama:b},w=["none","minimal","low","medium","high","xhigh","max"],k=["none","low","medium","high","max"],N=[{pattern:"*claude*4.6*",levels:k},{pattern:"*claude*4-6*",levels:k},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"qoder",pattern:"*",levels:v},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]}];function C(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:a,minor:i}=s;return a<4||4===a&&(null===i||i<=5||null!==i&&i>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let a=String(t||"").replace(/\([^()]+\)\s*$/,""),i="codex"===e?(0,f.SM)("cx").find(e=>e.id===a)?.thinkingLevels:null,r=N.find(s=>(!s.providers||!e||s.providers.includes(e))&&(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),l=(e?h.xq[e]?.thinkingFormat:null)||s.thinkingFormat,n=i||s.thinkingLevels||r?.levels||j[l]||g;return!1===s.thinkingCanDisable&&(n=n.filter(e=>"none"!==e)),n}var S=s(11059),A=s(929),T=s(73006);let $=new Map;async function O(e){if(e?.type==="static")return e.models||[];if(!e?.url||!e?.type)return[];let t=$.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return $.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function I({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:r=!0}){let l=new Set(a.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||l.has(t.id))continue;let a=`${s}/${t.id}`;n.has(a)||(n.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!r)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||l.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}var P=s(14051),E=s.n(P);function R({model:e,fullModel:t,alias:s,copied:i,onCopy:r,testStatus:l,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===l?"#22c55e":"error"===l?"#ef4444":"slow"===l||"rate_limited"===l?"#f59e0b":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"slow"===l||"rate_limited"===l?"border-amber-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"slow"===l||"rate_limited"===l?"warning":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:f}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:r,onTest:l,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:l,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function _({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:r,copied:l,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u,onTestModel:x,externalTestResults:h,externalTestingModelIds:f,disabledModelIds:g=[]}){let y,b,[v,j]=(0,i.useState)(""),[w,k]=(0,i.useState)(!1),[N,C]=(0,i.useState)(!1),[S,A]=(0,i.useState)([]),[T,$]=(0,i.useState)(()=>new Set),[O,P]=(0,i.useState)({});(0,i.useEffect)(()=>{let e=p.find(e=>!1!==e.isActive);if(!e)return;let t=!1;return(async()=>{try{let s=await fetch(`/api/providers/${e.id}/models`);if(!s.ok)return;let a=await s.json();if(t)return;let i=(a.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(i)])}catch{}})(),()=>{t=!0}},[p]);let E=async t=>{if(x)return void await x(t);if(!T.has(t)){$(e=>new Set(e).add(t));try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();P(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{P(e=>({...e,[t]:"error"}))}finally{$(e=>{let s=new Set(e);return s.delete(t),s})}}},R=I({customModels:r,modelAliases:s,providerAlias:e,type:"llm"}),z=R.filter(e=>!g.includes(e.id)),q=async()=>{if(!v.trim()||w)return;let e=v.trim();if(R.some(t=>t.id===e))return void alert("Model already exists for this provider.");k(!0);try{await d(e),j("")}catch(e){console.log("Error adding model:",e)}finally{k(!1)}},M=async()=>{if(N)return;let e=p.find(e=>!1!==e.isActive);if(e){C(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to fetch models");let a=(s.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(a)])}catch(e){console.log("Error fetching models:",e)}finally{C(!1)}}},U=async e=>{R.some(t=>t.id===e)||(await d(e),A(t=>t.filter(t=>t!==e)))},F=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or discover them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:v,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&q(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:q,disabled:!v.trim()||w,children:w?"Adding...":"Add"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"search",onClick:M,disabled:!F||N,children:N?"Fetching...":"Fetch /models"})]}),!F&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to discover models from /models."}),z.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:s,alias:i,source:r})=>(0,a.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:l,onCopy:n,onDeleteAlias:()=>"custom"===r?m(s):o(i),onTest:p.length>0?()=>E(s):void 0,testStatus:h?.[s]||O[s],isTesting:f?.has(s)||T.has(s)},`${r}-${e}/${s}`))}),S.length>0&&(y=new Set(R.map(e=>e.id)),0===(b=S.filter(e=>!y.has(e))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Suggested models from /models (",b.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,a.jsxs)("button",{onClick:()=>U(e),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e]},e))})]}))]})}function z({isOpen:e,onClose:t,providerId:s,providerAlias:r,connections:l,customModels:n,disabledModelIds:o,onSaved:d}){let[m,u]=(0,i.useState)([]),[x,h]=(0,i.useState)(()=>new Set),[f,g]=(0,i.useState)(""),[y,b]=(0,i.useState)(!0),[v,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(""),N=(0,i.useMemo)(()=>(l||[]).filter(e=>!1!==e.isActive&&e.id).map(e=>e.id),[l]);(0,i.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{let e=[];try{let t=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(r)}`,{cache:"no-store"});t.ok&&(e=(await t.json()).ids||[])}catch{}let a=await Promise.all(N.map(async e=>{try{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let s=await t.json();return Array.isArray(s?.models)?s.models:[]}catch{return[]}}));if(t)return;let i=new Set,l=[],n=(e,t,s={})=>{let a=String(e??"").trim();!a||i.has(a)||(i.add(a),l.push({id:a,name:t||a,...s}))};for(let e of a)for(let t of e)n("string"==typeof t?t:t?.id,"string"==typeof t?t:t?.name||t?.id,{live:!0});for(let e of(0,p.KC)(s)||[]){let t=(0,p.CP)(e,"llm");t&&"llm"!==t||n(e.id,e.name)}for(let t of e)n(t,t,{stale:!0});let d=new Set(o||[]),c=e.length>0?e:l.filter(e=>!e.isCustom&&!d.has(e.id)).map(e=>e.id);u(l),h(new Set(c)),b(!1)})(),()=>{t=!0}},[e,s,r,N,o]);let C=(0,i.useMemo)(()=>(n||[]).filter(e=>e.providerAlias===r&&"llm"===(e.kind||e.type||"llm")).map(e=>({id:String(e.id).trim(),name:e.name||e.id})).filter(e=>e.id),[n,r]),S=(0,i.useMemo)(()=>{let e=f.trim().toLowerCase();return e?m.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)):m},[m,f]),A=async()=>{j(!0),k("");try{let e=Array.from(x),s=await fetch("/api/models/enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:r,ids:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`Failed to save (${s.status})`)}d?.(e),t()}catch(e){k(e?.message||"Failed to save visible models")}finally{j(!1)}};return(0,a.jsx)(c.aF,{isOpen:e,onClose:t,title:"Visible models",size:"lg",footer:null,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/8 px-2.5 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-primary",style:{fontSize:"14px"},children:"info"}),(0,a.jsxs)("span",{children:["Only the checked models are exposed on ",(0,a.jsx)("code",{className:"font-mono",children:"/v1/models"}),". Leave everything unchecked to expose all of them. Custom models are always exposed."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,a.jsx)("input",{type:"text",placeholder:"Search...",value:f,onChange:e=>g(e.target.value),className:"w-full rounded border border-border bg-surface py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set(m.map(e=>e.id))),disabled:y||v,children:"Select all"}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set),disabled:y||v,children:"Clear"})]}),w&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:w}),y?(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"Loading models…"}):(0,a.jsxs)("div",{className:"max-h-[360px] overflow-y-auto rounded-lg border border-border",children:[S.map(e=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 border-b border-border/50 px-3 py-2 last:border-b-0 hover:bg-sidebar/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:x.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"size-3.5 accent-primary cursor-pointer"}),(0,a.jsx)("span",{className:"truncate text-xs text-text-main",children:e.name}),(0,a.jsx)("code",{className:"truncate font-mono text-[11px] text-text-muted",children:e.id}),e.live&&!e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"live"}),e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:"not in catalog"})]},e.id)),0===S.length&&(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"No models found"})]}),C.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-border px-3 py-2",children:[(0,a.jsx)("p",{className:"mb-1 text-[11px] text-text-muted",children:"Always exposed (custom models)"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:C.map(e=>(0,a.jsx)("span",{className:"rounded bg-sidebar px-1.5 py-0.5 font-mono text-[11px] text-text-muted",children:e.id},e.id))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:0===x.size?"Nothing selected — all models stay visible.":`${x.size} of ${m.length} selected`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:t,disabled:v,children:"Cancel"}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:A,loading:v,disabled:y,children:"Save"})]})]})]})})}R.propTypes={model:E().shape({id:E().string.isRequired}).isRequired,fullModel:E().string.isRequired,alias:E().string,copied:E().string,onCopy:E().func.isRequired,testStatus:E().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:E().bool,isFree:E().bool,onDeleteAlias:E().func,onTest:E().func,isTesting:E().bool,onDisable:E().func,caps:E().object,thinkingSuffix:E().string},E().string.isRequired,E().string.isRequired,E().string,E().func.isRequired,E().func.isRequired,E().func,E().oneOf(["ok","error"]),E().bool,E().string.isRequired,E().object.isRequired,E().arrayOf(E().object),E().string,E().func.isRequired,E().func.isRequired,E().func.isRequired,E().func.isRequired,_.propTypes={providerStorageAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,modelAliases:E().object.isRequired,customModels:E().arrayOf(E().object),copied:E().string,onCopy:E().func.isRequired,onDeleteAlias:E().func.isRequired,onAddCustomModel:E().func.isRequired,onDeleteCustomModel:E().func.isRequired,connections:E().arrayOf(E().shape({id:E().string,isActive:E().bool})).isRequired,isAnthropic:E().bool,onTestModel:E().func,externalTestResults:E().object,externalTestingModelIds:E().instanceOf(Set),disabledModelIds:E().arrayOf(E().string)},z.propTypes={isOpen:E().bool.isRequired,onClose:E().func.isRequired,providerId:E().string.isRequired,providerAlias:E().string.isRequired,connections:E().arrayOf(E().object),customModels:E().arrayOf(E().object),disabledModelIds:E().arrayOf(E().string),onSaved:E().func};var q=s(70217);function M({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}M.propTypes={until:E().string.isRequired};var U=s(64827);let F=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function K(e){if(!e||"string"!=typeof e)return!1;let t=e.toLowerCase();return F.some(e=>t.includes(e))}function J({connection:e,plan:t=null,proxyPools:s,isOAuth:r,isFirst:l,isLast:n,onMoveUp:o,onMoveDown:d,onToggleActive:m,onUpdateProxy:p,onEdit:u,onDelete:x,onReconnect:h=null,oneByOneStatus:f=null,autoPing:g=null,fastMode:y=null}){let[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,N]=(0,i.useState)(!1),C=(0,i.useRef)(null),S=async()=>{if(y?.onToggle&&!k){N(!0);try{await y.onToggle(!y.on)}catch(e){console.error("Failed to toggle fast mode:",e)}finally{N(!1)}}},A=new Map((s||[]).map(e=>[e.id,e])),T=e.providerSpecificData?.proxyPoolId||null,$=T?A.get(T):null,O=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,I=!!T||O,P=$?`Pool: ${$.name}`:T?`Pool: ${T} (inactive/missing)`:O?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",E=g?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",R="";if($?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=$?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);R=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{R=t}}let D=$?.noProxy||e.providerSpecificData?.connectionNoProxy||"",_="default";$?.isActive===!0?_="success":(T||O)&&(_="error"),(0,i.useEffect)(()=>{if(!b)return;let e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]);let z=async e=>{w(!0);try{await p("__none__"===e?null:e)}finally{w(!1),v(!1)}},F=e.authType||(r?"oauth":"apikey"),L="oauth"===F,H="cookie"===F,B=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(L?"OAuth Account":H?"Cookie Account":"API Key"),W=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,G=t?.trim(),V=e.providerSpecificData?.chatgptPlanType?.trim(),Q="codex"===e.provider?G&&"unknown"!==G.toLowerCase()?G:V:null,[Z,X]=(0,i.useState)(!1),Y=(0,U.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{X(!!(0,U.kJ)(e))};t();let s=Y?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[Y]);let ee="unavailable"!==e.testStatus||Z?e.testStatus:"active",et=(L||H)&&"unavailable"===e.testStatus&&function(e,t){if(401===e||403===e)return!0;if(!t||"string"!=typeof t)return!1;let s=t.toLowerCase();return s.includes("unauthorized")||s.includes("token")||s.includes("invalid api key")||s.includes("revoked")||s.includes("auth")||K(t)}(e.errorCode,e.lastError),es=K(e.lastError)?"Auth expired — reconnect required":e.lastError,ea=()=>f?"queued"===f.state?"queued":"testing"===f.state?"testing":"success"===f.state?"success":"failed"===f.state?f.error?`failed: ${f.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:H?"cookie":L?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:B}),W&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:W}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(c.Ex,{variant:(0,q.g)(e.isActive,ee),size:"sm",dot:!0,children:!1===e.isActive?"disabled":ee||"Unknown"}),(0,a.jsx)(c.Ex,{variant:"default",size:"sm",children:L?"OAuth":H?"Cookie":"API Key"}),Q&&"unknown"!==Q.toLowerCase()&&(0,a.jsx)(c.Ex,{variant:"primary",size:"sm",children:Q}),I&&(0,a.jsx)(c.Ex,{variant:_,size:"sm",children:"Proxy"}),Z&&!1!==e.isActive&&(0,a.jsx)(M,{until:Y}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:es}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),ea()&&(0,a.jsx)(c.Ex,{variant:f?"success"===f.state?"success":"failed"===f.state?"error":"testing"===f.state?"primary":"default":"default",size:"sm",children:ea()})]}),I&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:P,children:P}),R&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:R}),D&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:D,children:["no_proxy: ",D]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(s||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:C,children:[(0,a.jsxs)("button",{onClick:()=>v(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${I?"text-primary":"text-text-muted hover:text-primary"}`,disabled:j,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),b&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>z("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!T?"text-primary font-medium":"text-text-main"}`,children:"None"}),(s||[]).map(e=>(0,a.jsx)("button",{onClick:()=>z(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${T===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),y&&(0,a.jsx)(c.m_,{text:"Uses the provider's faster processing mode for this account at a higher token cost. Off by default.",children:(0,a.jsxs)("button",{type:"button",role:"switch","aria-label":"Fast mode","aria-checked":y.on,disabled:k,onClick:S,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 disabled:opacity-50 ${y.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:k?"progress_activity":y.on?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast mode"})]})}),g&&(0,a.jsx)(c.m_,{text:E,children:(0,a.jsxs)("button",{onClick:()=>g.onToggle(!g.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${g.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),et&&h&&(0,a.jsxs)("button",{onClick:()=>h(e),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}J.propTypes={connection:E().shape({id:E().string,name:E().string,email:E().string,displayName:E().string,modelLockUntil:E().string,testStatus:E().string,isActive:E().bool,lastError:E().string,priority:E().number,globalPriority:E().number}).isRequired,plan:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string,proxyUrl:E().string,noProxy:E().string,isActive:E().bool})),isOAuth:E().bool.isRequired,isFirst:E().bool.isRequired,isLast:E().bool.isRequired,onMoveUp:E().func.isRequired,onMoveDown:E().func.isRequired,onToggleActive:E().func.isRequired,onUpdateProxy:E().func,onEdit:E().func.isRequired,onDelete:E().func.isRequired,onReconnect:E().func,oneByOneStatus:E().shape({state:E().string,error:E().string}),autoPing:E().shape({on:E().bool,onToggle:E().func,provider:E().string}),fastMode:E().shape({on:E().bool,onToggle:E().func})};let L=`name1|sk-key1
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{59736:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ep});var a=s(95155),i=s(12115),r=s(73321),l=s(98500),n=s.n(l),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(57151),x=s(47224),h=s(40228),f=s(89523);let g=["none","low","medium","high"],y=["none","thinking"],b=["none","low","medium","high","max"],v=["none","low","medium","high","xhigh","max"],j={qoder:v,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":v,"claude-budget":v,"gemini-level":["minimal","low","medium","high"],"gemini-budget":g,zai:y,qwen:g,kimi:b,opencode:b,deepseek:["none","high","max"],minimax:y,hunyuan:g,step:g,nous:g,meta:["minimal","low","medium","high","xhigh"],ollama:b},w=["none","minimal","low","medium","high","xhigh","max"],k=["none","low","medium","high","max"],N=[{pattern:"*claude*4.6*",levels:k},{pattern:"*claude*4-6*",levels:k},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"qoder",pattern:"*",levels:v},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]}];function C(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:a,minor:i}=s;return a<4||4===a&&(null===i||i<=5||null!==i&&i>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let a=String(t||"").replace(/\([^()]+\)\s*$/,""),i="codex"===e?(0,f.SM)("cx").find(e=>e.id===a)?.thinkingLevels:null,r=N.find(s=>(!s.providers||!e||s.providers.includes(e))&&(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),l=(e?h.xq[e]?.thinkingFormat:null)||s.thinkingFormat,n=i||s.thinkingLevels||r?.levels||j[l]||g;return!1===s.thinkingCanDisable&&(n=n.filter(e=>"none"!==e)),n}var S=s(11059),A=s(929),T=s(73006);let $=new Map;async function O(e){if(e?.type==="static")return e.models||[];if(!e?.url||!e?.type)return[];let t=$.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return $.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function I({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:r=!0}){let l=new Set(a.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||l.has(t.id))continue;let a=`${s}/${t.id}`;n.has(a)||(n.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!r)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||l.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}var P=s(14051),E=s.n(P);function R({model:e,fullModel:t,alias:s,copied:i,onCopy:r,testStatus:l,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===l?"#22c55e":"error"===l?"#ef4444":"slow"===l||"rate_limited"===l?"#f59e0b":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"slow"===l||"rate_limited"===l?"border-amber-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"slow"===l||"rate_limited"===l?"warning":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:f}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:r,onTest:l,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:l,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function _({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:r,copied:l,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u,onTestModel:x,externalTestResults:h,externalTestingModelIds:f,disabledModelIds:g=[]}){let y,b,[v,j]=(0,i.useState)(""),[w,k]=(0,i.useState)(!1),[N,C]=(0,i.useState)(!1),[S,A]=(0,i.useState)([]),[T,$]=(0,i.useState)(()=>new Set),[O,P]=(0,i.useState)({});(0,i.useEffect)(()=>{let e=p.find(e=>!1!==e.isActive);if(!e)return;let t=!1;return(async()=>{try{let s=await fetch(`/api/providers/${e.id}/models`);if(!s.ok)return;let a=await s.json();if(t)return;let i=(a.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(i)])}catch{}})(),()=>{t=!0}},[p]);let E=async t=>{if(x)return void await x(t);if(!T.has(t)){$(e=>new Set(e).add(t));try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();P(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{P(e=>({...e,[t]:"error"}))}finally{$(e=>{let s=new Set(e);return s.delete(t),s})}}},R=I({customModels:r,modelAliases:s,providerAlias:e,type:"llm"}),z=R.filter(e=>!g.includes(e.id)),q=async()=>{if(!v.trim()||w)return;let e=v.trim();if(R.some(t=>t.id===e))return void alert("Model already exists for this provider.");k(!0);try{await d(e),j("")}catch(e){console.log("Error adding model:",e)}finally{k(!1)}},M=async()=>{if(N)return;let e=p.find(e=>!1!==e.isActive);if(e){C(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to fetch models");let a=(s.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(a)])}catch(e){console.log("Error fetching models:",e)}finally{C(!1)}}},U=async e=>{R.some(t=>t.id===e)||(await d(e),A(t=>t.filter(t=>t!==e)))},F=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or discover them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:v,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&q(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:q,disabled:!v.trim()||w,children:w?"Adding...":"Add"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"search",onClick:M,disabled:!F||N,children:N?"Fetching...":"Fetch /models"})]}),!F&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to discover models from /models."}),z.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:s,alias:i,source:r})=>(0,a.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:l,onCopy:n,onDeleteAlias:()=>"custom"===r?m(s):o(i),onTest:p.length>0?()=>E(s):void 0,testStatus:h?.[s]||O[s],isTesting:f?.has(s)||T.has(s)},`${r}-${e}/${s}`))}),S.length>0&&(y=new Set(R.map(e=>e.id)),0===(b=S.filter(e=>!y.has(e))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Suggested models from /models (",b.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,a.jsxs)("button",{onClick:()=>U(e),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e]},e))})]}))]})}function z({isOpen:e,onClose:t,providerId:s,providerAlias:r,connections:l,customModels:n,disabledModelIds:o,onSaved:d}){let[m,u]=(0,i.useState)([]),[x,h]=(0,i.useState)(()=>new Set),[f,g]=(0,i.useState)(""),[y,b]=(0,i.useState)(!0),[v,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(""),N=(0,i.useMemo)(()=>(l||[]).filter(e=>!1!==e.isActive&&e.id).map(e=>e.id),[l]);(0,i.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{let e=[];try{let t=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(r)}`,{cache:"no-store"});t.ok&&(e=(await t.json()).ids||[])}catch{}let a=await Promise.all(N.map(async e=>{try{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let s=await t.json();return Array.isArray(s?.models)?s.models:[]}catch{return[]}}));if(t)return;let i=new Set,l=[],n=(e,t,s={})=>{let a=String(e??"").trim();!a||i.has(a)||(i.add(a),l.push({id:a,name:t||a,...s}))};for(let e of a)for(let t of e)n("string"==typeof t?t:t?.id,"string"==typeof t?t:t?.name||t?.id,{live:!0});for(let e of(0,p.KC)(s)||[]){let t=(0,p.CP)(e,"llm");t&&"llm"!==t||n(e.id,e.name)}for(let t of e)n(t,t,{stale:!0});let d=new Set(o||[]),c=e.length>0?e:l.filter(e=>!e.isCustom&&!d.has(e.id)).map(e=>e.id);u(l),h(new Set(c)),b(!1)})(),()=>{t=!0}},[e,s,r,N,o]);let C=(0,i.useMemo)(()=>(n||[]).filter(e=>e.providerAlias===r&&"llm"===(e.kind||e.type||"llm")).map(e=>({id:String(e.id).trim(),name:e.name||e.id})).filter(e=>e.id),[n,r]),S=(0,i.useMemo)(()=>{let e=f.trim().toLowerCase();return e?m.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)):m},[m,f]),A=async()=>{j(!0),k("");try{let e=Array.from(x),s=await fetch("/api/models/enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:r,ids:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`Failed to save (${s.status})`)}d?.(e),t()}catch(e){k(e?.message||"Failed to save visible models")}finally{j(!1)}};return(0,a.jsx)(c.aF,{isOpen:e,onClose:t,title:"Visible models",size:"lg",footer:null,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/8 px-2.5 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-primary",style:{fontSize:"14px"},children:"info"}),(0,a.jsxs)("span",{children:["Only the checked models are exposed on ",(0,a.jsx)("code",{className:"font-mono",children:"/v1/models"}),". Leave everything unchecked to expose all of them. Custom models are always exposed."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,a.jsx)("input",{type:"text",placeholder:"Search...",value:f,onChange:e=>g(e.target.value),className:"w-full rounded border border-border bg-surface py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set(m.map(e=>e.id))),disabled:y||v,children:"Select all"}),(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>h(new Set),disabled:y||v,children:"Clear"})]}),w&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:w}),y?(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"Loading models…"}):(0,a.jsxs)("div",{className:"max-h-[360px] overflow-y-auto rounded-lg border border-border",children:[S.map(e=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 border-b border-border/50 px-3 py-2 last:border-b-0 hover:bg-sidebar/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:x.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"size-3.5 accent-primary cursor-pointer"}),(0,a.jsx)("span",{className:"truncate text-xs text-text-main",children:e.name}),(0,a.jsx)("code",{className:"truncate font-mono text-[11px] text-text-muted",children:e.id}),e.live&&!e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"live"}),e.stale&&(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:"not in catalog"})]},e.id)),0===S.length&&(0,a.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"No models found"})]}),C.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-border px-3 py-2",children:[(0,a.jsx)("p",{className:"mb-1 text-[11px] text-text-muted",children:"Always exposed (custom models)"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:C.map(e=>(0,a.jsx)("span",{className:"rounded bg-sidebar px-1.5 py-0.5 font-mono text-[11px] text-text-muted",children:e.id},e.id))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:0===x.size?"Nothing selected — all models stay visible.":`${x.size} of ${m.length} selected`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:t,disabled:v,children:"Cancel"}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:A,loading:v,disabled:y,children:"Save"})]})]})]})})}R.propTypes={model:E().shape({id:E().string.isRequired}).isRequired,fullModel:E().string.isRequired,alias:E().string,copied:E().string,onCopy:E().func.isRequired,testStatus:E().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:E().bool,isFree:E().bool,onDeleteAlias:E().func,onTest:E().func,isTesting:E().bool,onDisable:E().func,caps:E().object,thinkingSuffix:E().string},E().string.isRequired,E().string.isRequired,E().string,E().func.isRequired,E().func.isRequired,E().func,E().oneOf(["ok","error"]),E().bool,E().string.isRequired,E().object.isRequired,E().arrayOf(E().object),E().string,E().func.isRequired,E().func.isRequired,E().func.isRequired,E().func.isRequired,_.propTypes={providerStorageAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,modelAliases:E().object.isRequired,customModels:E().arrayOf(E().object),copied:E().string,onCopy:E().func.isRequired,onDeleteAlias:E().func.isRequired,onAddCustomModel:E().func.isRequired,onDeleteCustomModel:E().func.isRequired,connections:E().arrayOf(E().shape({id:E().string,isActive:E().bool})).isRequired,isAnthropic:E().bool,onTestModel:E().func,externalTestResults:E().object,externalTestingModelIds:E().instanceOf(Set),disabledModelIds:E().arrayOf(E().string)},z.propTypes={isOpen:E().bool.isRequired,onClose:E().func.isRequired,providerId:E().string.isRequired,providerAlias:E().string.isRequired,connections:E().arrayOf(E().object),customModels:E().arrayOf(E().object),disabledModelIds:E().arrayOf(E().string),onSaved:E().func};var q=s(70217);function M({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}M.propTypes={until:E().string.isRequired};var U=s(64827);let F=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function K(e){if(!e||"string"!=typeof e)return!1;let t=e.toLowerCase();return F.some(e=>t.includes(e))}function J({connection:e,plan:t=null,proxyPools:s,isOAuth:r,isFirst:l,isLast:n,onMoveUp:o,onMoveDown:d,onToggleActive:m,onUpdateProxy:p,onEdit:u,onDelete:x,onReconnect:h=null,oneByOneStatus:f=null,autoPing:g=null,fastMode:y=null}){let[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,N]=(0,i.useState)(!1),C=(0,i.useRef)(null),S=async()=>{if(y?.onToggle&&!k){N(!0);try{await y.onToggle(!y.on)}catch(e){console.error("Failed to toggle fast mode:",e)}finally{N(!1)}}},A=new Map((s||[]).map(e=>[e.id,e])),T=e.providerSpecificData?.proxyPoolId||null,$=T?A.get(T):null,O=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,I=!!T||O,P=$?`Pool: ${$.name}`:T?`Pool: ${T} (inactive/missing)`:O?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",E=g?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",R="";if($?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=$?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);R=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{R=t}}let D=$?.noProxy||e.providerSpecificData?.connectionNoProxy||"",_="default";$?.isActive===!0?_="success":(T||O)&&(_="error"),(0,i.useEffect)(()=>{if(!b)return;let e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]);let z=async e=>{w(!0);try{await p("__none__"===e?null:e)}finally{w(!1),v(!1)}},F=e.authType||(r?"oauth":"apikey"),L="oauth"===F,H="cookie"===F,B=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(L?"OAuth Account":H?"Cookie Account":"API Key"),W=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,G=t?.trim(),V=e.providerSpecificData?.chatgptPlanType?.trim(),Q="codex"===e.provider?G&&"unknown"!==G.toLowerCase()?G:V:null,[Z,X]=(0,i.useState)(!1),Y=(0,U.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{X(!!(0,U.kJ)(e))};t();let s=Y?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[Y]);let ee="unavailable"!==e.testStatus||Z?e.testStatus:"active",et=(L||H)&&"unavailable"===e.testStatus&&function(e,t){if(401===e||403===e)return!0;if(!t||"string"!=typeof t)return!1;let s=t.toLowerCase();return s.includes("unauthorized")||s.includes("token")||s.includes("invalid api key")||s.includes("revoked")||s.includes("auth")||K(t)}(e.errorCode,e.lastError),es=K(e.lastError)?"Auth expired — reconnect required":e.lastError,ea=()=>f?"queued"===f.state?"queued":"testing"===f.state?"testing":"success"===f.state?"success":"failed"===f.state?f.error?`failed: ${f.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:H?"cookie":L?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:B}),W&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:W}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(c.Ex,{variant:(0,q.g)(e.isActive,ee),size:"sm",dot:!0,children:!1===e.isActive?"disabled":ee||"Unknown"}),(0,a.jsx)(c.Ex,{variant:"default",size:"sm",children:L?"OAuth":H?"Cookie":"API Key"}),Q&&"unknown"!==Q.toLowerCase()&&(0,a.jsx)(c.Ex,{variant:"primary",size:"sm",children:Q}),I&&(0,a.jsx)(c.Ex,{variant:_,size:"sm",children:"Proxy"}),Z&&!1!==e.isActive&&(0,a.jsx)(M,{until:Y}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:es}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),ea()&&(0,a.jsx)(c.Ex,{variant:f?"success"===f.state?"success":"failed"===f.state?"error":"testing"===f.state?"primary":"default":"default",size:"sm",children:ea()})]}),I&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:P,children:P}),R&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:R}),D&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:D,children:["no_proxy: ",D]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(s||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:C,children:[(0,a.jsxs)("button",{onClick:()=>v(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${I?"text-primary":"text-text-muted hover:text-primary"}`,disabled:j,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),b&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>z("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!T?"text-primary font-medium":"text-text-main"}`,children:"None"}),(s||[]).map(e=>(0,a.jsx)("button",{onClick:()=>z(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${T===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),y&&(0,a.jsx)(c.m_,{text:"Uses the provider's faster processing mode for this account at a higher token cost. Off by default.",children:(0,a.jsxs)("button",{type:"button",role:"switch","aria-label":"Fast mode","aria-checked":y.on,disabled:k,onClick:S,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 disabled:opacity-50 ${y.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:k?"progress_activity":y.on?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast mode"})]})}),g&&(0,a.jsx)(c.m_,{text:E,children:(0,a.jsxs)("button",{onClick:()=>g.onToggle(!g.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${g.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),et&&h&&(0,a.jsxs)("button",{onClick:()=>h(e),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),y&&(0,a.jsx)(c.m_,{text:y.on?"Fast mode ON — Codex requests on this account use the priority tier. Click to disable.":"Force fast mode — Codex requests on this account use the priority tier.",children:(0,a.jsxs)("button",{onClick:()=>y.onToggle(!y.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${y.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"speed"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast"})]})}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}J.propTypes={connection:E().shape({id:E().string,name:E().string,email:E().string,displayName:E().string,modelLockUntil:E().string,testStatus:E().string,isActive:E().bool,lastError:E().string,priority:E().number,globalPriority:E().number}).isRequired,plan:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string,proxyUrl:E().string,noProxy:E().string,isActive:E().bool})),isOAuth:E().bool.isRequired,isFirst:E().bool.isRequired,isLast:E().bool.isRequired,onMoveUp:E().func.isRequired,onMoveDown:E().func.isRequired,onToggleActive:E().func.isRequired,onUpdateProxy:E().func,onEdit:E().func.isRequired,onDelete:E().func.isRequired,onReconnect:E().func,oneByOneStatus:E().shape({state:E().string,error:E().string}),autoPing:E().shape({on:E().bool,onToggle:E().func,provider:E().string}),fastMode:E().shape({on:E().bool,onToggle:E().func})};let L=`name1|sk-key1
|
|
2
2
|
name2|sk-key2
|
|
3
3
|
sk-key-only-auto-named`,H="__none__",B=()=>({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:H,baseUrl:"",ollamaHostUrl:""}),W=()=>({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""});function G({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,providerNode:n,authType:o,authHint:d,website:p,proxyPools:u,error:x,existingNames:h,onSave:f,onBulkDone:g,onClose:y}){let b="ollama-local"===t,v="cookie"===o,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k=m.Q2?.[t]?.baseUrlField||null,N="azure"===t,C="cloudflare-ai"===t,S="vertex"===t||"vertex-partner"===t,A="bedrock"===t,T=m.Q2?.[t]?.apiKeyOptionalWith||null,$=m.Q2?.[t]?.regions||null,O=m.Q2?.[t]?.defaultRegion||$?.[0]?.id||"",[I,P]=(0,i.useState)(B),[E,R]=(0,i.useState)(W),[D,_]=(0,i.useState)({accountId:""}),[z,q]=(0,i.useState)({location:"global",reasoningEffort:"high"}),[M,U]=(0,i.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[F,K]=(0,i.useState)(O),[J,V]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(null),[X,Y]=(0,i.useState)(!1),ee=C?`name1|sk-key1|acc123456
|
|
4
4
|
name2|sk-key2|def789012
|
|
@@ -24,4 +24,4 @@ pt-only-auto-named`:L,[et,es]=(0,i.useState)("single"),[ea,ei]=(0,i.useState)(""
|
|
|
24
24
|
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
|
|
25
25
|
"email": "account2@example.com"
|
|
26
26
|
}
|
|
27
|
-
]`;function ei(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function er({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(null),y=(0,i.useRef)(null),b=()=>{n||(l(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,T.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),a=ei(t);Array.isArray(a)?e.push(...a):a&&e.push(a)}if(0===e.length)return void m((0,T.Tl)("No accounts found in selected files"));l(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,T.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=ei(r)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),a=await t.json();if(!t.ok)return void m(a?.error||`Request failed: ${t.status}`);u(a),a.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,a.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,a.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,T.Tl)("Upload JSON Files")})]}),(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,a.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:ea,value:r,onChange:e=>{l(e.target.value),g(null)},disabled:n}),x&&(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,a.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,T.Tl)("Drop .json files here")})]})]}),f&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,a.jsxs)("span",{children:[(0,T.Tl)("Loaded")," ",f.accountsCount," ",(0,T.Tl)("account(s) from")," ",f.filesCount," ",(0,T.Tl)("file(s)")]})]}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,T.Tl)("failed")]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!r.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}var el=s(65921);let en=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],eo=/^[A-Za-z0-9-]+$/;function ed({providerId:e}){let t=(0,el.i)(),[s,r]=(0,i.useState)(!1),[l,n]=(0,i.useState)([{name:"",value:""}]),[o,d]=(0,i.useState)({}),[m,p]=(0,i.useState)(!1),[u,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(a.length?a:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(a=>a.map((a,i)=>i===e?{...a,[t]:s}:a))},f=(0,i.useCallback)(async()=>{let s={};for(let e of l.filter(e=>e.name.trim())){let a=e.name.trim();if(!eo.test(a))return void t.error(`Invalid header name: ${a}`);if(en.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}x(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[l,o,e,t]);return 0!==Object.keys(o).length||m?(0,a.jsxs)(c.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:l.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,a.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}ed.propTypes={providerId:E().string.isRequired};let ec={claude:"claudeAutoPing",codex:"codexAutoPing"},em=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function ep(){let e,t,s,l,u,x=(0,r.useParams)(),h=(0,r.useRouter)(),f=x.id,{getCaps:g}=(0,A.y)(),[y,b]=(0,i.useState)([]),[v,j]=(0,i.useState)(1),[w,k]=(0,i.useState)(10),[N,$]=(0,i.useState)(!0),[P,E]=(0,i.useState)(null),[D,q]=(0,i.useState)([]),[M,U]=(0,i.useState)(!1),[F,K]=(0,i.useState)(!1),[L,H]=(0,i.useState)(!1),[B,W]=(0,i.useState)(!1),[V,Q]=(0,i.useState)(""),[Z,Y]=(0,i.useState)(!1),[et,ea]=(0,i.useState)(!1),[ei,el]=(0,i.useState)(!1),[en,eo]=(0,i.useState)(!1),[ep,eu]=(0,i.useState)(!1),[ex,eh]=(0,i.useState)(null),[ef,eg]=(0,i.useState)({}),[ey,eb]=(0,i.useState)([]),[ev,ej]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)({}),[eN,eC]=(0,i.useState)(""),[eS,eA]=(0,i.useState)(()=>new Set),[eT,e$]=(0,i.useState)(!1),[eO,eI]=(0,i.useState)([]),[eP,eE]=(0,i.useState)("__none__"),[eR,eD]=(0,i.useState)(!1),[e_,ez]=(0,i.useState)(null),[eq,eM]=(0,i.useState)(""),[eU,eF]=(0,i.useState)("auto"),[eK,eJ]=(0,i.useState)("auto"),[eL,eH]=(0,i.useState)(""),[eB,eW]=(0,i.useState)({enabled:!1,connections:{}}),[eG,eV]=(0,i.useState)([]),[eQ,eZ]=(0,i.useState)([]),[eX,eY]=(0,i.useState)(null),[e0,e1]=(0,i.useState)([]),[e2,e5]=(0,i.useState)([]),[e3,e4]=(0,i.useState)([]),[e6,e8]=(0,i.useState)(!1),[e7,e9]=(0,i.useState)(null),[te,tt]=(0,i.useState)(!1),[ts,ta]=(0,i.useState)(!1),[ti,tr]=(0,i.useState)(!1),[tl,tn]=(0,i.useState)(null),[to,td]=(0,i.useState)({}),[tc,tm]=(0,i.useState)(null),tp=(0,i.useRef)(!1),[tu,tx]=(0,i.useState)(!1),[th,tf]=(0,i.useState)(!1),{copied:tg,copy:ty}=(0,S.C)(),tb="ag_risk_confirmed",tv=()=>{U(!0)},tj=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tb)?tt(!0):"xiaomi-mimo"===f?K(!0):tS?tv():(Q(""),W(!0))},tw=()=>{Q(""),W(!0)},tk=()=>{tS?tj():tw()},tN=P?{id:P.id,name:P.name||("anthropic-compatible"===P.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===P.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===P.type?"AC":"OC",apiType:P.apiType,baseUrl:P.baseUrl,type:P.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tC=tN?.authModes||[],tS=!!m.zN[f]||!!m.IS[f]||tC.includes("oauth"),tA=!!m.fg[f]||tC.includes("apikey"),tT=!!m.IS[f]?.noAuth,t$=(0,p.KC)(f),tO=("cursor"===f||"zed"===f)&&eQ.length>0?eQ:t$,tI=(0,m.wG)(f),tP=(0,m.mq)(f),tE=(0,m.gb)(f),tR=tP||tE,tD=!tR&&tS&&tA,t_="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tz="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tq=e=>{if(!eU||"auto"===eU)return null;let t=C(f,e);return t&&t.includes(eU)?eU:null},tM=tR?f:tI,tU=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=C(f,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tO)s(e.id);for(let e of e0)s(e.id);for(let e of ey)e.providerAlias===tM&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tF=tR?P?.prefix||f:tI,tK=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{cache:"no-store"}),t=await e.json();e.ok&&e5(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tM]),tJ=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(tM)}`,{cache:"no-store"}),t=await e.json();e.ok&&e4(t.ids||[])}catch(e){console.log("Error fetching enabled models:",e)}},[tM]),tL=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:[e]})})).ok&&await tK()}catch(e){console.log("Error disabling model:",e)}},tH=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tK()}catch(e){console.log("Error enabling model:",e)}},tB=async e=>{e.length&&e9({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e9(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:e})})).ok&&await tK()}catch(e){console.log("Error disabling all models:",e)}}})},tW=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{method:"DELETE"})).ok&&await tK()}catch(e){console.log("Error enabling all models:",e)}},tG=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&eg(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tV=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eb(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e1(e.models)}).catch(()=>{})},[f]);let tQ=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(f)}`,{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),r=await t.json(),l=await s.json(),n=a.ok?await a.json():{};e.ok&&b(i.connections||[]),s.ok&&q(l.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};ez(o.fallbackStrategy||null),eM(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eF(d.mode||"auto");let c=(n.retryDelayByProvider||{})[f];eJ(null!=c&&"auto"!==c?String(c):"auto");let m=(n.rpmByProvider||{})[f];eH(null!=m?String(m):"");let p=ec[f],u=p&&n[p]||{};if(eW({enabled:!0===u.enabled,connections:u.connections||{}}),t.ok){let e=(r.nodes||[]).find(e=>e.id===f)||null;if(!e&&tR)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===f)||null))break}E(e)}}catch(e){console.log("Error fetching connections:",e)}finally{$(!1)}},[f,tR]),tZ=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(E(s.node),await tQ(),eo(!1))}catch(e){console.log("Error updating provider node:",e)}},tX=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let r={...a};0===Object.keys(i).length?delete r[f]:r[f]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}},tY=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t0=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?s[f]=Number(e):delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:s})})}catch(e){console.log("Error saving retry delay:",e)}},t1=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).rpmByProvider||{}},a=String(e??"").trim();""===a?delete s[f]:s[f]=Math.max(0,Number(a)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:s})})}catch(e){console.log("Error saving RPM limit:",e)}},t2=async e=>{let t=ec[f];if(t){eW(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tQ(),tG(),tV(),tK(),tJ()},[tQ,tG,tV,tK,tJ]),(0,i.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eZ([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eZ([]),"zed"===f&&eY(null);return}let t=!1;return"zed"===f&&eY(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eZ(s.models),"zed"===f&&s?.warning&&eY(s.warning);return}"zed"===f&&(eZ([]),eY(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eZ([]),eY("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,i.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&O(e).then(eV)},[f]);let t5=async(e,t,s=tI)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tG();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t3=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tG()}catch(e){console.log("Error deleting alias:",e)}},t4=async(e,t="llm",s=tM,a,i)=>{try{let r=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...a?{caps:a}:{},...i?{transport:i}:{}})}),l=await r.json().catch(()=>({}));r.ok?(!1===l.added&&alert("Model already exists (duplicate). Check built-in or custom list."),await tV(),window.dispatchEvent(new CustomEvent("customModelChanged"))):alert(l.error||"Failed to add custom model")}catch(e){console.log("Error adding custom model:",e),alert(e.message||"Failed to add custom model")}},t6=async(e,t="llm",s=tM)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t8=async()=>{if(tu)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Qoder connection first"));tx(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");ey.some(e=>e.providerAlias===tM&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tM}/${s}`)||(await t4(s,"llm",tM),i+=1)}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tx(!1)}},t7=async()=>{if(th)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Cline connection first"));tf(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;t&&(ey.some(e=>e.providerAlias===tM&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tM}/${t}`)||(await t4(t,"llm",tM),i+=1))}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tf(!1)}},t9=async()=>{if(ts||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));tp.current=!1,ta(!0),tr(!1),tn(null),td(e),tm({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(tp.current){tm({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=y[e];tn(a.id),td(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),r=!!i.valid;r?t+=1:s+=1,td(e=>({...e,[a.id]:{state:r?"success":"failed",error:r?null:i.error||null}}))}catch(e){s+=1,td(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tm({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tn(null),ta(!1),tr(!1),tp.current=!1}},se=async e=>{e9({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e9(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},st=()=>{tQ(),U(!1)},ss=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok)return await tQ(),!0;Q(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Q("Failed to save connection")}return!1},sa=async e=>{try{(await fetch(`/api/providers/${ex.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tQ(),el(!1))}catch(e){console.log("Error updating connection:",e)}},si=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sr=async(e,t)=>{let s=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to save fast mode");b(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,fastMode:t}}:s))},sl=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tQ()}},sn=y.filter(e=>eO.includes(e.id));(0,i.useEffect)(()=>{eI(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===sn.length)return;let e=new Set(sn.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=D.find(e=>e.id===t);return s?.name}})();let so=()=>{eR||eu(!1)},sd=async e=>{eD(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tQ(),eu(!1)}finally{eD(!1)}},sc=e=>sd(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:sm,items:sp,start:su}=function(e=[],t=1,s=10){let a=Array.isArray(e)?e:[],i=Number.isFinite(s)&&s>=1?Math.floor(s):10,r=a.length,l=Math.max(1,Math.ceil(r/i)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,l),d=(o-1)*i,c=a.slice(d,d+i);return{currentPage:o,totalPages:l,totalItems:r,start:d,items:c,pageSize:i}}(y,v,w),sx=new Set(sp.map(e=>e.id)),sh=sp.length>0&&sp.every(e=>eO.includes(e.id)),sf=(0,a.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[sp.map((e,t)=>{let s,i=su+t;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eO.includes(s)),onChange:()=>{var t;return t=e.id,void eI(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(J,{connection:e,proxyPools:D,isOAuth:tS,isFirst:0===i,isLast:i===y.length-1,onMoveUp:()=>sl(i,i-1),onMoveDown:()=>sl(i,i+1),onToggleActive:t=>si(e.id,t),fastMode:tN?.fastMode?{on:e.providerSpecificData?.fastMode===!0,onToggle:t=>sr(e.id,t)}:null,autoPing:ec[f]&&"oauth"===e.authType?{on:!0===eB.connections[e.id],onToggle:t=>{var s;return s=e.id,void t2({...eB,connections:{...eB.connections,[s]:t}})},provider:f}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{eh(e),el(!0)},onReconnect:()=>{"iflow"===f?H(!0):U(!0)},onDelete:()=>se(e.id),oneByOneStatus:to[e.id]||null})})]},e.id)}),y.length>10&&(0,a.jsx)(c.dK,{currentPage:sm,pageSize:w,totalItems:y.length,onPageChange:j,onPageSizeChange:e=>{k(e),j(1)},allowCustomPageSize:!0,maxPageSize:200})]}),sg=D.filter(e=>!0===e.isActive),sy=(0,a.jsx)(c.aF,{isOpen:ep,onClose:so,title:`Apply Proxy (${y.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=D.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):sd(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eR||0===sg.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sc(null),disabled:eR,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(e=>(0,a.jsxs)("button",{onClick:()=>sc(e.id),disabled:eR||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eR&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(c.$n,{onClick:so,variant:"ghost",fullWidth:!0,disabled:eR,children:"Cancel"})]})}),sb=async e=>{if(!eS.has(e)){eA(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tM}/${e}`})}),s=await t.json();ek(t=>({...t,[e]:s.ok?"ok":"error"})),eC(s.ok?"":s.error||"Model not reachable")}catch{ek(t=>({...t,[e]:"error"})),eC("Network error")}finally{eA(t=>{let s=new Set(t);return s.delete(e),s})}}};if(N)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]});if(!tN)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sv=()=>tP&&tN.apiType?"responses"===tN.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tE?"/providers/anthropic-m.png":(0,d.HY)(tN.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tN.color}15`},children:ev||!sv()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tN.color},children:tN.textIcon||tN.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:sv(),alt:tN.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tN.id),ej(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tN.name}),(tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website)&&(0,a.jsxs)("a",{href:tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tN.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]}),(0,a.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,a.jsx)("input",{type:"number",min:"0",value:eL,placeholder:String(m.W[f]||0),onChange:e=>eH(e.target.value),onBlur:e=>t1(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,a.jsx)("select",{value:eK,onChange:e=>{var t;eJ(t=e.target.value),t0(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:em.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tN.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tN.deprecationNotice})]}),tN.notice?.text&&!tN.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tN.notice.text}),tN.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tN.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),tR&&P&&(0,a.jsx)(c.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tE?"Messages API":"responses"===P.apiType?"Responses API":"Chat Completions"," \xb7 ",(P.baseUrl||"").replace(/\/$/,""),"/",tE?"messages":"responses"===P.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),W(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>eo(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e9({title:"Delete Compatible Node",message:`Delete this ${tE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e9(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tT?(0,a.jsx)(c.gw,{providerId:f}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&D.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eu(!0),children:"Apply Proxy"}),y.length>0&&(0,a.jsxs)(a.Fragment,{children:[eO.length>0&&(0,a.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eO.length;0!==e&&e9({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e9(null);let e=0,t=[...eO];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eI([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eO.length,")"]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:t9,disabled:ts,children:ts?"Testing Connection One-by-One...":"Test Connection One-by-One"}),ts&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{ts&&(tp.current=!0,tr(!0))},disabled:ti,children:ti?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(c.lM,{checked:"round-robin"===e_,onChange:e=>{let t=e?"round-robin":null,s=e?eq||"1":eq;e&&!eq&&eM("1"),ez(t),tX(t,s)}}),(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium ml-2",children:"Cache Affinity"}),(0,a.jsx)(c.lM,{checked:"cache-affinity"===e_,onChange:e=>{let t=e?"cache-affinity":null;ez(t),tX(t,eq)}}),"round-robin"===e_&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eq,onChange:e=>{var t;eM(t=e.target.value),tX("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tS?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tD&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",t_," or ",tz,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,children:tz})]}):(0,a.jsxs)(a.Fragment,{children:[!tR&&"iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ea(!0),children:(0,T.Tl)("Bulk Add")}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,children:tR?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tc&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",tc.total]}),(0,a.jsxs)("span",{children:["Completed: ",tc.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tc.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tc.failed]}),tc.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),ts&&tl&&(0,a.jsxs)("span",{children:["Running: ",y.find(e=>e.id===tl)?.name||tl]})]})}),y.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:sh,onChange:()=>{sh?eI(e=>e.filter(e=>!sx.has(e))):eI(e=>{let t=new Set(e);for(let e of sx)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sf,!tR&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,T.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ea(!0),title:(0,T.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,className:"w-full sm:w-auto",children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,className:"w-full sm:w-auto",children:tz})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsx)(ed,{providerId:f}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tU&&(0,a.jsx)("select",{value:eU,onChange:e=>{var t;eF(t=e.target.value),tY(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tU.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tR&&(e=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e2.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[e2.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tW,children:"Active All"}),e.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tB(e),children:"Disable All"})]}))]}),!!eN&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:eN}),/RegionError|hosted in China|regionNotAllowed/i.test(eN)&&(s=(t="string"==typeof eN?eN:JSON.stringify(eN)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),l=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:l?`https://opencode.ai/workspace/${l[0]}/go`:"https://opencode.ai",(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,a.jsx)("span",{children:"Allow China-hosted models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eX&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eX}),(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>e8(!0),className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-main transition-colors hover:border-primary/40 hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"visibility"}),"Visible models",e3.length>0?` (${e3.length})`:""]}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:e3.length>0?`Only these ${e3.length} models are exposed on /v1/models`:"All models are exposed on /v1/models"})]}),(()=>{let e,t,s;if(tR)return(0,a.jsx)(_,{providerStorageAlias:tM,providerDisplayAlias:tF,modelAliases:ef,customModels:ey,copied:tg,onCopy:ty,onSetAlias:t5,onDeleteAlias:t3,onAddCustomModel:e=>t4(e,"llm",tM),onDeleteCustomModel:e=>t6(e,"llm",tM),connections:y,isAnthropic:tE});let i=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),r=new Set(e2),l=i.filter(e=>!r.has(e.id)),n=i.filter(e=>r.has(e.id)),o=I({customModels:ey,modelAliases:ef,providerAlias:tM,builtInModels:tO,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,a.jsx)(R,{model:{id:e.id,name:e.name},fullModel:`${tF}/${e.id}`,alias:e.alias,copied:tg,onCopy:ty,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t6(e.id,"llm",tM):t3(e.alias)},testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tq(e.id)},`${e.source}-${e.fullModel}`)),l.map(e=>{let t=`${tM}/${e.id}`,s=`${f}/${e.id}`,i=Object.entries(ef).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(R,{model:e,fullModel:`${tF}/${e.id}`,alias:i,copied:tg,onCopy:ty,onSetAlias:t=>t5(e.id,t,tM),onDeleteAlias:()=>t3(i),testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isFree:e.isFree,onDisable:()=>tL(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tq(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>e$(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===f||"qoder-cn"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t8,disabled:tu,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tu?{animation:"spin 1s linear infinite"}:void 0,children:tu?"progress_activity":"download"}),tu?(0,T.Tl)("Fetching..."):(0,T.Tl)("Fetch Qoder Models")]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t7,disabled:th,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:th?{animation:"spin 1s linear infinite"}:void 0,children:th?"progress_activity":"download"}),th?(0,T.Tl)("Fetching..."):(0,T.Tl)("Import from /models")]}),eG.length>0&&(e=new Set([...Object.values(ef),...o.map(e=>e.fullModel)]),t=new Set(tO.map(e=>e.id)),0===(s=eG.filter(s=>!e.has(`${tM}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t4(e.id,"llm",tM)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>tH(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),sy,"kiro"===f?(0,a.jsx)(c.Mh,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"cursor"===f?(0,a.jsx)(c.G9,{isOpen:M,onSuccess:st,onClose:()=>U(!1)}):"zed"===f?(0,a.jsx)(c.TE,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"gitlab"===f?(0,a.jsx)(c.vj,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):(0,a.jsx)(c.LF,{isOpen:M,provider:f,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}),(0,a.jsx)(c.LH,{isOpen:F,onSuccess:st,onClose:()=>K(!1)}),"iflow"===f&&(0,a.jsx)(c.vE,{isOpen:L,onSuccess:()=>{tQ(),H(!1)},onClose:()=>H(!1)}),(0,a.jsx)(G,{isOpen:B,provider:f,providerName:tN.name,isCompatible:tR,isAnthropic:tE,authType:tN?.authType,authHint:tN?.authHint,website:tN?.website,proxyPools:D,error:V,existingNames:y.map(e=>e.name).filter(Boolean),onSave:ss,onBulkDone:tQ,onClose:()=>{Q(""),W(!1)}}),(0,a.jsx)(c.wI,{isOpen:ei,connection:ex,proxyPools:D,onSave:sa,onClose:()=>el(!1)}),tR&&(0,a.jsx)(X,{isOpen:en,node:P,onSave:tZ,onClose:()=>eo(!1),isAnthropic:tE}),!tR&&(0,a.jsx)(ee,{isOpen:eT,providerAlias:tM,providerDisplayAlias:tF,onSave:async(e,t,s)=>{await t4(e,t?.stt?"stt":"llm",tM,t,s),e$(!1)},onClose:()=>e$(!1)}),e6&&(0,a.jsx)(z,{isOpen:!0,onClose:()=>e8(!1),providerId:f,providerAlias:tM,connections:y,customModels:ey,disabledModelIds:e2,onSaved:e=>{e4(e),tK()}}),"codex"===f&&(0,a.jsx)(es,{isOpen:Z,onClose:()=>Y(!1),onSuccess:tQ}),"grok-cli"===f&&(0,a.jsx)(er,{isOpen:et,onClose:()=>ea(!1),onSuccess:tQ}),(0,a.jsx)(c.uo,{isOpen:te,onClose:()=>tt(!1),onConfirm:()=>{(window.localStorage.setItem(tb,"true"),tt(!1),tS)?tv():tw()},title:"Risk Notice",message:tN?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(c.uo,{isOpen:!!e7,onClose:()=>e9(null),onConfirm:e7?.onConfirm,title:e7?.title||"Confirm",message:e7?.message,variant:"danger"})]})}},64827:(e,t,s)=>{"use strict";function a(e){if(!e)return null;let t=null,s=Date.now();for(let[a,i]of Object.entries(e)){if(!a.startsWith("modelLock_")||!i)continue;let e=new Date(i).getTime();e<=s||(!t||e<t)&&(t=e)}return t?new Date(t).toISOString():null}s.d(t,{kJ:()=>a}),s(10904)},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},85295:(e,t,s)=>{Promise.resolve().then(s.bind(s,59736))}},e=>{e.O(0,[763,5772,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
|
|
27
|
+
]`;function ei(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function er({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(null),y=(0,i.useRef)(null),b=()=>{n||(l(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,T.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),a=ei(t);Array.isArray(a)?e.push(...a):a&&e.push(a)}if(0===e.length)return void m((0,T.Tl)("No accounts found in selected files"));l(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,T.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=ei(r)}catch(e){m(`${(0,T.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,T.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),a=await t.json();if(!t.ok)return void m(a?.error||`Request failed: ${t.status}`);u(a),a.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,T.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,T.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,T.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,a.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,a.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,T.Tl)("Upload JSON Files")})]}),(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,a.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:ea,value:r,onChange:e=>{l(e.target.value),g(null)},disabled:n}),x&&(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,a.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,T.Tl)("Drop .json files here")})]})]}),f&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,a.jsxs)("span",{children:[(0,T.Tl)("Loaded")," ",f.accountsCount," ",(0,T.Tl)("account(s) from")," ",f.filesCount," ",(0,T.Tl)("file(s)")]})]}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,T.Tl)("failed")]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!r.trim(),children:n?(0,T.Tl)("Importing..."):(0,T.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,T.Tl)("Close")})]})]})})}var el=s(65921);let en=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],eo=/^[A-Za-z0-9-]+$/;function ed({providerId:e}){let t=(0,el.i)(),[s,r]=(0,i.useState)(!1),[l,n]=(0,i.useState)([{name:"",value:""}]),[o,d]=(0,i.useState)({}),[m,p]=(0,i.useState)(!1),[u,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(a.length?a:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(a=>a.map((a,i)=>i===e?{...a,[t]:s}:a))},f=(0,i.useCallback)(async()=>{let s={};for(let e of l.filter(e=>e.name.trim())){let a=e.name.trim();if(!eo.test(a))return void t.error(`Invalid header name: ${a}`);if(en.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}x(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[l,o,e,t]);return 0!==Object.keys(o).length||m?(0,a.jsxs)(c.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:l.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,a.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}ed.propTypes={providerId:E().string.isRequired};let ec={claude:"claudeAutoPing",codex:"codexAutoPing"},em=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function ep(){let e,t,s,l,u,x=(0,r.useParams)(),h=(0,r.useRouter)(),f=x.id,{getCaps:g}=(0,A.y)(),[y,b]=(0,i.useState)([]),[v,j]=(0,i.useState)(1),[w,k]=(0,i.useState)(10),[N,$]=(0,i.useState)(!0),[P,E]=(0,i.useState)(null),[D,q]=(0,i.useState)([]),[M,U]=(0,i.useState)(!1),[F,K]=(0,i.useState)(!1),[L,H]=(0,i.useState)(!1),[B,W]=(0,i.useState)(!1),[V,Q]=(0,i.useState)(""),[Z,Y]=(0,i.useState)(!1),[et,ea]=(0,i.useState)(!1),[ei,el]=(0,i.useState)(!1),[en,eo]=(0,i.useState)(!1),[ep,eu]=(0,i.useState)(!1),[ex,eh]=(0,i.useState)(null),[ef,eg]=(0,i.useState)({}),[ey,eb]=(0,i.useState)([]),[ev,ej]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)({}),[eN,eC]=(0,i.useState)(""),[eS,eA]=(0,i.useState)(()=>new Set),[eT,e$]=(0,i.useState)(!1),[eO,eI]=(0,i.useState)([]),[eP,eE]=(0,i.useState)("__none__"),[eR,eD]=(0,i.useState)(!1),[e_,ez]=(0,i.useState)(null),[eq,eM]=(0,i.useState)(""),[eU,eF]=(0,i.useState)("auto"),[eK,eJ]=(0,i.useState)("auto"),[eL,eH]=(0,i.useState)(""),[eB,eW]=(0,i.useState)({enabled:!1,connections:{}}),[eG,eV]=(0,i.useState)([]),[eQ,eZ]=(0,i.useState)([]),[eX,eY]=(0,i.useState)(null),[e0,e1]=(0,i.useState)([]),[e2,e5]=(0,i.useState)([]),[e3,e4]=(0,i.useState)([]),[e6,e8]=(0,i.useState)(!1),[e7,e9]=(0,i.useState)(null),[te,tt]=(0,i.useState)(!1),[ts,ta]=(0,i.useState)(!1),[ti,tr]=(0,i.useState)(!1),[tl,tn]=(0,i.useState)(null),[to,td]=(0,i.useState)({}),[tc,tm]=(0,i.useState)(null),tp=(0,i.useRef)(!1),[tu,tx]=(0,i.useState)(!1),[th,tf]=(0,i.useState)(!1),{copied:tg,copy:ty}=(0,S.C)(),tb="ag_risk_confirmed",tv=()=>{U(!0)},tj=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tb)?tt(!0):"xiaomi-mimo"===f?K(!0):tS?tv():(Q(""),W(!0))},tw=()=>{Q(""),W(!0)},tk=()=>{tS?tj():tw()},tN=P?{id:P.id,name:P.name||("anthropic-compatible"===P.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===P.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===P.type?"AC":"OC",apiType:P.apiType,baseUrl:P.baseUrl,type:P.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tC=tN?.authModes||[],tS=!!m.zN[f]||!!m.IS[f]||tC.includes("oauth"),tA=!!m.fg[f]||tC.includes("apikey"),tT=!!m.IS[f]?.noAuth,t$=(0,p.KC)(f),tO=("cursor"===f||"zed"===f)&&eQ.length>0?eQ:t$,tI=(0,m.wG)(f),tP=(0,m.mq)(f),tE=(0,m.gb)(f),tR=tP||tE,tD=!tR&&tS&&tA,t_="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tz="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tq=e=>{if(!eU||"auto"===eU)return null;let t=C(f,e);return t&&t.includes(eU)?eU:null},tM=tR?f:tI,tU=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=C(f,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tO)s(e.id);for(let e of e0)s(e.id);for(let e of ey)e.providerAlias===tM&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tF=tR?P?.prefix||f:tI,tK=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{cache:"no-store"}),t=await e.json();e.ok&&e5(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tM]),tJ=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/enabled?providerAlias=${encodeURIComponent(tM)}`,{cache:"no-store"}),t=await e.json();e.ok&&e4(t.ids||[])}catch(e){console.log("Error fetching enabled models:",e)}},[tM]),tL=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:[e]})})).ok&&await tK()}catch(e){console.log("Error disabling model:",e)}},tH=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tK()}catch(e){console.log("Error enabling model:",e)}},tB=async e=>{e.length&&e9({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e9(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:e})})).ok&&await tK()}catch(e){console.log("Error disabling all models:",e)}}})},tW=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{method:"DELETE"})).ok&&await tK()}catch(e){console.log("Error enabling all models:",e)}},tG=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&eg(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tV=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eb(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e1(e.models)}).catch(()=>{})},[f]);let tQ=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(f)}`,{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),r=await t.json(),l=await s.json(),n=a.ok?await a.json():{};e.ok&&b(i.connections||[]),s.ok&&q(l.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};ez(o.fallbackStrategy||null),eM(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};eF(d.mode||"auto");let c=(n.retryDelayByProvider||{})[f];eJ(null!=c&&"auto"!==c?String(c):"auto");let m=(n.rpmByProvider||{})[f];eH(null!=m?String(m):"");let p=ec[f],u=p&&n[p]||{};if(eW({enabled:!0===u.enabled,connections:u.connections||{}}),t.ok){let e=(r.nodes||[]).find(e=>e.id===f)||null;if(!e&&tR)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===f)||null))break}E(e)}}catch(e){console.log("Error fetching connections:",e)}finally{$(!1)}},[f,tR]),tZ=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(E(s.node),await tQ(),eo(!1))}catch(e){console.log("Error updating provider node:",e)}},tX=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let r={...a};0===Object.keys(i).length?delete r[f]:r[f]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}},tY=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t0=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?s[f]=Number(e):delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:s})})}catch(e){console.log("Error saving retry delay:",e)}},t1=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).rpmByProvider||{}},a=String(e??"").trim();""===a?delete s[f]:s[f]=Math.max(0,Number(a)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:s})})}catch(e){console.log("Error saving RPM limit:",e)}},t2=async e=>{let t=ec[f];if(t){eW(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tQ(),tG(),tV(),tK(),tJ()},[tQ,tG,tV,tK,tJ]),(0,i.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eZ([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eZ([]),"zed"===f&&eY(null);return}let t=!1;return"zed"===f&&eY(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eZ(s.models),"zed"===f&&s?.warning&&eY(s.warning);return}"zed"===f&&(eZ([]),eY(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eZ([]),eY("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,i.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&O(e).then(eV)},[f]);let t5=async(e,t,s=tI)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tG();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t3=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tG()}catch(e){console.log("Error deleting alias:",e)}},t4=async(e,t="llm",s=tM,a,i)=>{try{let r=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...a?{caps:a}:{},...i?{transport:i}:{}})}),l=await r.json().catch(()=>({}));r.ok?(!1===l.added&&alert("Model already exists (duplicate). Check built-in or custom list."),await tV(),window.dispatchEvent(new CustomEvent("customModelChanged"))):alert(l.error||"Failed to add custom model")}catch(e){console.log("Error adding custom model:",e),alert(e.message||"Failed to add custom model")}},t6=async(e,t="llm",s=tM)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t8=async()=>{if(tu)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Qoder connection first"));tx(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");ey.some(e=>e.providerAlias===tM&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tM}/${s}`)||(await t4(s,"llm",tM),i+=1)}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tx(!1)}},t7=async()=>{if(th)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,T.Tl)("Please add an active Cline connection first"));tf(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,T.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,T.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;t&&(ey.some(e=>e.providerAlias===tM&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ef).includes(`${tM}/${t}`)||(await t4(t,"llm",tM),i+=1))}0===i?alert((0,T.Tl)("All models already exist, no new models added")):alert((0,T.Tl)("Successfully added")+` ${i} `+(0,T.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,T.Tl)("Error fetching models")+": "+e.message)}finally{tf(!1)}},t9=async()=>{if(ts||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));tp.current=!1,ta(!0),tr(!1),tn(null),td(e),tm({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(tp.current){tm({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=y[e];tn(a.id),td(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),r=!!i.valid;r?t+=1:s+=1,td(e=>({...e,[a.id]:{state:r?"success":"failed",error:r?null:i.error||null}}))}catch(e){s+=1,td(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tm({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tn(null),ta(!1),tr(!1),tp.current=!1}},se=async e=>{e9({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e9(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},st=()=>{tQ(),U(!1)},ss=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok)return await tQ(),!0;Q(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Q("Failed to save connection")}return!1},sa=async e=>{try{(await fetch(`/api/providers/${ex.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tQ(),el(!1))}catch(e){console.log("Error updating connection:",e)}},si=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sr=async(e,t)=>{let s=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to save fast mode");b(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,fastMode:t}}:s))},sl=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tQ()}},sn=y.filter(e=>eO.includes(e.id));(0,i.useEffect)(()=>{eI(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===sn.length)return;let e=new Set(sn.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=D.find(e=>e.id===t);return s?.name}})();let so=()=>{eR||eu(!1)},sd=async e=>{eD(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tQ(),eu(!1)}finally{eD(!1)}},sc=e=>sd(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:sm,items:sp,start:su}=function(e=[],t=1,s=10){let a=Array.isArray(e)?e:[],i=Number.isFinite(s)&&s>=1?Math.floor(s):10,r=a.length,l=Math.max(1,Math.ceil(r/i)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,l),d=(o-1)*i,c=a.slice(d,d+i);return{currentPage:o,totalPages:l,totalItems:r,start:d,items:c,pageSize:i}}(y,v,w),sx=new Set(sp.map(e=>e.id)),sh=sp.length>0&&sp.every(e=>eO.includes(e.id)),sf=(0,a.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[sp.map((e,t)=>{let s,i=su+t;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eO.includes(s)),onChange:()=>{var t;return t=e.id,void eI(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(J,{connection:e,proxyPools:D,isOAuth:tS,isFirst:0===i,isLast:i===y.length-1,onMoveUp:()=>sl(i,i-1),onMoveDown:()=>sl(i,i+1),onToggleActive:t=>si(e.id,t),fastMode:tN?.fastMode?{on:e.providerSpecificData?.fastMode===!0,onToggle:t=>sr(e.id,t)}:null,autoPing:ec[f]&&"oauth"===e.authType?{on:!0===eB.connections[e.id],onToggle:t=>{var s;return s=e.id,void t2({...eB,connections:{...eB.connections,[s]:t}})},provider:f}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{eh(e),el(!0)},onReconnect:()=>{"iflow"===f?H(!0):U(!0)},onDelete:()=>se(e.id),oneByOneStatus:to[e.id]||null})})]},e.id)}),y.length>10&&(0,a.jsx)(c.dK,{currentPage:sm,pageSize:w,totalItems:y.length,onPageChange:j,onPageSizeChange:e=>{k(e),j(1)},allowCustomPageSize:!0,maxPageSize:200})]}),sg=D.filter(e=>!0===e.isActive),sy=(0,a.jsx)(c.aF,{isOpen:ep,onClose:so,title:`Apply Proxy (${y.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=D.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):sd(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eR||0===sg.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sc(null),disabled:eR,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(e=>(0,a.jsxs)("button",{onClick:()=>sc(e.id),disabled:eR||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eR&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(c.$n,{onClick:so,variant:"ghost",fullWidth:!0,disabled:eR,children:"Cancel"})]})}),sb=async e=>{if(!eS.has(e)){eA(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tM}/${e}`})}),s=await t.json();ek(t=>({...t,[e]:s.ok?"ok":"error"})),eC(s.ok?"":s.error||"Model not reachable")}catch{ek(t=>({...t,[e]:"error"})),eC("Network error")}finally{eA(t=>{let s=new Set(t);return s.delete(e),s})}}};if(N)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]});if(!tN)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sv=()=>tP&&tN.apiType?"responses"===tN.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tE?"/providers/anthropic-m.png":(0,d.HY)(tN.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tN.color}15`},children:ev||!sv()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tN.color},children:tN.textIcon||tN.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:sv(),alt:tN.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tN.id),ej(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tN.name}),(tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website)&&(0,a.jsxs)("a",{href:tN.notice?.apiKeyUrl||tN.notice?.signupUrl||tN.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tN.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]}),(0,a.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,a.jsx)("input",{type:"number",min:"0",value:eL,placeholder:String(m.W[f]||0),onChange:e=>eH(e.target.value),onBlur:e=>t1(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,a.jsx)("select",{value:eK,onChange:e=>{var t;eJ(t=e.target.value),t0(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:em.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tN.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tN.deprecationNotice})]}),tN.notice?.text&&!tN.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tN.notice.text}),tN.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tN.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),tR&&P&&(0,a.jsx)(c.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tE?"Messages API":"responses"===P.apiType?"Responses API":"Chat Completions"," \xb7 ",(P.baseUrl||"").replace(/\/$/,""),"/",tE?"messages":"responses"===P.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),W(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>eo(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e9({title:"Delete Compatible Node",message:`Delete this ${tE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e9(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tT?(0,a.jsx)(c.gw,{providerId:f}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&D.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eu(!0),children:"Apply Proxy"}),y.length>0&&(0,a.jsxs)(a.Fragment,{children:[eO.length>0&&(0,a.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eO.length;0!==e&&e9({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e9(null);let e=0,t=[...eO];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),eI([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eO.length,")"]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:t9,disabled:ts,children:ts?"Testing Connection One-by-One...":"Test Connection One-by-One"}),ts&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{ts&&(tp.current=!0,tr(!0))},disabled:ti,children:ti?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(c.lM,{checked:"round-robin"===e_,onChange:e=>{let t=e?"round-robin":null,s=e?eq||"1":eq;e&&!eq&&eM("1"),ez(t),tX(t,s)}}),(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium ml-2",children:"Cache Affinity"}),(0,a.jsx)(c.lM,{checked:"cache-affinity"===e_,onChange:e=>{let t=e?"cache-affinity":null;ez(t),tX(t,eq)}}),"round-robin"===e_&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eq,onChange:e=>{var t;eM(t=e.target.value),tX("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]}),"codex"===f&&(0,a.jsx)(c.lM,{checked:codexFastMode,onChange:handleCodexFastModeChange,disabled:savingCodexFastMode,label:"Fast inference",description:"Use the priority tier for Codex models (all accounts). Per-account override lives on each connection row and quota card."}),"codex"===f&&codexFastModeError&&(0,a.jsx)("span",{className:"text-xs text-red-500",role:"alert",children:codexFastModeError})]})]}),0===y.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tS?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tD&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",t_," or ",tz,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,children:tz})]}):(0,a.jsxs)(a.Fragment,{children:[!tR&&"iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ea(!0),children:(0,T.Tl)("Bulk Add")}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,children:tR?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tc&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",tc.total]}),(0,a.jsxs)("span",{children:["Completed: ",tc.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tc.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tc.failed]}),tc.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),ts&&tl&&(0,a.jsxs)("span",{children:["Running: ",y.find(e=>e.id===tl)?.name||tl]})]})}),y.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:sh,onChange:()=>{sh?eI(e=>e.filter(e=>!sx.has(e))):eI(e=>{let t=new Set(e);for(let e of sx)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sf,!tR&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,T.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),"grok-cli"===f&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ea(!0),title:(0,T.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,T.Tl)("Bulk Add")}),tD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tj,className:"w-full sm:w-auto",children:t_}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tw,className:"w-full sm:w-auto",children:tz})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tk,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsx)(ed,{providerId:f}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tU&&(0,a.jsx)("select",{value:eU,onChange:e=>{var t;eF(t=e.target.value),tY(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tU.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tR&&(e=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e2.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[e2.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tW,children:"Active All"}),e.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tB(e),children:"Disable All"})]}))]}),!!eN&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:eN}),/RegionError|hosted in China|regionNotAllowed/i.test(eN)&&(s=(t="string"==typeof eN?eN:JSON.stringify(eN)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),l=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:l?`https://opencode.ai/workspace/${l[0]}/go`:"https://opencode.ai",(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,a.jsx)("span",{children:"Allow China-hosted models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eX&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eX}),(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>e8(!0),className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-main transition-colors hover:border-primary/40 hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"visibility"}),"Visible models",e3.length>0?` (${e3.length})`:""]}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:e3.length>0?`Only these ${e3.length} models are exposed on /v1/models`:"All models are exposed on /v1/models"})]}),(()=>{let e,t,s;if(tR)return(0,a.jsx)(_,{providerStorageAlias:tM,providerDisplayAlias:tF,modelAliases:ef,customModels:ey,copied:tg,onCopy:ty,onSetAlias:t5,onDeleteAlias:t3,onAddCustomModel:e=>t4(e,"llm",tM),onDeleteCustomModel:e=>t6(e,"llm",tM),connections:y,isAnthropic:tE});let i=[...tO,...e0.filter(e=>!tO.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),r=new Set(e2),l=i.filter(e=>!r.has(e.id)),n=i.filter(e=>r.has(e.id)),o=I({customModels:ey,modelAliases:ef,providerAlias:tM,builtInModels:tO,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,a.jsx)(R,{model:{id:e.id,name:e.name},fullModel:`${tF}/${e.id}`,alias:e.alias,copied:tg,onCopy:ty,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t6(e.id,"llm",tM):t3(e.alias)},testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tq(e.id)},`${e.source}-${e.fullModel}`)),l.map(e=>{let t=`${tM}/${e.id}`,s=`${f}/${e.id}`,i=Object.entries(ef).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(R,{model:e,fullModel:`${tF}/${e.id}`,alias:i,copied:tg,onCopy:ty,onSetAlias:t=>t5(e.id,t,tM),onDeleteAlias:()=>t3(i),testStatus:ew[e.id],onTest:y.length>0||tT?()=>sb(e.id):void 0,isTesting:eS.has(e.id),isFree:e.isFree,onDisable:()=>tL(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tq(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>e$(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===f||"qoder-cn"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t8,disabled:tu,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tu?{animation:"spin 1s linear infinite"}:void 0,children:tu?"progress_activity":"download"}),tu?(0,T.Tl)("Fetching..."):(0,T.Tl)("Fetch Qoder Models")]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t7,disabled:th,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:th?{animation:"spin 1s linear infinite"}:void 0,children:th?"progress_activity":"download"}),th?(0,T.Tl)("Fetching..."):(0,T.Tl)("Import from /models")]}),eG.length>0&&(e=new Set([...Object.values(ef),...o.map(e=>e.fullModel)]),t=new Set(tO.map(e=>e.id)),0===(s=eG.filter(s=>!e.has(`${tM}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t4(e.id,"llm",tM)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>tH(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),sy,"kiro"===f?(0,a.jsx)(c.Mh,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"cursor"===f?(0,a.jsx)(c.G9,{isOpen:M,onSuccess:st,onClose:()=>U(!1)}):"zed"===f?(0,a.jsx)(c.TE,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):"gitlab"===f?(0,a.jsx)(c.vj,{isOpen:M,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}):(0,a.jsx)(c.LF,{isOpen:M,provider:f,providerInfo:tN,onSuccess:st,onClose:()=>U(!1)}),(0,a.jsx)(c.LH,{isOpen:F,onSuccess:st,onClose:()=>K(!1)}),"iflow"===f&&(0,a.jsx)(c.vE,{isOpen:L,onSuccess:()=>{tQ(),H(!1)},onClose:()=>H(!1)}),(0,a.jsx)(G,{isOpen:B,provider:f,providerName:tN.name,isCompatible:tR,isAnthropic:tE,authType:tN?.authType,authHint:tN?.authHint,website:tN?.website,proxyPools:D,error:V,existingNames:y.map(e=>e.name).filter(Boolean),onSave:ss,onBulkDone:tQ,onClose:()=>{Q(""),W(!1)}}),(0,a.jsx)(c.wI,{isOpen:ei,connection:ex,proxyPools:D,onSave:sa,onClose:()=>el(!1)}),tR&&(0,a.jsx)(X,{isOpen:en,node:P,onSave:tZ,onClose:()=>eo(!1),isAnthropic:tE}),!tR&&(0,a.jsx)(ee,{isOpen:eT,providerAlias:tM,providerDisplayAlias:tF,onSave:async(e,t,s)=>{await t4(e,t?.stt?"stt":"llm",tM,t,s),e$(!1)},onClose:()=>e$(!1)}),e6&&(0,a.jsx)(z,{isOpen:!0,onClose:()=>e8(!1),providerId:f,providerAlias:tM,connections:y,customModels:ey,disabledModelIds:e2,onSaved:e=>{e4(e),tK()}}),"codex"===f&&(0,a.jsx)(es,{isOpen:Z,onClose:()=>Y(!1),onSuccess:tQ}),"grok-cli"===f&&(0,a.jsx)(er,{isOpen:et,onClose:()=>ea(!1),onSuccess:tQ}),(0,a.jsx)(c.uo,{isOpen:te,onClose:()=>tt(!1),onConfirm:()=>{(window.localStorage.setItem(tb,"true"),tt(!1),tS)?tv():tw()},title:"Risk Notice",message:tN?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(c.uo,{isOpen:!!e7,onClose:()=>e9(null),onConfirm:e7?.onConfirm,title:e7?.title||"Confirm",message:e7?.message,variant:"danger"})]})}},64827:(e,t,s)=>{"use strict";function a(e){if(!e)return null;let t=null,s=Date.now();for(let[a,i]of Object.entries(e)){if(!a.startsWith("modelLock_")||!i)continue;let e=new Date(i).getTime();e<=s||(!t||e<t)&&(t=e)}return t?new Date(t).toISOString():null}s.d(t,{kJ:()=>a}),s(10904)},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},85295:(e,t,s)=>{Promise.resolve().then(s.bind(s,59736))}},e=>{e.O(0,[763,5772,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
|