@jheavenknows/bluerouter 5.5.34 → 5.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +24 -24
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/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/personal/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/audit-proxy/me/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/audit-proxy/root-ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/audit-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/audit-proxy/users/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/view-mode/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-model-profiles/model-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +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-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- 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/qwen-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/codex-catalog/download/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/codex-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/codex-catalog/upload/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/api-key-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/move/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-emails/route.js +2 -2
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-emails/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-policy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-policy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/pending-accounts/route.js +2 -2
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/pending-accounts/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/shares/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/visibility/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-oauth-email/verify/route.js +2 -2
- package/app/.next-cli-build/server/app/api/personal-oauth-email/verify/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/combo-references/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/custom-embedding/manage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/openai-compatible/manage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/smtp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/rate-limits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cluster.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/logs.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/logs.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/logs.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/personal.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/personal.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/personal.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/personal.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/embedding.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/embedding.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/image.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/image.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/image.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/stt.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/stt.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/tts.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/tts.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/web.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/web.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_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 +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
- 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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_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 +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +24 -24
- package/app/.next-cli-build/server/chunks/2428.js +1 -1
- package/app/.next-cli-build/server/chunks/2867.js +1 -1
- package/app/.next-cli-build/server/chunks/3399.js +1 -1
- package/app/.next-cli-build/server/chunks/4003.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/4778.js +1 -1
- package/app/.next-cli-build/server/chunks/6236.js +1 -1
- package/app/.next-cli-build/server/chunks/6811.js +1 -1
- package/app/.next-cli-build/server/chunks/6992.js +1 -1
- package/app/.next-cli-build/server/chunks/7126.js +1 -1
- package/app/.next-cli-build/server/chunks/8946.js +2 -2
- package/app/.next-cli-build/server/chunks/9037.js +2 -2
- package/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{5263-ce3eee6759a72d58.js → 5263-703b00aba6c5bb1f.js} +1 -1
- package/app/.next-cli-build/static/chunks/912-18e8c0b298d404a0.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/page-5241ac88a293c965.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudcombo/page-899a8a75058f3959.js +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.5.28-to-5.5.29-5.5.29-20260924-103755 → upgrade-5.5.33-to-5.5.34-5.5.34-20260924-180218}/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/912-a978dfe116157ecf.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/page-34f2672c5f3185e1.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudcombo/page-49b624ecbe4f4e3f.js +0 -1
- /package/app/.next-cli-build/static/{6c055jLT98rCMNi9NWSBj → xOi7_D4lBYmsajJ_tW7MH}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{6c055jLT98rCMNi9NWSBj → xOi7_D4lBYmsajJ_tW7MH}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.5.29-to-5.5.30-5.5.30-20260924-104020 → upgrade-5.5.32-to-5.5.33-5.5.33-20260924-173620}/data.sqlite +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3674],{17:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(95155),n=s(98500),a=s.n(n),i=s(14051),l=s.n(i),d=s(31474);function c({tabs:e,activeId:t,onChange:s,className:n=""}){return(0,r.jsx)("div",{className:(0,d.cn)("mb-5 overflow-x-auto border-b border-border",n),children:(0,r.jsx)("div",{className:"flex min-w-max items-center gap-1",children:e.map(e=>{let n=e.id===t,i=(0,d.cn)("inline-flex items-center gap-2 border-b-2 px-4 py-3 text-sm font-semibold transition-colors",n?"border-primary text-primary":"border-transparent text-text-muted hover:border-border-strong hover:text-text-main"),l=(0,r.jsxs)(r.Fragment,{children:[e.icon?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon}):null,(0,r.jsx)("span",{children:e.label})]});return e.href?(0,r.jsx)(a(),{href:e.href,className:i,"aria-current":n?"page":void 0,children:l},e.id):(0,r.jsx)("button",{type:"button",onClick:()=>s?.(e.id),className:i,"aria-pressed":n,children:l},e.id)})})})}c.propTypes={tabs:l().arrayOf(l().shape({id:l().string.isRequired,label:l().string.isRequired,icon:l().string,href:l().string})).isRequired,activeId:l().string.isRequired,onChange:l().func,className:l().string}},12749:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>D});var r=s(95155),n=s(12115),a=s(25086),i=s(94027),l=s(17),d=s(17173),c=s(6945),o=s(35497),m=s(57250),x=s(31458);function h(e){return String(e||"").trim().toLowerCase()}function u(){let{isAdmin:e}=(0,i.s)(),[t,s]=(0,n.useState)([]),[a,l]=(0,n.useState)({}),[d,c]=(0,n.useState)({}),[u,p]=(0,n.useState)(""),[g,b]=(0,n.useState)({}),[f,j]=(0,n.useState)(""),[v,y]=(0,n.useState)({}),[N,w]=(0,n.useState)(3),[k,C]=(0,n.useState)("3"),[S,A]=(0,n.useState)(!0),[E,P]=(0,n.useState)(!1),[$,T]=(0,n.useState)(!1),[O,K]=(0,n.useState)(""),[U,G]=(0,n.useState)(""),[q,I]=(0,n.useState)(""),[L,z]=(0,n.useState)(""),[D,M]=(0,n.useState)(null),[H,_]=(0,n.useState)(!1),[B,R]=(0,n.useState)(!1),[F,Z]=(0,n.useState)(!1),J=(0,n.useCallback)(e=>{l(e.permissions||{}),c(e.connectionsByUser||{}),"number"==typeof e.globalConnectionsPerProviderLimit&&e.globalConnectionsPerProviderLimit>0&&(w(e.globalConnectionsPerProviderLimit),C(String(e.globalConnectionsPerProviderLimit))),e.connectionsPerProviderLimitOverrides&&"object"==typeof e.connectionsPerProviderLimitOverrides&&y(e.connectionsPerProviderLimitOverrides)},[]),V=(0,n.useCallback)(async()=>{if(e){A(!0),G("");try{let[e,t]=await Promise.all([fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"})]),r=await e.json().catch(()=>({})),n=await t.json().catch(()=>({}));if(!e.ok)throw Error(r.error||"Kh\xf4ng tải được personal OAuth providers");if(!t.ok)throw Error(n.error||"Kh\xf4ng tải được quyền OAuth");s(Array.isArray(r.providers)?r.providers:[]),J(n)}catch(e){G(e?.message||"Kh\xf4ng tải được cấu h\xecnh OAuth access")}finally{A(!1)}}},[J,e]);(0,n.useEffect)(()=>{V()},[V]);let X=(0,n.useRef)(0),Q=(0,n.useCallback)(async e=>{let t=e.trim();if(!t)return;let s=++X.current;_(!0);try{let e=await fetch(`/api/personal-cloud-providers/permissions?search=${encodeURIComponent(t)}`,{cache:"no-store"}),r=await e.json().catch(()=>({}));if(s!==X.current)return;if(!e.ok)throw Error(r.error||"Kh\xf4ng t\xecm được t\xe0i khoản");M(Array.isArray(r.accounts)?r.accounts:[]),R(!!r.accountsTruncated)}catch(e){if(s!==X.current)return;M([]),G(e?.message||"Kh\xf4ng t\xecm được t\xe0i khoản")}finally{s===X.current&&_(!1)}},[]);(0,n.useEffect)(()=>{if(!e)return;if(!L.trim()){M(null),R(!1),_(!1);return}let t=setTimeout(()=>Q(L),300);return()=>clearTimeout(t)},[L,e,Q]),(0,n.useEffect)(()=>{let e=h(u),s=a[e]||{},r={};for(let e of t)r[e.id]=!0===s[e.id];b(r);let n=v[e];j(n>0?String(n):"")},[u,a,t,v]);let W=(0,n.useMemo)(()=>Array.from(new Set([...Object.keys(a||{}),...Object.keys(d||{})])).map(e=>{let s=a[e]||{},r=d[e]||{},n=t.filter(e=>s?.[e.id]===!0),i=t.some(e=>Number(r[e.id]||0)>0);return{userId:e,providerState:s,connectionsByProvider:r,enabledProviders:n,hasAnyConnection:i}}).filter(e=>e.enabledProviders.length>0||e.hasAnyConnection).sort((e,t)=>e.userId.localeCompare(t.userId)),[d,a,t]),Y=null!==D,ee=(0,n.useMemo)(()=>Y?D.map(e=>{let s=e.providerState||{},r=e.connectionsByProvider||{},n=t.filter(e=>s?.[e.id]===!0),a=t.some(e=>Number(r[e.id]||0)>0);return{userId:e.userId,displayName:e.displayName,email:e.email,providerState:s,connectionsByProvider:r,enabledProviders:n,hasAnyConnection:a}}).sort((e,t)=>e.userId.localeCompare(t.userId)):W,[Y,D,W,t]),et=(0,n.useMemo)(()=>{let e=0,s=0,r=0,n=new Map(t.map(e=>[e.id,{grantedUsers:0,connections:0}]));for(let a of W){for(let s of t){let t=Number(a.connectionsByProvider?.[s.id]||0);e+=t;let r=n.get(s.id);a.providerState?.[s.id]===!0?(r.grantedUsers+=1,r.connections+=t):t>0&&(r.connections+=t)}a.enabledProviders.length>0&&!a.hasAnyConnection&&(s+=1),0===a.enabledProviders.length&&a.hasAnyConnection&&(r+=1)}return{totalUsers:W.length,totalConnections:e,grantedNoConnection:s,connectionNoGrant:r,perProvider:t.map(e=>({provider:e,...n.get(e.id)}))}},[W,t]),es=async()=>{let e,t=h(u);if(!t)return void G("Nhập username/email cần cấp quyền.");let s=String(f||"").trim();if(""===s)e=null;else{let t=Number.parseInt(s,10);if(!Number.isFinite(t)||t<=0)return void G("Per-user override phải l\xe0 số nguy\xean dương hoặc bỏ trống.");e=t}P(!0),G(""),I("");try{let s=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t,providers:g,connectionsPerProviderLimit:e})}),r=await s.json().catch(()=>({}));if(!s.ok)throw Error(r.error||"Kh\xf4ng lưu được quyền OAuth");J(r);let n=r.user?.id||t;p(n),I(`Đ\xe3 lưu quyền OAuth cho ${n}.`),Z(!1),L.trim()&&Q(L)}catch(e){G(e?.message||"Kh\xf4ng lưu được quyền OAuth")}finally{P(!1)}},er=async()=>{let e=Number.parseInt(k,10);if(!Number.isFinite(e)||e<=0)return void G("Global limit phải l\xe0 số nguy\xean dương.");T(!0),G(""),I("");try{let t=await fetch("/api/personal-cloud-providers/permissions",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({globalConnectionsPerProviderLimit:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng lưu được global limit");J(s),I(`Đ\xe3 đặt global limit = ${e} account / provider / user.`)}catch(e){G(e?.message||"Kh\xf4ng lưu được global limit")}finally{T(!1)}},en=async e=>{let t=h(e);if(t){P(!0),G(""),I("");try{let e=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(t)}`,{method:"DELETE"}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng thu hồi được quyền OAuth");J(s),h(u)===t&&p("");let r=s.disconnectSummary||{},n=Number(r.manualActionRequired)||0;I(`Đ\xe3 x\xf3a ${r.deletedCount||0} OAuth connection của ${t}; ${r.upstreamRevokedCount||0} token đ\xe3 revoke upstream.${n>0?` ${n} connection cần thu hồi thủ c\xf4ng tại provider.`:""}`),K(""),L.trim()&&Q(L)}catch(e){G(e?.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{P(!1)}}};if(!e)return null;let ea=W.find(e=>e.userId===h(O)),ei=t.reduce((e,t)=>e+Number(ea?.connectionsByProvider?.[t.id]||0),0);return(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Quản l\xfd provider n\xe0o user được ph\xe9p d\xf9ng, giới hạn số account OAuth c\xe1 nh\xe2n v\xe0 thu hồi to\xe0n bộ quyền/token khi cần. C\xe1c thao t\xe1c trong tab n\xe0y chỉ d\xe0nh cho admin."})]}),(0,r.jsx)(x.default,{}),U?(0,r.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:U}):null,q?(0,r.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:q}):null,(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Access policy"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Tắt provider giữ nguy\xean connection/token để c\xf3 thể bật lại; Revoke all sẽ thử revoke upstream rồi x\xf3a connection/token local."})]}),(0,r.jsx)(o.$n,{variant:"outline",size:"sm",onClick:V,loading:S,icon:"refresh",children:"Refresh"})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"Global limit — số account OAuth c\xe1 nh\xe2n / provider / user thường"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"\xc1p dụng cho user kh\xf4ng c\xf3 per-user override. Admin kh\xf4ng bị chặn bởi limit n\xe0y."}),(0,r.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,r.jsx)(o.pd,{type:"number",min:1,value:k,onChange:e=>C(e.target.value),className:"sm:w-48"}),(0,r.jsx)(o.$n,{onClick:er,loading:$,disabled:$||Number.parseInt(k,10)===N,children:"Lưu global"}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["Đang lưu: ",N]})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"T\xecm một t\xe0i khoản (username/email) để xem v\xe0 chỉnh quyền — kể cả t\xe0i khoản chưa được cấp quyền g\xec. Kh\xf4ng t\xecm kiếm th\xec hiển thị c\xe1c t\xe0i khoản đang c\xf3 quyền hoặc c\xf2n OAuth connection."})]}),S?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-4 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng user"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:et.totalUsers})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng OAuth connection"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:et.totalConnections})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Cấp quyền, chưa connect"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:et.grantedNoConnection})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"C\xf2n connection, đ\xe3 thu hồi quyền"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:et.connectionNoGrant})]})]}),et.perProvider.some(e=>e.grantedUsers>0||e.connections>0)?(0,r.jsxs)("div",{className:"mb-4 rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Breakdown theo provider"}),(0,r.jsx)("div",{className:"mt-3 space-y-2",children:et.perProvider.map(({provider:e,grantedUsers:t,connections:s})=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(m.A,{src:`/providers/${e.id}.png`,alt:e.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:e.id.slice(0,2).toUpperCase(),fallbackColor:e.color||"#64748b"}),(0,r.jsx)("span",{className:"text-text-main",children:e.name})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,r.jsxs)("span",{children:[t," user được cấp quyền"]}),(0,r.jsxs)("span",{children:[s," connection"]})]})]},e.id))})]}):null,(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(o.pd,{label:"T\xecm t\xe0i khoản",value:L,onChange:e=>z(e.target.value),placeholder:"Nhập username hoặc email, vd: anh-tct hoặc anh-tct@fujinet.net",hint:H?"Đang t\xecm…":void 0})}),Y&&H&&0===ee.length?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang t\xecm t\xe0i khoản..."}):Y&&0===ee.length?(0,r.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng t\xecm thấy t\xe0i khoản n\xe0o khớp với "',L.trim(),'".']}):Y||0!==W.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,r.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),t.map(e=>(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:e.name},e.id)),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Limit / provider"}),(0,r.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ee.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsxs)("td",{className:"px-4 py-4",children:[(0,r.jsx)("div",{className:"break-all font-mono text-text-main",children:e.userId}),e.displayName||e.email?(0,r.jsx)("div",{className:"mt-0.5 text-xs text-text-muted",children:[e.displayName,e.email].filter(Boolean).join(" \xb7 ")}):null]}),t.map(t=>{let s=!0===e.providerState[t.id],n=Number(e.connectionsByProvider?.[t.id]||0);return(0,r.jsx)("td",{className:"px-4 py-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(o.Ex,{variant:s?"success":"default",size:"sm",children:s?"ON":"OFF"}),n>0?(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${n} ${t.name} account`,children:[(0,r.jsx)(m.A,{src:`/providers/${t.id}.png`,alt:t.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:t.id.slice(0,2).toUpperCase(),fallbackColor:t.color||"#64748b"}),n>1?(0,r.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",n]}):null]}):null]})},t.id)}),(0,r.jsx)("td",{className:"px-4 py-4 text-xs",children:v[e.userId]>0?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Override"}),(0,r.jsx)("span",{className:"font-mono",children:v[e.userId]})]}):(0,r.jsxs)("span",{className:"text-text-muted",children:["Global \xb7 ",N]})}),(0,r.jsx)("td",{className:"px-4 py-4",children:(0,r.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,r.jsx)(o.$n,{variant:"outline",size:"sm",onClick:()=>(e=>{let s=h(e);p(s);let r=a[s]||{},n={};for(let e of t)n[e.id]=!0===r[e.id];b(n),G(""),I(""),Z(!0)})(e.userId),children:"Edit"}),e.enabledProviders.length>0||e.hasAnyConnection?(0,r.jsx)(o.$n,{variant:"danger",size:"sm",loading:E&&O===e.userId,onClick:()=>K(e.userId),children:"Revoke all & delete"}):null]})})]},e.userId))})]})}),Y&&B?(0,r.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Chỉ hiển thị ",ee.length," kết quả đầu, thu hẹp từ kh\xf3a t\xecm kiếm để ch\xednh x\xe1c hơn."]}):null]}):(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider. D\xf9ng \xf4 t\xecm kiếm ở tr\xean để cấp quyền cho một t\xe0i khoản."})]})]})]}),O?(0,r.jsx)(o.aF,{isOpen:!0,onClose:()=>K(""),title:"Thu hồi to\xe0n bộ quyền OAuth",size:"lg",busy:E,closeOnOverlay:!E,footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.$n,{variant:"ghost",onClick:()=>K(""),disabled:E,children:"Hủy"}),(0,r.jsx)(o.$n,{variant:"danger",icon:"delete_forever",loading:E,onClick:()=>en(O),children:"Thu hồi v\xe0 x\xf3a to\xe0n bộ"})]}),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:"H\xe0nh động nguy hiểm, kh\xf4ng thể ho\xe0n t\xe1c"}),(0,r.jsx)("div",{className:"mt-1 break-all text-lg font-semibold text-text-main",children:O}),(0,r.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"To\xe0n bộ quyền OAuth provider v\xe0 connection/token local của user n\xe0y sẽ bị x\xf3a; gateway sẽ thử revoke upstream trước."})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-surface p-3 text-sm",children:[(0,r.jsx)("span",{className:"text-text-muted",children:"Connection t\xecm thấy"}),(0,r.jsx)(o.Ex,{variant:ei>0?"warning":"default",size:"sm",children:ei})]}),ea?(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(e=>{let t=Number(ea.connectionsByProvider?.[e.id]||0);return t>0?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2.5 py-1 text-xs text-text-muted",children:[(0,r.jsx)(m.A,{src:`/providers/${e.id}.png`,alt:e.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:e.id.slice(0,2).toUpperCase()}),e.name," \xd7",t]},e.id):null})}):null]})}):null,F?(0,r.jsx)(o.aF,{isOpen:!0,onClose:()=>Z(!1),title:"Chỉnh quyền OAuth provider",size:"lg",busy:E,closeOnOverlay:!E,footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.$n,{variant:"ghost",onClick:()=>Z(!1),disabled:E,children:"Hủy"}),(0,r.jsx)(o.$n,{onClick:es,loading:E,icon:"save",children:"Save permissions"})]}),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(o.pd,{label:"User ID / Email",value:u,disabled:!0}),(0,r.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:t.map(e=>(0,r.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,r.jsx)(o.lM,{checked:!0===g[e.id],onChange:t=>b(s=>({...s,[e.id]:t})),label:e.name,description:g[e.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},e.id))}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"Per-user override — account / provider"}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Ghi đ\xe8 global cho ",(0,r.jsx)("span",{className:"font-mono",children:h(u)||"user đang chọn"}),". Để trống để d\xf9ng global (",N,")."]}),(0,r.jsx)("div",{className:"mt-3 max-w-xs",children:(0,r.jsx)(o.pd,{type:"number",min:1,value:f,onChange:e=>j(e.target.value),placeholder:`Để trống = d\xf9ng global (${N})`})})]})]})}):null]})}let p="/api/settings/smtp",g=[{value:"starttls",label:"STARTTLS (587)"},{value:"ssl",label:"SSL/TLS (465)"},{value:"none",label:"Kh\xf4ng m\xe3 ho\xe1 (25)"}],b={starttls:"587",ssl:"465",none:"25"};function f(e={}){return{host:e.host||"",port:e.port?String(e.port):"587",security:e.security||"starttls",username:e.username||"",password:"",fromEmail:e.fromEmail||"",fromName:e.fromName||"BlueRouter",allowInvalidCert:!0===e.allowInvalidCert,publicBaseUrl:e.publicBaseUrl||""}}function j(e){return{...e,port:Number.parseInt(e.port,10)||void 0}}function v({defaultTestRecipient:e=""}){let[t,s]=(0,n.useState)(null),[a,i]=(0,n.useState)(f()),[l,d]=(0,n.useState)(e),[c,m]=(0,n.useState)(!0),[x,h]=(0,n.useState)(!1),[u,y]=(0,n.useState)(!1),[N,w]=(0,n.useState)(""),[k,C]=(0,n.useState)(""),S=(0,n.useCallback)(e=>{s(e||null),i(f(e||{}))},[]),A=(0,n.useCallback)(async()=>{m(!0),w("");try{let e=await fetch(p,{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được SMTP settings");S(t.smtp)}catch(e){w(e?.message||"Kh\xf4ng tải được SMTP settings")}finally{m(!1)}},[S]);(0,n.useEffect)(()=>{A()},[A]),(0,n.useEffect)(()=>{!l&&e&&d(e)},[e,l]);let E=e=>t=>i(s=>({...s,[e]:t.target.value})),P=async()=>{h(!0),w(""),C("");try{let e=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(j(a))}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng lưu được SMTP settings");S(t.smtp),C("Đ\xe3 lưu SMTP settings.")}catch(e){w(e?.message||"Kh\xf4ng lưu được SMTP settings")}finally{h(!1)}},$=async()=>{h(!0),w(""),C("");try{let e=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...j(a),password:"",clearPassword:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng xo\xe1 được password");S(t.smtp),C("Đ\xe3 xo\xe1 SMTP password.")}catch(e){w(e?.message||"Kh\xf4ng xo\xe1 được password")}finally{h(!1)}},T=async()=>{y(!0),w(""),C("");try{let e=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:l.trim(),settings:j(a)})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Gửi mail test thất bại");C(`Đ\xe3 gửi mail test tới ${l.trim()}.${t.response?` Server: ${t.response}`:""}`)}catch(e){w(e?.message||"Gửi mail test thất bại")}finally{y(!1)}};return(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"SMTP settings"}),t?(0,r.jsx)(o.Ex,{variant:t.configured?"success":"warning",size:"sm",children:t.configured?"Đ\xe3 cấu h\xecnh":"Chưa cấu h\xecnh"}):null]}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng để gửi email x\xe1c thực khi user add account ngo\xe0i domain được ph\xe9p. Password được m\xe3 ho\xe1 khi lưu."})]}),(0,r.jsx)(o.$n,{variant:"outline",size:"sm",onClick:A,loading:c,icon:"refresh",children:"Refresh"})]}),N?(0,r.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:N}):null,k?(0,r.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:k}):null,c?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải SMTP settings..."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]",children:[(0,r.jsx)(o.pd,{label:"SMTP host",value:a.host,onChange:E("host"),placeholder:"vd: smtp.fujinet.net"}),(0,r.jsx)(o.l6,{label:"Bảo mật",value:a.security,onChange:e=>{let t=e.target.value;i(e=>({...e,security:t,port:Object.values(b).includes(e.port)?b[t]:e.port}))},options:g}),(0,r.jsx)(o.pd,{label:"Port",type:"number",min:1,max:65535,value:a.port,onChange:E("port")})]}),(0,r.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,r.jsx)(o.pd,{label:"Username",value:a.username,onChange:E("username"),placeholder:"Để trống nếu SMTP kh\xf4ng cần auth",autoComplete:"off"}),(0,r.jsx)(o.pd,{label:"Password",type:"password",value:a.password,onChange:E("password"),placeholder:t?.hasPassword?"•••••••• (đ\xe3 lưu — để trống để giữ nguy\xean)":"Nhập password",autoComplete:"new-password",hint:t?.hasPassword?"Đ\xe3 c\xf3 password được lưu.":void 0})]}),(0,r.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,r.jsx)(o.pd,{label:"From email",value:a.fromEmail,onChange:E("fromEmail"),placeholder:"vd: bluerouter@fujinet.net"}),(0,r.jsx)(o.pd,{label:"From name",value:a.fromName,onChange:E("fromName"),placeholder:"BlueRouter"}),(0,r.jsx)(o.pd,{label:"Public URL (hostname trong link)",value:a.publicBaseUrl,onChange:E("publicBaseUrl"),placeholder:"vd: https://router.fujinet.net",hint:a.publicBaseUrl.trim()?void 0:"Để trống = lấy BASE_URL / host của request."})]}),(0,r.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,r.jsx)(o.lM,{checked:a.allowInvalidCert,onChange:e=>i(t=>({...t,allowInvalidCert:e})),label:"Bỏ qua kiểm tra chứng chỉ TLS",description:"Chỉ bật khi SMTP nội bộ d\xf9ng chứng chỉ self-signed."})}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(o.$n,{onClick:P,loading:x,disabled:x||u,icon:"save",children:"Lưu SMTP"}),t?.hasPassword?(0,r.jsx)(o.$n,{variant:"ghost",onClick:$,disabled:x||u,icon:"key_off",children:"Xo\xe1 password"}):null]}),(0,r.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Gửi mail test"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Test với th\xf4ng tin đang nhập ở tr\xean (chưa cần lưu)."}),(0,r.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,r.jsx)(o.pd,{value:l,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"===e.key&&l.trim()&&T()},placeholder:"Email nhận test",className:"sm:w-96"}),(0,r.jsx)(o.$n,{variant:"outline",onClick:T,loading:u,disabled:u||x||!l.trim()||!a.host.trim(),icon:"send",children:"Gửi test"})]})]})]})]})}let y="/api/personal-cloud-providers/account-policy",N={domain:"Domain",email:"Allowlist","not-enforced":"Kh\xf4ng \xe1p dụng",disabled:"Policy tắt","missing-email":"Thiếu email","github-account":"GitHub allowlist","missing-identity":"Thiếu GitHub id","not-listed":"Chưa được ph\xe9p"};function w(e){return String(e||"").split(/[\s,;]+/).map(e=>e.trim().toLowerCase()).filter(Boolean)}function k(e){return`${e.email}|${e.ownerUser||""}`}function C(e){return`${e.githubUserId}|${e.ownerUser||""}`}function S(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString("vi-VN")}function A(){let{isAdmin:e}=(0,i.s)(),[t,s]=(0,n.useState)(null),[a,l]=(0,n.useState)([]),[d,c]=(0,n.useState)([]),[x,h]=(0,n.useState)(0),[u,p]=(0,n.useState)(!0),[g,b]=(0,n.useState)(!1),[f,j]=(0,n.useState)(""),[A,E]=(0,n.useState)(""),[P,$]=(0,n.useState)(""),[T,O]=(0,n.useState)(""),[K,U]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[I,L]=(0,n.useState)(""),[z,D]=(0,n.useState)(""),[M,H]=(0,n.useState)(""),[_,B]=(0,n.useState)(""),[R,F]=(0,n.useState)(!1),Z=(0,n.useCallback)(e=>{s(e.policy||null),l(Array.isArray(e.providers)?e.providers:[]),c(Array.isArray(e.connections)?e.connections:[]),h(Number(e.pendingImportCount)||0)},[]),J=(0,n.useCallback)(async()=>{if(e){p(!0),j("");try{let e=await fetch(y,{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được account policy");Z(t)}catch(e){j(e?.message||"Kh\xf4ng tải được account policy")}finally{p(!1)}}},[Z,e]);(0,n.useEffect)(()=>{J()},[J]);let V=async(e,t,s)=>{b(!0),j(""),E("");try{let r=await fetch(y,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json().catch(()=>({}));if(!r.ok)throw Error(n.error||"Kh\xf4ng lưu được account policy");return Z(n),E("function"==typeof s?s(n):s),!0}catch(e){return j(e?.message||"Kh\xf4ng lưu được account policy"),!1}finally{b(!1)}},X=(e,s)=>V("PUT",{enabled:t.enabled,allowedDomains:t.allowedDomains,allowedEmails:t.allowedEmails,allowedGithubAccounts:t.allowedGithubAccounts||[],enforcedProviders:Object.fromEntries(a.map(e=>[e.id,e.enforced])),...e},s),Q=async()=>{let e=w(P).map(e=>e.replace(/^@+/,"")),s=e.filter(e=>!t.allowedDomains.includes(e));0===s.length?j(e.length?"Domain đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập domain cần th\xeam, vd: fujinet.net"):await X({allowedDomains:[...t.allowedDomains,...s]},`Đ\xe3 th\xeam domain: ${s.join(", ")}.`)&&$("")},W=async()=>{let e=w(T),s=G.trim().toLowerCase(),r=new Set(t.allowedEmails.map(k)),n=Array.from(new Set(e)).filter(e=>!r.has(k({email:e,ownerUser:s})));if(0===n.length)return void j(e.length?"Email đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập email cần cho ph\xe9p.");let a=K.trim();await X({allowedEmails:[...t.allowedEmails,...n.map(e=>({email:e,note:a,ownerUser:s}))]},`Đ\xe3 cho ph\xe9p ${n.length} email${s?` cho user ${s}`:" cho mọi user"}.`)&&(O(""),U(""),q(""))},Y=async()=>{let e=Array.from(new Set(w(I).map(e=>e.replace(/^@+/,""))));if(0===e.length)return void j("Nhập GitHub login hoặc id cần cho ph\xe9p.");let s=z.trim().toLowerCase(),r=M.trim();await X({allowedGithubAccounts:[...t.allowedGithubAccounts||[],...e.map(e=>({login:e,ownerUser:s,note:r}))]},`Đ\xe3 cho ph\xe9p ${e.length} GitHub account${s?` cho user ${s}`:" cho mọi user"}.`)&&(L(""),D(""),H(""))},ee=(0,n.useMemo)(()=>{let e=_.trim().toLowerCase(),s=t?.allowedEmails||[];return e?s.filter(t=>[t.email,t.note,t.addedBy,t.ownerUser].some(t=>String(t||"").toLowerCase().includes(e))):s},[_,t]),et=(0,n.useMemo)(()=>d.filter(e=>!e.allowed),[d]),es=R?d:et,er=(0,n.useMemo)(()=>new Map(a.map(e=>[e.id,e])),[a]);if(!e)return null;let en=(e,t=16)=>{let s=er.get(e)||{id:e,name:e};return(0,r.jsx)(m.A,{src:`/providers/${s.id}.png`,alt:s.name,size:t,className:t>16?"max-h-[20px] max-w-[20px] rounded object-contain":"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:String(s.id).slice(0,2).toUpperCase(),fallbackColor:s.color||"#64748b"})};return(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: Account allowlist"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Giới hạn account upstream n\xe0o được add v\xe0o Personal OAuth. Account c\xf3 email thuộc domain được ph\xe9p lu\xf4n được add (khi user đ\xe3 được cấp quyền provider); account kh\xe1c phải c\xf3 trong danh s\xe1ch email do admin thiết lập."})]}),f?(0,r.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:f}):null,A?(0,r.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:A}):null,u||!t?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải account policy..."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Account policy"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"\xc1p dụng khi user add account mới hoặc reauth. Connection đang chạy kh\xf4ng bị ngắt khi đổi policy."})]}),(0,r.jsx)(o.$n,{variant:"outline",size:"sm",onClick:J,loading:u,icon:"refresh",children:"Refresh"})]}),(0,r.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,r.jsx)(o.lM,{checked:t.enabled,disabled:g,onChange:e=>X({enabled:e},e?"Đ\xe3 bật account policy.":"Đ\xe3 tắt account policy — mọi account đều được add."),label:"Bật kiểm tra account email",description:t.enabled?"Chỉ domain / email được ph\xe9p mới add được":"Đang tắt: mọi account đều được add"})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Domain được ph\xe9p"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:t.allowedDomains.length})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Email / GitHub ngoại lệ"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:t.allowedEmails.length+(t.allowedGithubAccounts||[]).length})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Connection hiện c\xf3"}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:d.length})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Sẽ bị chặn khi reauth"}),(0,r.jsx)("div",{className:`mt-1 text-2xl font-bold ${et.length>0?"text-red-600 dark:text-red-400":"text-text-main"}`,children:et.length})]})]})]}),(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Domain được ph\xe9p"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Account c\xf3 email thuộc c\xe1c domain n\xe0y lu\xf4n được add. Chỉ khớp ch\xednh x\xe1c domain (kh\xf4ng gồm subdomain)."})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:0===t.allowedDomains.length?(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"Chưa c\xf3 domain n\xe0o — mọi account đều phải nằm trong danh s\xe1ch email."}):t.allowedDomains.map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-3 py-1 text-sm text-text-main",children:[(0,r.jsxs)("span",{className:"font-mono",children:["@",e]}),(0,r.jsx)("button",{type:"button",className:"material-symbols-outlined text-[16px] text-text-muted hover:text-red-500 disabled:opacity-50",onClick:()=>X({allowedDomains:t.allowedDomains.filter(t=>t!==e)},`Đ\xe3 x\xf3a domain ${e}.`),disabled:g,"aria-label":`X\xf3a domain ${e}`,title:"X\xf3a domain",children:"close"})]},e))}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,r.jsx)(o.pd,{label:"Th\xeam domain",value:P,onChange:e=>$(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q()},placeholder:"vd: fujinet.net, partner.com",className:"sm:w-96"}),(0,r.jsx)(o.$n,{onClick:Q,loading:g,disabled:g||!P.trim(),icon:"add",children:"Th\xeam"})]})]}),(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Provider \xe1p dụng"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Provider tắt ở đ\xe2y sẽ kh\xf4ng kiểm tra. Kiro lấy email qua API usage của Kiro. GitHub kh\xf4ng trả email n\xean được kiểm tra theo danh s\xe1ch GitHub account b\xean dưới, mặc định tắt."})]}),(0,r.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border border-border bg-surface p-4",children:[(0,r.jsx)("div",{className:"pt-0.5",children:en(e.id,20)}),(0,r.jsx)(o.lM,{checked:e.enforced,disabled:g||!t.enabled,onChange:t=>{let s;return s=e.id,X({enforcedProviders:Object.fromEntries(a.map(e=>[e.id,e.id===s?t:e.enforced]))},`${t?"Đ\xe3 \xe1p dụng":"Đ\xe3 bỏ \xe1p dụng"} policy cho ${a.find(e=>e.id===s)?.name||s}.`)},label:e.name,description:e.enforced?"Kiểm tra domain / email":"Kh\xf4ng kiểm tra"})]},e.id))})]}),(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email được ph\xe9p (ngoại lệ)"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Account ngo\xe0i domain được ph\xe9p phải c\xf3 trong danh s\xe1ch n\xe0y. Email gắn với một user chỉ user đ\xf3 được add; để trống User để cho mọi user. User cũng c\xf3 thể tự th\xeam email của m\xecnh bằng c\xe1ch x\xe1c thực qua mail."})]}),(0,r.jsxs)(o.$n,{variant:"outline",size:"sm",icon:"download",onClick:()=>V("POST",{action:"import-existing"},e=>e.importedCount>0?`Đ\xe3 import ${e.importedCount} email từ connection hiện c\xf3.`:"Kh\xf4ng c\xf3 email mới cần import."),loading:g,disabled:g,children:["Import từ connection hiện c\xf3",x>0?` (${x})`:""]})]}),(0,r.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_auto] md:items-end",children:[(0,r.jsx)(o.pd,{label:"Email",value:T,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W()},placeholder:"vd: someone@gmail.com, other@partner.com"}),(0,r.jsx)(o.pd,{label:"Chỉ cho user (tuỳ chọn)",value:G,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W()},placeholder:"vd: anh-tct — trống = mọi user"}),(0,r.jsx)(o.pd,{label:"Ghi ch\xfa",value:K,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W()},placeholder:"vd: account c\xe1 nh\xe2n của anh-tct"}),(0,r.jsx)(o.$n,{onClick:W,loading:g,disabled:g||!T.trim(),icon:"person_add",children:"Cho ph\xe9p"})]}),t.allowedEmails.length>0?(0,r.jsx)(o.pd,{value:_,onChange:e=>B(e.target.value),placeholder:"Lọc theo email, ghi ch\xfa, người th\xeam..."}):null,0===t.allowedEmails.length?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 email ngoại lệ n\xe0o."}):0===ee.length?(0,r.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng c\xf3 email n\xe0o khớp với "',_.trim(),'".']}):(0,r.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,r.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Ghi ch\xfa"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Th\xeam bởi"}),(0,r.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ee.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsxs)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:[e.email,e.verifiedAt?(0,r.jsx)(o.Ex,{variant:"success",size:"sm",className:"ml-2",children:"Verified"}):null]}),(0,r.jsx)("td",{className:"px-4 py-3 text-xs",children:e.ownerUser?(0,r.jsx)("span",{className:"font-mono text-text-main",children:e.ownerUser}):(0,r.jsx)(o.Ex,{variant:"info",size:"sm",children:"Mọi user"})}),(0,r.jsx)("td",{className:"px-4 py-3 text-xs text-text-muted",children:e.note||"—"}),(0,r.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,r.jsx)("div",{children:e.addedBy||"—"}),e.addedAt?(0,r.jsx)("div",{className:"mt-0.5",children:S(e.addedAt)}):null]}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(o.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>X({allowedEmails:t.allowedEmails.filter(t=>k(t)!==k(e))},`Đ\xe3 x\xf3a ${e.email}${e.ownerUser?` (${e.ownerUser})`:""} khỏi danh s\xe1ch.`),disabled:g,children:"X\xf3a"})})})]},k(e)))})]})})]}),(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"GitHub account được ph\xe9p"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"GitHub Copilot kh\xf4ng cho đọc email n\xean account GitHub được so theo id (kh\xf4ng đổi kể cả khi user đổi t\xean). Chỉ c\xf3 hiệu lực khi GitHub được bật ở mục Provider \xe1p dụng. Nhập login hoặc id, c\xe1ch nhau bởi dấu phẩy."})]}),(0,r.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_auto] md:items-end",children:[(0,r.jsx)(o.pd,{label:"GitHub login / id",value:I,onChange:e=>L(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Y()},placeholder:"vd: octocat, 34310938"}),(0,r.jsx)(o.pd,{label:"Chỉ cho user (tuỳ chọn)",value:z,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Y()},placeholder:"trống = mọi user"}),(0,r.jsx)(o.pd,{label:"Ghi ch\xfa",value:M,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Y()},placeholder:"tuỳ chọn"}),(0,r.jsx)(o.$n,{onClick:Y,loading:g,disabled:g||!I.trim(),icon:"person_add",children:"Cho ph\xe9p"})]}),0===(t.allowedGithubAccounts||[]).length?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 GitHub account n\xe0o."}):(0,r.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,r.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"GitHub account"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Ghi ch\xfa"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Th\xeam bởi"}),(0,r.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border bg-background",children:t.allowedGithubAccounts.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsxs)("td",{className:"px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[en("github"),(0,r.jsx)("span",{className:"font-mono text-text-main",children:e.login||"—"})]}),(0,r.jsxs)("div",{className:"mt-0.5 font-mono text-xs text-text-muted",children:["id ",e.githubUserId]})]}),(0,r.jsx)("td",{className:"px-4 py-3 text-xs",children:e.ownerUser?(0,r.jsx)("span",{className:"font-mono text-text-main",children:e.ownerUser}):(0,r.jsx)(o.Ex,{variant:"info",size:"sm",children:"Mọi user"})}),(0,r.jsx)("td",{className:"px-4 py-3 text-xs text-text-muted",children:e.note||"—"}),(0,r.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,r.jsx)("div",{children:e.addedBy||"—"}),e.addedAt?(0,r.jsx)("div",{className:"mt-0.5",children:S(e.addedAt)}):null]}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(o.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>X({allowedGithubAccounts:(t.allowedGithubAccounts||[]).filter(t=>C(t)!==C(e))},`Đ\xe3 x\xf3a GitHub account ${e.login||e.githubUserId} khỏi danh s\xe1ch.`),disabled:g,children:"X\xf3a"})})})]},C(e)))})]})})]}),(0,r.jsx)(v,{}),(0,r.jsxs)(o.Zp,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Kiểm tra connection hiện c\xf3"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Kết quả nếu c\xe1c personal connection hiện c\xf3 được add / reauth lại với policy hiện tại."})]}),(0,r.jsx)(o.lM,{size:"sm",checked:R,onChange:F,label:"Hiện tất cả"})]}),0===es.length?(0,r.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:R?"Chưa c\xf3 personal connection n\xe0o.":"Kh\xf4ng c\xf3 connection n\xe0o bị chặn bởi policy hiện tại."}):(0,r.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,r.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Kết quả"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border bg-background",children:es.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:e.ownerUser||"—"}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[en(e.provider),(0,r.jsx)("span",{className:"text-text-main",children:er.get(e.provider)?.name||e.provider}),e.isActive?null:(0,r.jsx)(o.Ex,{size:"sm",children:"Inactive"})]})}),(0,r.jsx)("td",{className:"px-4 py-3 break-all font-mono text-xs text-text-muted",children:e.email||(e.githubLogin?`github: ${e.githubLogin}`:"—")}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)(o.Ex,{variant:e.allowed?"success":"error",size:"sm",children:N[e.reason]||e.reason})})]},e.id))})]})})]})]})]})}var E=s(43503),P=s(78867),$=s(67673),T=s(14796),O=s.n(T),K=s(36236);let U="/api/personal-cloud-providers/account-emails",G="/api/personal-cloud-providers/pending-accounts",q={ok:e=>({type:"success",text:`Đ\xe3 x\xe1c thực ${e||"email"}. Quay lại m\xe0n h\xecnh add account v\xe0 bấm "T\xf4i đ\xe3 x\xe1c thực" (hoặc bấm ở mục "Account đang chờ x\xe1c thực" b\xean dưới) để ho\xe0n tất.`}),expired:e=>({type:"error",text:`Link x\xe1c thực${e?` cho ${e}`:""} đ\xe3 hết hạn. Gửi lại email x\xe1c thực b\xean dưới.`}),invalid:()=>({type:"error",text:"Link x\xe1c thực kh\xf4ng hợp lệ hoặc đ\xe3 được d\xf9ng."}),error:()=>({type:"error",text:"Kh\xf4ng x\xe1c thực được email, vui l\xf2ng thử lại."})};function I(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString("vi-VN")}function L(){let[e,t]=(0,n.useState)(null),[s,a]=(0,n.useState)([]),[i,l]=(0,n.useState)(""),[d,c]=(0,n.useState)(!0),[m,x]=(0,n.useState)(!1),[h,u]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),b=(0,n.useCallback)(async()=>{try{let e=await fetch(G,{cache:"no-store"}),t=await e.json().catch(()=>({}));e.ok&&a(Array.isArray(t.pending)?t.pending:[])}catch{}},[]),f=(0,n.useCallback)(async()=>{c(!0);try{let e=await fetch(U,{cache:"no-store"}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng tải được danh s\xe1ch email");t(s),b()}catch(e){u(e?.message||"Kh\xf4ng tải được danh s\xe1ch email")}finally{c(!1)}},[b]);(0,n.useEffect)(()=>{f()},[f]);let j=async e=>{u("");try{let t=await fetch(`${G}?id=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng huỷ được");a(Array.isArray(s.pending)?s.pending:[])}catch(e){u(e?.message||"Kh\xf4ng huỷ được")}},v=e=>{g(`Đ\xe3 add account ${e?.email||""} v\xe0o Personal OAuth.`),setTimeout(()=>window.location.reload(),800)};(0,n.useEffect)(()=>{let e=new URL(window.location.href),t=e.searchParams.get("emailVerify");if(!t)return;let s=(q[t]||q.error)(e.searchParams.get("email")||"");"success"===s.type?g(s.text):u(s.text),e.searchParams.delete("emailVerify"),e.searchParams.delete("email"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`)},[]);let y=async(e,{query:s="",body:r}={},n)=>{x(!0),u(""),g("");try{let a=await fetch(`${U}${s}`,{method:e,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0}),i=await a.json().catch(()=>({}));if(!a.ok)throw Error(i.error||"Thao t\xe1c thất bại");return t(i),g(n),!0}catch(e){return u(e?.message||"Thao t\xe1c thất bại"),!1}finally{x(!1)}},N=async e=>{let t=String(e||"").trim().toLowerCase();!t||await y("POST",{body:{email:t}},`Đ\xe3 gửi email x\xe1c thực tới ${t}. Mở hộp thư v\xe0 bấm link để ho\xe0n tất.`)&&t===i.trim().toLowerCase()&&l("")},w=e=>y("DELETE",{query:`?email=${encodeURIComponent(e)}`},`Đ\xe3 xo\xe1 ${e}.`);if(d&&!e||!e||!e.policyEnabled)return null;let k=e.allowedDomains||[],C=e.verified||[],S=e.pending||[];return(0,r.jsxs)(o.Zp,{className:"mb-5 space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email account ngo\xe0i domain"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:[k.length>0?(0,r.jsxs)(r.Fragment,{children:["Account c\xf3 email ",(0,r.jsx)("span",{className:"font-mono",children:k.map(e=>`@${e}`).join(", ")})," được add trực tiếp. "]}):null,"Account d\xf9ng email kh\xe1c (vd: Gmail) cần x\xe1c thực qua mail trước khi add v\xe0o Personal OAuth. Email đ\xe3 x\xe1c thực chỉ \xe1p dụng cho t\xe0i khoản của bạn."]})]}),h?(0,r.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:h}):null,p?(0,r.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:p}):null,s.length>0?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Account đang chờ x\xe1c thực email"}),s.map(e=>(0,r.jsxs)("div",{className:"rounded-2xl border border-yellow-500/30 bg-yellow-500/5 p-4",children:[(0,r.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,r.jsx)(o.Ex,{variant:"warning",size:"sm",children:e.provider}),(0,r.jsx)("span",{className:"break-all font-mono text-text-main",children:e.email}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["giữ đến ",I(e.expiresAt)]})]}),(0,r.jsx)(K.A,{compact:!0,pendingAccount:e,message:`Mở mail gửi tới ${e.email}, bấm link x\xe1c thực, rồi bấm "T\xf4i đ\xe3 x\xe1c thực" để ho\xe0n tất add account.`,onVerified:v,onClose:()=>j(e.id)})]},e.id))]}):null,e.smtpConfigured?(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,r.jsx)(o.pd,{label:"Email account cần add",value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&N(i)},placeholder:"vd: yourname@gmail.com",className:"sm:w-96"}),(0,r.jsx)(o.$n,{onClick:()=>N(i),loading:m,disabled:m||!i.trim(),icon:"mark_email_unread",children:"Gửi email x\xe1c thực"})]}):(0,r.jsx)("div",{className:"rounded-xl border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-800 dark:text-yellow-300",children:"Hệ thống chưa cấu h\xecnh gửi mail. Li\xean hệ admin để được th\xeam email v\xe0o danh s\xe1ch cho ph\xe9p."}),C.length>0||S.length>0?(0,r.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,r.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,r.jsx)("th",{className:"px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,r.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border bg-background",children:[C.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:e.email}),(0,r.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,r.jsx)(o.Ex,{variant:"success",size:"sm",children:"Đ\xe3 cho ph\xe9p"}),(0,r.jsx)("span",{className:"ml-2",children:I(e.verifiedAt||e.addedAt)})]}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(o.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>w(e.email),disabled:m,children:"Xo\xe1"})})})]},`verified:${e.email}`)),S.filter(e=>!C.some(t=>t.email===e.email)).map(t=>(0,r.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,r.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:t.email}),(0,r.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,r.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Chờ x\xe1c thực"}),(0,r.jsxs)("span",{className:"ml-2",children:["hết hạn ",I(t.expiresAt)]})]}),(0,r.jsx)("td",{className:"px-4 py-3",children:(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[e.smtpConfigured?(0,r.jsx)(o.$n,{variant:"outline",size:"sm",icon:"send",onClick:()=>N(t.email),disabled:m,children:"Gửi lại"}):null,(0,r.jsx)(o.$n,{variant:"ghost",size:"sm",icon:"close",onClick:()=>w(t.email),disabled:m,children:"Huỷ"})]})})]},`pending:${t.email}`))]})]})}):null]})}function z(){let e=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let s=null,r=()=>{let e=Array.from(t.querySelectorAll("h2")).find(e=>e.textContent?.trim()==="Admin: OAuth provider access"),r=e?.closest(".bg-surface.border.border-border");r&&r!==s&&(s&&s.style.removeProperty("display"),(s=r).style.setProperty("display","none"))};r();let n=new MutationObserver(r);return n.observe(t,{childList:!0,subtree:!0}),()=>{n.disconnect(),s&&s.style.removeProperty("display")}},[]),(0,r.jsxs)("div",{ref:e,className:O().page,children:[(0,r.jsx)(L,{}),(0,r.jsx)(E.default,{}),(0,r.jsx)($.default,{}),(0,r.jsx)(P.default,{})]})}function D(){let{isAdmin:e}=(0,i.s)(),[t,s]=(0,n.useState)("oauth"),o=(0,n.useMemo)(()=>[{id:"oauth",label:"Personal OAuth",icon:"cloud_sync"},...e?[{id:"monitor",label:"OAuth Monitor",icon:"manage_accounts"}]:[],{id:"quota",label:"Personal Quota",icon:"data_usage"},...e?[{id:"admin-access",label:"Admin: OAuth Access",icon:"admin_panel_settings"}]:[],...e?[{id:"admin-accounts",label:"Admin: Account Allowlist",icon:"verified_user"}]:[]],[e]),m=o.some(e=>e.id===t)?t:"oauth";return(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)(l.A,{tabs:o,activeId:m,onChange:s}),"oauth"===m?(0,r.jsx)(z,{}):null,"monitor"===m&&e?(0,r.jsx)(d.default,{}):null,"quota"===m?(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(a.CardSkeleton,{}),children:(0,r.jsx)(c.default,{})}):null,"admin-access"===m&&e?(0,r.jsx)(u,{}):null,"admin-accounts"===m&&e?(0,r.jsx)(A,{}):null]})}},31458:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var r=s(95155),n=s(12115),a=s(35497),i=s(57250),l=s(94027);function d(){let{isAdmin:e}=(0,l.s)(),[t,s]=(0,n.useState)([]),[d,c]=(0,n.useState)(!1),[o,m]=(0,n.useState)(""),[x,h]=(0,n.useState)(""),[u,p]=(0,n.useState)(""),g=(0,n.useCallback)(async()=>{if(e){c(!0),h("");try{let e=await fetch("/api/personal-cloud-providers/visibility",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được trạng th\xe1i Show/Hide provider");s(Array.isArray(t.providers)?t.providers:[])}catch(e){h(e?.message||"Kh\xf4ng tải được trạng th\xe1i Show/Hide provider")}finally{c(!1)}}},[e]);if((0,n.useEffect)(()=>{g()},[g]),!e)return null;let b=async(e,t)=>{m(e.id),h(""),p("");try{let r=await fetch("/api/personal-cloud-providers/visibility",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:e.id,visible:t})}),n=await r.json().catch(()=>({}));if(!r.ok)throw Error(n.error||"Kh\xf4ng cập nhật được visibility provider");s(Array.isArray(n.providers)?n.providers:[]),p(`${e.name}: ${t?"đ\xe3 Show cho user":"đ\xe3 Hide khỏi user"}.`)}catch(e){h(e?.message||"Kh\xf4ng cập nhật được visibility provider")}finally{m("")}};return(0,r.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold text-text-main",children:"Admin: Show / Hide Personal Cloud Providers"}),(0,r.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:"Chỉ điều khiển provider c\xf3 xuất hiện tr\xean giao diện của user hay kh\xf4ng. Kh\xf4ng đổi quyền OAuth, kh\xf4ng deactivate connection, kh\xf4ng x\xf3a token, kh\xf4ng đổi API key/routing v\xe0 kh\xf4ng ảnh hưởng sử dụng thực tế."})]}),(0,r.jsx)(a.$n,{size:"sm",variant:"outline",onClick:g,loading:d,icon:"refresh",children:"Refresh"})]}),x?(0,r.jsx)("div",{className:"mt-3 rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-700 dark:text-red-300",children:x}):null,u?(0,r.jsx)("div",{className:"mt-3 rounded-xl border border-green-500/30 bg-green-500/10 px-3 py-2 text-xs text-green-700 dark:text-green-300",children:u}):null,(0,r.jsx)("div",{className:"mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:t.map(e=>{let t=!1!==e.visible,s=o===e.id;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border bg-background p-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)(i.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"max-h-[30px] max-w-[30px] rounded object-contain",fallbackText:e.id.slice(0,2).toUpperCase(),fallbackColor:e.color||"#64748b"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,r.jsx)(a.Ex,{variant:t?"success":"default",size:"sm",children:t?"Shown":"Hidden"})]})]}),(0,r.jsx)(a.$n,{size:"sm",variant:t?"outline":"secondary",disabled:s,loading:s,icon:t?"visibility_off":"visibility",onClick:()=>b(e,!t),children:t?"Hide":"Show"})]},e.id)})})]})}},96928:(e,t,s)=>{Promise.resolve().then(s.bind(s,12749))}},e=>{e.O(0,[6373,3862,8500,9893,9959,7050,2218,5263,7033,5497,7413,912,6945,7173,8441,3794,7358],()=>e(e.s=96928)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[823],{10332:(e,t,r)=>{Promise.resolve().then(r.bind(r,49711))},14051:(e,t,r)=>{e.exports=r(34701)()},31474:(e,t,r)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}r.d(t,{cn:()=>s})},34701:(e,t,r)=>{"use strict";var s=r(82114);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,o,n){if(n!==s){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return r.PropTypes=r,r}},46442:(e,t,r)=>{"use strict";r.d(t,{j:()=>n,t:()=>l});var s=r(95155),a=r(12115);let o=(0,a.createContext)(null);function n({resolver:e,children:t}){return(0,s.jsx)(o.Provider,{value:"function"==typeof e?e:null,children:t})}function l(){return(0,a.useContext)(o)}},49711:(e,t,r)=>{"use strict";r.d(t,{default:()=>b});var s=r(95155),a=r(12115),o=r(84588),n=r(57250),l=r(81127),d=r(92542);let i=[{id:"fallback",label:"Fallback (priority order)",icon:"swap_vert"},{id:"round-robin",label:"Round Robin",icon:"sync"}],c={fallback:"Fallback (priority order)","round-robin":"Round Robin",sticky:"Sticky","least-latency":"Least latency",p2c:"Power of two choices"};function m(e){return c[e]||e||"fallback"}function x(e){return String(e||"").trim().toLowerCase()}function u(){return{id:null,name:"",strategy:"fallback",models:[]}}function b(){let[e,t]=(0,a.useState)([]),[r,c]=(0,a.useState)([]),[b,p]=(0,a.useState)(!0),[h,g]=(0,a.useState)(""),[f,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(""),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(u()),[S,A]=(0,a.useState)(""),[_,P]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[I,M]=(0,a.useState)(""),[O,F]=(0,a.useState)(""),[R,$]=(0,a.useState)("all"),[L,U]=(0,a.useState)(null),[z,q]=(0,a.useState)([]),[B,D]=(0,a.useState)(!1),[K,W]=(0,a.useState)(""),[H,J]=(0,a.useState)(!1),[G,V]=(0,a.useState)(""),[X,Y]=(0,a.useState)(""),Q=(0,a.useCallback)(async()=>{p(!0),g("");try{let[e,r]=await Promise.all([fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/personal-cloud-combos?scope=all",{cache:"no-store"})]),s=await e.json().catch(()=>({})),a=await r.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Failed to load personal connections");if(!r.ok)throw Error(a.error||"Failed to load cloud combos");t(Array.isArray(s.connections)?s.connections:[]),c(Array.isArray(a.combos)?a.combos:[]),A(a.userId||""),P("all"===a.scope)}catch(e){g(e.message||"Failed to load cloud combos")}finally{p(!1)}},[]);(0,a.useEffect)(()=>{Q()},[Q]);let Z=async e=>{U(e),W(""),V(""),Y(""),D(!0);try{let e=await fetch("/api/keys?pageSize=100&status=active",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to load API keys");q(Array.isArray(t.keys)?t.keys:[])}catch(e){V(e.message||"Failed to load API keys"),q([])}finally{D(!1)}};function ee(){U(null),W(""),V(""),Y("")}async function et(){if(L&&K){J(!0),V("");try{let e=await fetch(`/api/personal-cloud-combos/${encodeURIComponent(L.id)}/api-key-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyId:K})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to add combo to API key");Y(`Đ\xe3 th\xeam "${L.name}" v\xe0o API key ${t.key?.name||""}.`)}catch(e){V(e.message||"Failed to add combo to API key")}finally{J(!1)}}}let er=(0,a.useMemo)(()=>{let t=new Set,r=[];for(let s of e)if(!1!==s.isActive){for(let e of Array.isArray(s?.importedModels)&&s.importedModels.length>0?s.importedModels:Array.isArray(s?.availableModels)?s.availableModels:[])!e?.routeModel||t.has(e.routeModel)||(t.add(e.routeModel),r.push({provider:s.provider,connectionLabel:s.name||s.email||s.provider,model:e}))}return r},[e]),es=x(S),ea=(0,a.useCallback)(e=>!_||!!es&&x(e?.ownerUser)===es,[_,es]),eo=(0,a.useMemo)(()=>{let e=new Set;for(let t of r){let r=String(t.ownerUser||"").trim();r&&e.add(r)}return[...e].sort((e,t)=>e.localeCompare(t))},[r]),en=(0,a.useMemo)(()=>[...new Set(r.map(e=>e.strategy||"fallback"))].sort((e,t)=>m(e).localeCompare(m(t))),[r]),el=!!E.trim()||!!I||!!O||"all"!==R,ed=(0,a.useMemo)(()=>{if(!_)return r;let e=E.trim().toLowerCase();return r.filter(t=>(!I||x(t.ownerUser)===x(I))&&(!O||(t.strategy||"fallback")===O)&&("active"!==R||!1!==t.isActive)&&("inactive"!==R||!1===t.isActive)&&(!e||[t.ownerUser,t.name,t.id,...t.models||[]].join(" ").toLowerCase().includes(e)))},[r,_,E,I,O,R]);function ei(){w(null),C(u()),j("")}function ec(e,t){C(r=>{let s=[...r.models],a=e+t;return a<0||a>=s.length?r:([s[e],s[a]]=[s[a],s[e]],{...r,models:s})})}async function em(){j("");let e=k.name.trim();if(!e)return void j("Name is required");if(0===k.models.length)return void j("Select at least one model");y(!0);try{let t="new"===N,r=t?"/api/personal-cloud-combos":`/api/personal-cloud-combos/${encodeURIComponent(k.id)}`,s=await fetch(r,{method:t?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,strategy:k.strategy,models:k.models})}),a=await s.json().catch(()=>({}));if(!s.ok){let e=Array.isArray(a.invalidModels)&&a.invalidModels.length>0?`: ${a.invalidModels.join(", ")}`:"";throw Error((a.error||"Failed to save combo")+e)}await Q(),ei()}catch(e){j(e.message||"Failed to save combo")}finally{y(!1)}}async function ex(e){if(window.confirm(`Delete cloud combo "${e.name}"? This cannot be undone.`))try{let t=await fetch(`/api/personal-cloud-combos/${encodeURIComponent(e.id)}`,{method:"DELETE"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||"Failed to delete combo");await Q()}catch(e){g(e.message||"Failed to delete combo")}}return b?(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm text-text-muted",children:"Loading cloud combos…"}):(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("section",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-text-main",children:"Cloud Combos"}),(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-xs leading-5 text-text-muted",children:"Tạo combo (fallback / round-robin) gồm c\xe1c model từ ch\xednh c\xe1c t\xe0i khoản OAuth c\xe1 nh\xe2n của bạn (Claude, Codex/OpenAI, Grok, Kiro...). Kh\xf4ng c\xf3 sampling override."}),_&&(0,s.jsxs)("p",{className:"mt-1.5 inline-flex items-center gap-1.5 rounded-lg border border-primary/30 bg-primary/5 px-2 py-1 text-[11px] text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"admin_panel_settings"}),"Chế độ admin: đang xem ",r.length," combo của to\xe0n hệ thống (",eo.length," người d\xf9ng). Combo của người kh\xe1c chỉ xem, kh\xf4ng sửa được."]})]}),null===N&&(0,s.jsxs)("button",{type:"button",onClick:function(){C(u()),j(""),w("new")},className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-3 py-1.5 text-xs font-medium text-text-main transition hover:border-primary/30 hover:bg-surface",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"New combo"]})]}),h&&(0,s.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-3 text-xs text-red-600",children:h}),_&&r.length>0&&(0,s.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1fr)_auto_auto_auto]",children:[(0,s.jsx)("input",{type:"text",value:E,onChange:e=>T(e.target.value),placeholder:"T\xecm theo owner, t\xean combo, model id...",className:"h-9 w-full rounded-lg border border-border bg-background px-3 text-xs text-text-main outline-none focus:border-primary"}),(0,s.jsxs)("select",{value:I,onChange:e=>M(e.target.value),className:"h-9 rounded-lg border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Tất cả owner"}),eo.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsxs)("select",{value:O,onChange:e=>F(e.target.value),className:"h-9 rounded-lg border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Tất cả strategy"}),en.map(e=>(0,s.jsx)("option",{value:e,children:m(e)},e))]}),(0,s.jsxs)("select",{value:R,onChange:e=>$(e.target.value),className:"h-9 rounded-lg border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,s.jsx)("option",{value:"active",children:"Đang hoạt động"}),(0,s.jsx)("option",{value:"inactive",children:"Cần xử l\xfd"})]})]}),_&&el&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsxs)("span",{children:["Hiện ",ed.length,"/",r.length," combo"]}),(0,s.jsx)("button",{type:"button",onClick:function(){T(""),M(""),F(""),$("all")},className:"text-primary hover:underline",children:"Xo\xe1 bộ lọc"})]})]}),null!==N&&(0,s.jsxs)(o.default,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Name"}),(0,s.jsx)("input",{type:"text",value:k.name,onChange:e=>C(t=>({...t,name:e.target.value})),placeholder:"my-claude-fallback",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Strategy"}),(0,s.jsx)("div",{className:"flex gap-2",children:i.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>C(t=>({...t,strategy:e.id})),className:`inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition ${k.strategy===e.id?"border-primary/40 bg-primary/10 text-primary":"border-border bg-background text-text-main hover:border-primary/30"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:e.icon}),e.label]},e.id))})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-text-muted",children:"Models in this combo (order = fallback priority)"}),0===k.models.length?(0,s.jsx)("div",{className:"rounded-lg border border-dashed border-border p-3 text-xs text-text-muted",children:"Chưa chọn model n\xe0o."}):(0,s.jsx)("div",{className:"space-y-1.5",children:k.models.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs font-mono text-text-main",children:e}),(0,s.jsx)("button",{type:"button",onClick:()=>ec(t,-1),disabled:0===t,className:"text-text-muted hover:text-text-main disabled:opacity-30",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})}),(0,s.jsx)("button",{type:"button",onClick:()=>ec(t,1),disabled:t===k.models.length-1,className:"text-text-muted hover:text-text-main disabled:opacity-30",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_downward"})}),(0,s.jsx)("button",{type:"button",onClick:()=>{C(t=>({...t,models:t.models.filter(t=>t!==e)}))},className:"text-red-500 hover:text-red-600",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-text-muted",children:"Model của bạn (chỉ hiện model từ OAuth connection đang active của bạn)"}),0===er.length?(0,s.jsx)("div",{className:"rounded-lg border border-dashed border-border p-3 text-xs text-text-muted",children:"Bạn chưa c\xf3 personal OAuth connection n\xe0o đang active. Kết nối t\xe0i khoản ở tab Personal OAuth trước."}):(0,s.jsx)("div",{className:"grid max-h-64 gap-1.5 overflow-y-auto rounded-lg border border-border p-2 sm:grid-cols-2",children:er.map(({provider:e,connectionLabel:t,model:r})=>{let a=k.models.includes(r.routeModel),o="review"===r.quotaFamily,l=o?r.name.replace(/ Review$/,""):r.name;return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-xs hover:bg-surface-2/50",children:[(0,s.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{var e;return e=r.routeModel,void C(t=>{let r=t.models.includes(e);return{...t,models:r?t.models.filter(t=>t!==e):[...t.models,e]}})},className:"shrink-0"}),(0,s.jsx)(n.A,{src:`/providers/${e}.png`,alt:e,size:18,className:"shrink-0 rounded object-contain",fallbackText:String(e||"?").slice(0,2).toUpperCase()}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[(0,s.jsxs)("span",{className:"block truncate",children:[(0,s.jsx)("span",{className:"font-medium text-text-main",children:l}),o&&(0,s.jsx)("span",{className:"ml-1 rounded bg-amber-500/10 px-1 py-0.5 text-[10px] font-medium text-amber-600",children:"Review quota"}),(0,s.jsxs)("span",{className:"ml-1 text-text-muted",children:["\xb7 ",t]})]}),(0,s.jsx)("span",{className:"block truncate font-mono text-[10px] text-text-muted/70",children:r.routeModel})]})]},`${t}:${r.routeModel}`)})})]}),v&&(0,s.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-2.5 text-xs text-red-600",children:v}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:ei,className:"rounded-lg border border-border bg-background px-3 py-1.5 text-xs font-medium text-text-main hover:bg-surface",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:em,disabled:f,className:"rounded-lg border border-primary/40 bg-primary/10 px-3 py-1.5 text-xs font-medium text-primary hover:bg-primary/20 disabled:opacity-50",children:f?"Saving…":"new"===N?"Create combo":"Save changes"})]})]}),(0,s.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[0===r.length&&null===N?(0,s.jsx)("div",{className:"col-span-full rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:_?"Chưa c\xf3 ai tạo cloud combo n\xe0o.":"Bạn chưa c\xf3 cloud combo n\xe0o."}):null,r.length>0&&0===ed.length?(0,s.jsx)("div",{className:"col-span-full rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Kh\xf4ng c\xf3 combo n\xe0o khớp bộ lọc."}):null,ed.map(e=>(0,s.jsxs)(o.default,{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"truncate text-sm font-semibold text-text-main",children:e.name}),!1===e.isActive&&(0,s.jsx)("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2 py-0.5 text-[10px] font-semibold text-amber-600",children:"No models left — needs attention"})]}),(0,s.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:[m(e.strategy)," \xb7 ",e.models?.length||0," model(s)"]}),_&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"person"}),(0,s.jsx)("span",{className:"truncate",children:e.ownerUser||"—"})]})]}),ea(e)?(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>Z(e),className:"inline-flex items-center gap-1 rounded-lg border border-primary/30 bg-primary/5 px-2 py-1.5 text-[11px] font-medium text-primary hover:bg-primary/10",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_key"}),"Add this combo to API key"]}),(0,s.jsx)("button",{type:"button",onClick:()=>{C({id:e.id,name:e.name,strategy:e.strategy||"fallback",models:[...e.models||[]]}),j(""),w(e.id)},className:"rounded-lg border border-border bg-background p-1.5 text-text-muted hover:text-text-main",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,s.jsx)("button",{type:"button",onClick:()=>ex(e),className:"rounded-lg border border-border bg-background p-1.5 text-red-500 hover:bg-red-500/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]}):(0,s.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-border bg-background px-2 py-0.5 text-[10px] font-medium text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"lock"}),"Chỉ xem"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-background px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"model id để gọi API"}),(0,s.jsx)("code",{className:"min-w-0 flex-1 truncate text-xs text-text-main",children:e.id}),(0,s.jsx)("button",{type:"button",onClick:()=>(function(e){try{navigator.clipboard?.writeText(e)}catch{}})(e.id),className:"text-text-muted hover:text-text-main",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(e.models||[]).map(e=>(0,s.jsx)("span",{className:"rounded-full border border-border bg-background px-2 py-0.5 text-[11px] font-mono text-text-muted",children:e},e))})]},e.id))]}),(0,s.jsx)(l.default,{isOpen:!!L,onClose:ee,title:`Add "${L?.name||""}" to API key`,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.default,{variant:"ghost",onClick:ee,disabled:H,children:"Cancel"}),(0,s.jsx)(d.default,{onClick:et,loading:H,disabled:!K,children:"Add to key"})]}),children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Th\xeam model id ",(0,s.jsx)("code",{className:"font-mono text-text-main",children:L?.id})," v\xe0o ",(0,s.jsx)("code",{children:"allowedModels"})," của API key đ\xe3 chọn (chỉ hiện API key của ch\xednh bạn)."]}),(0,s.jsx)("p",{className:"rounded-lg border border-primary/20 bg-primary/5 p-2.5 text-xs text-text-muted",children:"Chỉ cần cấp quyền combo: API key d\xf9ng được combo n\xe0y m\xe0 kh\xf4ng cần cấp quyền ri\xeang cho từng model b\xean trong."}),(0,s.jsxs)("label",{className:"block text-sm",children:[(0,s.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"API key"}),(0,s.jsxs)("select",{value:K,onChange:e=>W(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-primary",disabled:B,children:[(0,s.jsx)("option",{value:"",children:B?"Đang tải API keys...":"Chọn API key"}),z.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))]})]}),B||0!==z.length?null:(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700",children:"Bạn chưa c\xf3 API key active n\xe0o. Tạo API key ở /dashboard/api-keys trước."}),G&&(0,s.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-2.5 text-xs text-red-600",children:G}),X&&(0,s.jsx)("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-2.5 text-xs text-green-600",children:X})]})})]})}},57250:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(95155),a=r(12115),o=r(14051),n=r.n(o);function l({src:e,alt:t,size:r=32,className:o="",fallbackText:n="?",fallbackColor:d}){let[i,c]=(0,a.useState)(!1);return!e||i?(0,s.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${o}`.trim(),style:{width:r,height:r,color:d,fontSize:Math.max(10,Math.floor(.38*r))},children:n}):(0,s.jsx)("img",{src:e,alt:t,width:r,height:r,className:o,onError:()=>c(!0)})}l.propTypes={src:n().string,alt:n().string,size:n().number,className:n().string,fallbackText:n().string,fallbackColor:n().string}},81127:(e,t,r)=>{"use strict";r.d(t,{ConfirmModal:()=>b,default:()=>u});var s=r(95155),a=r(12115),o=r(31474),n=r(92542),l=r(97677),d=r(46442);let i=[],c="";function m(){1===i.length?(c=document.body.style.overflow,document.body.style.overflow="hidden"):0===i.length&&(document.body.style.overflow=c)}function x(e,t){return!!e&&Object.prototype.hasOwnProperty.call(e,t)}function u({isOpen:e,onClose:t,title:r,children:n,footer:c,size:b="md",closeOnOverlay:p=!0,showTrafficLights:h=!0,busy:g=!1,className:f}){let y=(0,a.useRef)({onClose:t,busy:g}),v=(0,d.t)(),j=v?.({title:r,children:n,footer:c,size:b,className:f})||null,N=x(j,"children")?j.children:n,w=x(j,"footer")?j.footer:c,k=j?.size||b,C=(0,o.cn)(f,j?.className);y.current.onClose=t,y.current.busy=g;let S={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"};return((0,a.useEffect)(()=>{if(!e)return;let t=y.current;i.push(t),m();let r=e=>{if("Escape"!==e.key)return;let r=i[i.length-1];r!==t||r.busy||(e.preventDefault(),r.onClose())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r);let e=i.indexOf(t);-1!==e&&i.splice(e,1),m()}},[e]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:p&&!g?t:void 0}),(0,s.jsxs)("div",{className:(0,o.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",S[k]||S.md,C),children:[(r||h)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[h&&(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,s.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,s.jsx)("button",{onClick:t,disabled:g,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot disabled:cursor-not-allowed disabled:opacity-50",children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),r&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:r})]}),(0,s.jsx)("button",{onClick:t,disabled:g,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:N}),w&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:w})]})]}):null}function b({isOpen:e,onClose:t,onConfirm:r,title:a="Confirm",message:o,confirmText:l="Confirm",cancelText:d="Cancel",variant:i="danger",loading:c=!1}){return(0,s.jsx)(u,{isOpen:e,onClose:t,title:a,size:"sm",busy:c,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{variant:"ghost",onClick:t,disabled:c,children:d}),(0,s.jsx)(n.default,{variant:i,onClick:r,loading:c,children:l})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:o})})}},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},84588:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var s=r(95155),a=r(31474);function o({children:e,title:t,subtitle:r,icon:n,action:l,padding:d="md",hover:i=!1,elev:c=!1,className:m,...x}){return(0,s.jsxs)("div",{className:(0,a.cn)("bg-surface border border-border",c?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[0_1px_2px_rgba(15,23,42,0.045),0_12px_28px_-26px_rgba(37,99,235,0.38)]",i&&"hover:shadow-[var(--shadow-warm)] hover:border-brand-500/40 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-5",lg:"p-6"}[d],m),...x,children:[(t||l)&&(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[n&&(0,s.jsx)("div",{className:"p-2 rounded-[10px] bg-bg-alt border border-border-subtle text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:n})}),(0,s.jsxs)("div",{children:[t&&(0,s.jsx)("h3",{className:"text-text-main font-semibold",children:t}),r&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:r})]})]}),l]}),e]})}o.Section=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-4 rounded-[10px]","bg-bg-alt border border-border",t),...r,children:e})},o.Row=function({children:e,className:t,...r}){return(0,s.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50",t),...r,children:e})},o.ListItem=function({children:e,actions:t,className:r,...o}){return(0,s.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-border-subtle last:border-b-0","hover:bg-surface-2/50 transition-colors",r),...o,children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,s.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},92542:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var s=r(95155),a=r(31474);let o={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},n={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function l({children:e,variant:t="primary",size:r="md",icon:d,iconRight:i,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...b}){return(0,s.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",o[t],n[r],x&&"w-full",u),disabled:c||m,...b,children:[m?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):d?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d}):null,e,i&&!m&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i})]})}},97677:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(95155);function a({text:e,children:t,position:r="top",color:o}){let n=o?"":"bg-gray-900";return(0,s.jsxs)("div",{className:"relative inline-flex group",children:[t,(0,s.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[r]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${n} text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,style:o?{backgroundColor:o}:{},children:e})]})}}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=10332)),_N_E=e.O()}]);
|
|
File without changes
|
/package/app/.next-cli-build/static/{6c055jLT98rCMNi9NWSBj → xOi7_D4lBYmsajJ_tW7MH}/_ssgManifest.js
RENAMED
|
File without changes
|