@jheavenknows/bluerouter 5.1.37 → 5.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- 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.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/basic-chat/page.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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.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.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.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.js +2 -2
- 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.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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.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.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.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.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +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 +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/[asset]/route.js +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 +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 +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-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +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 +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/analytics/route.js +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 +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 +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 +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 +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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]/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/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/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/pricing/recalculate/route.js +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +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.js +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 +7 -7
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page_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 +7 -7
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
- package/app/.next-cli-build/server/chunks/2338.js +6 -6
- package/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/app/.next-cli-build/server/chunks/402.js +7 -7
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/6328.js +1 -1
- package/app/.next-cli-build/server/chunks/9432.js +1 -1
- package/app/.next-cli-build/server/chunks/9434.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +4 -4
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{5263-25bfce3bc46dc9a7.js → 5263-2848b6850592933b.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-c63cf50756d71ffe.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-3ef31989cc21b00d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-017bcf44536ef5e4.js +1 -0
- package/app/.next-cli-build/static/css/57bb39fb1de97063.css +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.1.32-to-5.1.33-5.1.33-20260716-193103 → upgrade-5.1.36-to-5.1.37-5.1.37-20260716-205025}/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.1.33-to-5.1.34-5.1.34-20260716-195141 → upgrade-5.1.37-to-5.1.38-5.1.38-20260716-212349}/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/app/src/mitm/server.js +30 -30
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-a4f8727c2cc2e2a3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-7955be4ef5b827d6.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-90f89d4fa21e857a.js +0 -1
- package/app/.next-cli-build/static/css/df9409a8fc9bfb91.css +0 -1
- /package/app/.next-cli-build/static/{NBc3owoi2dgNrxbwy4ja3 → NqfyM8NloK5JZgqGX-BGP}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{NBc3owoi2dgNrxbwy4ja3 → NqfyM8NloK5JZgqGX-BGP}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{14051:(e,t,s)=>{e.exports=s(34701)()},34701:(e,t,s)=>{"use strict";var n=s(82114);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,s,r,l,a){if(a!==n){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var s={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:l,resetWarningCache:r};return s.PropTypes=s,s}},39944:(e,t,s)=>{Promise.resolve().then(s.bind(s,70959))},70959:(e,t,s)=>{"use strict";s.d(t,{default:()=>J});var n=s(95155),r=s(12115),l=s(94027);let a=[{value:"today",label:"H\xf4m nay"},{value:"todayWorking",label:"H\xf4m nay (Working time)"},{value:"yesterday",label:"H\xf4m qua"},{value:"yesterdayWorking",label:"H\xf4m qua (Working time)"},{value:"24h",label:"24 giờ"},{value:"thisWeek",label:"Tuần n\xe0y"},{value:"lastWeek",label:"Tuần trước"},{value:"7d",label:"7 ng\xe0y"},{value:"thisMonth",label:"Th\xe1ng n\xe0y"},{value:"lastMonth",label:"Th\xe1ng trước"},{value:"30d",label:"30 ng\xe0y"},{value:"60d",label:"60 ng\xe0y"},{value:"all",label:"Tất cả (60 ng\xe0y)"},{value:"custom",label:"T\xf9y chọn"}],i=[{value:"overview",label:"Tổng quan",icon:"dashboard"},{value:"apiKeys",label:"API keys",icon:"vpn_key"},{value:"clients",label:"Client/User",icon:"groups"},{value:"sources",label:"Source IP / Tool",icon:"hub"},{value:"providers",label:"Provider / Model",icon:"dns"},{value:"experience",label:"Trải nghiệm",icon:"speed"},{value:"errors",label:"Lỗi & bất thường",icon:"warning"},{value:"raw",label:"Raw usage",icon:"table"}];function o(e,t=0){return Number(e||0).toLocaleString("vi-VN",{maximumFractionDigits:t})}function d(e){let t=Number(e||0);return Intl.NumberFormat("vi-VN",{notation:"compact",maximumFractionDigits:1}).format(t)}function c(e){let t=100*Number(e||0);return`${t.toLocaleString("vi-VN",{maximumFractionDigits:1})}%`}function x(e){let t=Number(e||0);return t?`$${t.toLocaleString("vi-VN",{minimumFractionDigits:4,maximumFractionDigits:6})}`:"$0"}function m(e){if(null==e||Number.isNaN(Number(e)))return"-";let t=Number(e);return t>=1e3?`${(t/1e3).toLocaleString("vi-VN",{maximumFractionDigits:2})}s`:`${t.toLocaleString("vi-VN",{maximumFractionDigits:0})}ms`}function u(e,t="/s"){if(null==e||Number.isNaN(Number(e)))return"-";let s=Number(e);return`${s.toLocaleString("vi-VN",{maximumFractionDigits:s>=10?1:2})}${t}`}function h(e){return null==e||Number.isNaN(Number(e))?"-":`${Number(e).toLocaleString("vi-VN",{maximumFractionDigits:0})}/100`}function p(e){if(!e)return null;let t=String(e).trim();return new Date(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)?$/.test(t)?`${t.replace(" ","T")}Z`:t)}function b(e){if(!e)return"-";try{let t=p(e);if(!t||Number.isNaN(t.getTime()))return String(e);return t.toLocaleString("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return String(e)}}function g(e){if(!e)return"";try{let t=p(e);if(!t||Number.isNaN(t.getTime()))return String(e);return t.toLocaleString("vi-VN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return String(e)}}function j(...e){return e.filter(Boolean).join(" ")}function v(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function k(e,t={}){let s=new URLSearchParams;return Object.entries({...e,...t}).forEach(([e,t])=>{let n=String(t??"").trim();n&&s.set(e,n)}),s.toString()}function y({children:e,className:t=""}){return(0,n.jsx)("div",{className:j("min-w-0 rounded-2xl border border-border bg-surface p-5 shadow-sm",t),children:e})}function N({icon:e,label:t,value:s,hint:r,help:l,tone:a="blue"}){return(0,n.jsx)(y,{className:"min-h-[126px]",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-text-muted",children:t}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-semibold text-text-main",children:s}),r?(0,n.jsx)("div",{className:"mt-2 text-xs text-text-muted",children:r}):null,l?(0,n.jsx)("div",{className:"mt-1 text-[11px] leading-4 text-text-muted/70",children:l}):null]}),(0,n.jsx)("div",{className:j("flex h-10 w-10 items-center justify-center rounded-xl",{blue:"bg-blue-500/10 text-blue-600 dark:text-blue-300",green:"bg-green-500/10 text-green-600 dark:text-green-300",red:"bg-red-500/10 text-red-600 dark:text-red-300",amber:"bg-amber-500/10 text-amber-600 dark:text-amber-300",purple:"bg-purple-500/10 text-purple-600 dark:text-purple-300",slate:"bg-slate-500/10 text-slate-600 dark:text-slate-300"}[a]||"bg-blue-500/10 text-blue-600 dark:text-blue-300"),children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:e})})]})})}function f({label:e,children:t}){return(0,n.jsxs)("label",{className:"space-y-1.5 text-xs font-medium text-text-muted",children:[(0,n.jsx)("span",{children:e}),t]})}function T({value:e,onChange:t,children:s}){return(0,n.jsx)("select",{value:e||"",onChange:e=>t(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none transition focus:border-primary/60 focus:ring-2 focus:ring-primary/20",children:s})}function w({value:e,onChange:t,placeholder:s="",type:r="text"}){return(0,n.jsx)("input",{value:e||"",type:r,onChange:e=>t(e.target.value),placeholder:s,className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none transition placeholder:text-text-muted/60 focus:border-primary/60 focus:ring-2 focus:ring-primary/20"})}function q(){return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:Array.from({length:8}).map((e,t)=>(0,n.jsx)("div",{className:"h-32 animate-pulse rounded-2xl border border-border bg-surface"},t))}),(0,n.jsx)("div",{className:"h-80 animate-pulse rounded-2xl border border-border bg-surface"})]})}function P({title:e="Kh\xf4ng c\xf3 dữ liệu",description:t="Kh\xf4ng t\xecm thấy dữ liệu theo bộ lọc hiện tại."}){return(0,n.jsxs)("div",{className:"flex min-h-[180px] flex-col items-center justify-center rounded-2xl border border-dashed border-border bg-surface/60 p-8 text-center",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"database_off"}),(0,n.jsx)("div",{className:"mt-3 text-sm font-semibold text-text-main",children:e}),(0,n.jsx)("div",{className:"mt-1 max-w-xl text-sm text-text-muted",children:t})]})}function R({data:e=[],valueKey:t="totalTokens",secondaryKey:s="requests",height:r=220}){let l=e||[],a=Math.max(...l.map(e=>Number(e[t]||0)),1),i=Math.max(...l.map(e=>Number(e[s]||0)),1);return 0===l.length?(0,n.jsx)(P,{description:"Chưa c\xf3 time-series trong khoảng thời gian n\xe0y."}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("div",{className:"min-w-[720px]",children:[(0,n.jsx)("div",{className:"flex items-end gap-1",style:{height:r},children:l.map((e,l)=>{let d=Math.max(2,Number(e[t]||0)/a*(r-42)),c=Math.max(2,Number(e[s]||0)/i*(r-42));return(0,n.jsx)("div",{className:"group flex flex-1 flex-col items-center justify-end gap-1",children:(0,n.jsxs)("div",{className:"relative flex h-full w-full max-w-[34px] items-end justify-center gap-0.5",children:[(0,n.jsx)("div",{className:"w-2 rounded-t bg-primary/70",style:{height:d}}),(0,n.jsx)("div",{className:"w-2 rounded-t bg-amber-500/70",style:{height:c}}),(0,n.jsxs)("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-20 hidden w-56 -translate-x-1/2 rounded-xl border border-border bg-surface p-3 text-left text-xs shadow-xl group-hover:block",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:g(e.label)}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:["Request: ",o(e.requests)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Input token: ",o(e.promptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Output token: ",o(e.completionTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Tổng token: ",o(e.totalTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Lỗi: ",o(e.errors)]})]})]})},`${e.label}-${l}`)})}),(0,n.jsxs)("div",{className:"mt-3 flex justify-between gap-2 text-[11px] text-text-muted",children:[(0,n.jsx)("span",{children:g(l[0]?.label)}),(0,n.jsx)("span",{children:g(l[Math.floor(l.length/2)]?.label)}),(0,n.jsx)("span",{children:g(l[l.length-1]?.label)})]})]})})}function S(){return(0,n.jsxs)("div",{className:"flex flex-wrap gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-sm bg-primary/70"}),"Token"]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-sm bg-amber-500/70"}),"Request"]})]})}function I({columns:e,rows:t,empty:s="Kh\xf4ng c\xf3 dữ liệu"}){return t&&0!==t.length?(0,n.jsx)("div",{className:"overflow-x-auto overflow-y-auto rounded-2xl border border-border",style:{maxHeight:"500px"},children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-background/70",children:(0,n.jsx)("tr",{children:e.map(e=>(0,n.jsx)("th",{className:j("whitespace-nowrap px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",e.className),children:e.label},e.key))})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-surface",children:t.map((t,s)=>(0,n.jsx)("tr",{className:"hover:bg-background/60",children:e.map(e=>(0,n.jsx)("td",{className:j("whitespace-nowrap px-4 py-3 align-top text-text-main",e.className),children:e.render?e.render(t,s):t[e.key]??"-"},e.key))},t.key||t.id||`${t.label}-${s}`))})]})}):(0,n.jsx)(P,{title:s})}function L({items:e=[]}){return e&&0!==e.length?(0,n.jsx)("div",{className:"flex max-w-[360px] flex-wrap gap-1.5",children:e.slice(0,3).map(e=>(0,n.jsxs)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:[e.label||e.key," \xb7 ",o(e.count??e.requests??e.totalTokens??0)]},e.key))}):(0,n.jsx)("span",{className:"text-text-muted",children:"-"})}function M({row:e}){return(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{className:"font-semibold text-text-main",children:[d(e.totalTokens)," token"]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["In ",d(e.promptTokens)," / Out ",d(e.completionTokens)]})]})}function C({leaderboard:e={}}){let t=e.rows||[],s=e.status||"warming",r="ready"===s?`${e.periodLabel||"H\xf4m nay"} \xb7 cập nhật ${b(e.generatedAt)} \xb7 refresh nền mỗi ${Math.round((e.refreshEveryMs||9e5)/6e4)} ph\xfat`:"error"===s?"Leaderboard đang chờ job nền tổng hợp lại dữ liệu.":"Leaderboard đang được job nền khởi tạo.";return(0,n.jsxs)(y,{className:"border-amber-500/20 bg-amber-500/[0.03]",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-amber-500",children:"crown"}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top 5 vinh danh token"})]}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp hạng theo API key owner d\xf9ng nhiều input + output token nhất."})]}),(0,n.jsx)("span",{className:"rounded-full bg-amber-500/10 px-3 py-1 text-xs font-semibold text-amber-700 dark:text-amber-300",children:r})]}),(0,n.jsx)(I,{rows:t,empty:"Chưa c\xf3 snapshot leaderboard từ job nền.",columns:[{key:"rank",label:"Hạng",render:e=>(0,n.jsxs)("div",{className:"flex min-w-[170px] items-center gap-3",children:[(0,n.jsx)("div",{className:j("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",1===e.rank?"bg-amber-500/15 text-amber-600":"bg-primary/10 text-primary"),children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"crown"})}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"font-semibold text-text-main",children:["#",e.rank," \xb7 ",e.title]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[c(e.tokenShare||0)," tổng token"]})]})]})},{key:"owner",label:"Owner",render:e=>(0,n.jsxs)("div",{className:"min-w-[210px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.ownerUser||e.label}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.apiKeyName||"API key",e.apiKeyFingerprint?` \xb7 ${e.apiKeyFingerprint}`:""]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"scope",label:"Phạm vi",render:e=>(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["API key ",o(e.apiKeyCount)," \xb7 IP ",o(e.sourceIpCount)]}),(0,n.jsxs)("div",{children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})}function A({value:e}){let t=Number(e||0);return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",t>=.2?"bg-red-500/10 text-red-600 dark:text-red-300":t>=.05?"bg-amber-500/10 text-amber-600 dark:text-amber-300":"bg-green-500/10 text-green-600 dark:text-green-300"),children:c(t)})}function $({level:e,label:t}){let s=String(e||"none");return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",{fast:"bg-green-500/10 text-green-700 dark:text-green-300",ok:"bg-blue-500/10 text-blue-700 dark:text-blue-300",slow:"bg-amber-500/10 text-amber-700 dark:text-amber-300",very_slow:"bg-red-500/10 text-red-700 dark:text-red-300",low_sample:"bg-amber-500/10 text-amber-700 dark:text-amber-300",none:"bg-slate-500/10 text-slate-700 dark:text-slate-300"}[s]||"bg-slate-500/10 text-slate-700 dark:text-slate-300"),children:t||"-"})}function K({level:e,label:t}){let s=String(e||"normal");return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",{critical:"bg-red-500/10 text-red-700 dark:text-red-300",high:"bg-amber-500/10 text-amber-700 dark:text-amber-300",medium:"bg-blue-500/10 text-blue-700 dark:text-blue-300",normal:"bg-green-500/10 text-green-700 dark:text-green-300",none:"bg-slate-500/10 text-slate-700 dark:text-slate-300"}[s]||"bg-slate-500/10 text-slate-700 dark:text-slate-300"),children:t||"-"})}function O({value:e}){let t=String(e||"unknown"),s={gateway:{label:"Gateway",cls:"bg-purple-500/10 text-purple-700 dark:text-purple-300"},upstream:{label:"Upstream",cls:"bg-red-500/10 text-red-700 dark:text-red-300"},client:{label:"Client",cls:"bg-slate-500/10 text-slate-700 dark:text-slate-300"},rate_limit:{label:"Rate limit",cls:"bg-amber-500/10 text-amber-700 dark:text-amber-300"},unknown:{label:"Unknown",cls:"bg-zinc-500/10 text-zinc-700 dark:text-zinc-300"}}[t]||{label:t,cls:"bg-zinc-500/10 text-zinc-700 dark:text-zinc-300"};return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",s.cls),children:s.label})}function F({row:e}){let t=e.sampleMessage||e.errorMessageShort||"";return t?(0,n.jsx)("span",{className:"block max-w-[360px] truncate text-xs text-text-muted",title:t,children:t}):(0,n.jsx)("span",{className:"text-text-muted",children:"-"})}function E({icon:e,label:t,value:s,hint:r,tone:l="slate"}){return(0,n.jsx)("div",{className:j("rounded-2xl border p-4 shadow-sm",{red:"border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300",amber:"border-amber-500/20 bg-amber-500/10 text-amber-700 dark:text-amber-300",purple:"border-purple-500/20 bg-purple-500/10 text-purple-700 dark:text-purple-300",slate:"border-border bg-surface text-text-main",green:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-300"}[l]||"border-border bg-surface text-text-main"),children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide opacity-75",children:t}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-bold",children:o(s)}),r?(0,n.jsx)("div",{className:"mt-1 text-xs opacity-80",children:r}):null]}),(0,n.jsx)("span",{className:"material-symbols-outlined text-[24px] opacity-80",children:e})]})})}function _({anomaly:e}){let t="danger"===e.level?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",s="danger"===e.level?"error":"warning";return(0,n.jsx)("div",{className:j("rounded-2xl border p-4",t),children:(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:s}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.title}),(0,n.jsx)("div",{className:"mt-1 text-sm opacity-90",children:e.detail})]})]})})}function U({notes:e=[]}){return e.length?(0,n.jsx)("div",{className:"space-y-2 rounded-2xl border border-blue-500/20 bg-blue-500/10 p-4 text-sm text-blue-700 dark:text-blue-300",children:e.map((e,t)=>(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"info"}),(0,n.jsx)("span",{children:e})]},t))}):null}function V(e){let t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function H({filters:e,setFilters:t,options:s,onRefresh:r,onExportCsv:l,loading:i,showProviderFilters:o=!0}){let d=(e,s)=>{let n=null;t(t=>{if("period"===e&&"custom"===s){let e,r;return n={...t,period:s,...((r=new Date(e=new Date)).setHours(8,0,0,0),{dateFrom:V(r),dateTo:V(e)})}}return{...t,[e]:s}}),n&&r?.(n)};return(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-6",children:[(0,n.jsx)(f,{label:"Khoảng thời gian",children:(0,n.jsx)(T,{value:e.period,onChange:e=>d("period",e),children:a.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,n.jsx)(f,{label:"Từ ng\xe0y",children:(0,n.jsx)(w,{type:"datetime-local",value:e.dateFrom,onChange:e=>d("dateFrom",e)})}),(0,n.jsx)(f,{label:"Đến ng\xe0y",children:(0,n.jsx)(w,{type:"datetime-local",value:e.dateTo,onChange:e=>d("dateTo",e)})}),o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f,{label:"Provider",children:(0,n.jsxs)(T,{value:e.provider,onChange:e=>d("provider",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả provider"}),(s.providers||[]).map(e=>{let t="string"==typeof e?e:e.value,s="string"==typeof e?e:e.label||e.value;return(0,n.jsx)("option",{value:t,children:s},t)})]})}),(0,n.jsx)(f,{label:"Model",children:(0,n.jsxs)(T,{value:e.model,onChange:e=>d("model",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả model"}),(s.models||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(f,{label:"Provider account",children:(0,n.jsxs)(T,{value:e.connectionId,onChange:e=>d("connectionId",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả account"}),(s.connections||[]).map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]})})]}):null,(0,n.jsx)(f,{label:"API key",children:(0,n.jsxs)(T,{value:e.apiKey,onChange:e=>d("apiKey",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả API key"}),(s.apiKeys||[]).map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]})}),(0,n.jsx)(f,{label:"Source IP",children:(0,n.jsx)(w,{value:e.clientIp,onChange:e=>d("clientIp",e),placeholder:"172.16.253.1"})}),(0,n.jsx)(f,{label:"Source tool",children:(0,n.jsx)(w,{value:e.sourceTool,onChange:e=>d("sourceTool",e),placeholder:"copilot, antigravity..."})}),(0,n.jsx)(f,{label:"Endpoint",children:(0,n.jsxs)(T,{value:e.endpoint,onChange:e=>d("endpoint",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả endpoint"}),(s.endpoints||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(f,{label:"Status",children:(0,n.jsxs)(T,{value:e.status,onChange:e=>d("status",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả status"}),(s.statuses||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(f,{label:"Session / keyword",children:(0,n.jsx)(w,{value:e.sessionId||e.keyword,onChange:e=>d("keyword",e),placeholder:"session, prompt, error..."})})]}),(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Token/cost lấy từ UsageHistory. Source IP/tool/session lấy từ Prompt Logs."}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)("button",{onClick:()=>t({period:"today",dateFrom:"",dateTo:"",provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:"",clientIp:"",sourceTool:"",sessionId:"",keyword:""}),className:"rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-main hover:bg-background",children:"Reset"}),(0,n.jsxs)("button",{onClick:l,className:"rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-main hover:bg-background",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-1 align-[-4px] text-[18px]",children:"download"}),"Export CSV"]}),(0,n.jsxs)("button",{onClick:()=>r?.(),disabled:i,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white shadow-sm disabled:opacity-60",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-1 align-[-4px] text-[18px]",children:"refresh"}),i?"Đang tải...":"Refresh"]})]})]})]})}function D({data:e}){let t=e.overview||{},s=e.latency||{},r=e.experience||{};return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsx)(C,{leaderboard:e.tokenLeaderboard}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(N,{icon:"call_made",label:"Tổng request",value:o(t.requests),hint:`${o(t.requestsPerMinute,2)} request/ph\xfat`,help:"Số request khớp bộ lọc hiện tại."}),(0,n.jsx)(N,{icon:"check_circle",label:"Th\xe0nh c\xf4ng",value:o(t.success),hint:`Tỷ lệ lỗi ${c(t.errorRate)}`,help:"Request trả về th\xe0nh c\xf4ng v\xe0 c\xf3 trạng th\xe1i OK.",tone:"green"}),(0,n.jsx)(N,{icon:"dns",label:"Lỗi server/provider",value:o(t.serverErrorEvents),hint:`Server-impacting ${c(t.serverErrorRate)} \xb7 client ${o(t.clientErrorEvents)}`,help:"Lỗi từ gateway, provider hoặc model server; t\xe1ch ri\xeang lỗi client.",tone:t.serverErrorEvents?"red":"green"}),(0,n.jsx)(N,{icon:"speed",label:"Trải nghiệm",value:h(r.score),hint:`${r.label||"-"} \xb7 ${o(r.samples)} mẫu`,help:"Điểm tổng hợp từ latency, TTFT, lỗi v\xe0 tốc độ phản hồi.",tone:r.tone||"purple"}),(0,n.jsx)(N,{icon:"timer",label:"Latency P95",value:m(r.p95LatencyMs||s.p95Ms),hint:`AVG ${m(r.avgLatencyMs||s.avgMs)} \xb7 P50 ${m(r.p50LatencyMs||s.p50Ms)}`,help:"95% request ho\xe0n tất nhanh hơn gi\xe1 trị n\xe0y.",tone:"purple"}),(0,n.jsx)(N,{icon:"bolt",label:"TTFT P95",value:m(r.p95TtftMs),hint:"Thời gian chờ token đầu ti\xean",help:"95% request nhận token đầu ti\xean nhanh hơn gi\xe1 trị n\xe0y.",tone:r.slowTtftRate>=.2?"amber":"blue"}),(0,n.jsx)(N,{icon:"input",label:"Input P95",value:d(r.p95PromptTokens||0),hint:`Avg ${d(r.avgPromptTokens||t.avgPromptTokens)} \xb7 >=30k ${c(r.longInputRate)}`,help:"95% request c\xf3 k\xedch thước input nhỏ hơn gi\xe1 trị n\xe0y."}),(0,n.jsx)(N,{icon:"psychology_alt",label:"Auto-off thinking",value:c(e.thinkingAnalytics?.autoOffRate),hint:`${o(e.thinkingAnalytics?.autoOffRequests||0)} request bị tắt theo policy`,help:"Tỷ lệ request bị tắt thinking do vượt ngưỡng hoặc policy.",tone:(e.thinkingAnalytics?.autoOffRate||0)>=.3?"amber":"slate"}),(0,n.jsx)(N,{icon:"data_object",label:"Large context >=50k",value:c(e.largeContextAnalytics?.gte50kRate),hint:`>=100k ${c(e.largeContextAnalytics?.gte100kRate)}`,help:"Tỷ lệ request c\xf3 context rất lớn, dễ l\xe0m tăng TTFT/latency.",tone:(e.largeContextAnalytics?.gte50kRate||0)>=.3?"amber":"slate"}),(0,n.jsx)(N,{icon:"person_alert",label:"Top user nặng",value:t.topHeavyUser||"-",hint:`Chiếm ${c(t.topHeavyUserTokenShare)} tổng token`,help:"User/API key ti\xeau thụ nhiều token nhất trong bộ lọc.",tone:t.topHeavyUserTokenShare>=.35?"amber":"slate"}),(0,n.jsx)(N,{icon:"running_with_errors",label:"Request chậm",value:c(r.slowRequestRate),hint:`>= ${m(r.thresholds?.slowLatencyMs||45e3)} \xb7 max ${m(r.maxLatencyMs)}`,help:"Tỷ lệ request vượt ngưỡng chậm đ\xe3 cấu h\xecnh.",tone:r.slowRequestRate>=.2?"amber":"green"}),(0,n.jsx)(N,{icon:"output",label:"Output tokens",value:d(t.completionTokens),hint:`Avg ${o(t.avgCompletionTokens,1)} / request`,help:"Tổng token model sinh ra."}),(0,n.jsx)(N,{icon:"token",label:"Tổng tokens",value:d(t.totalTokens),hint:`${d(t.tokensPerMinute)} token/ph\xfat`,help:"Tổng input + output token.",tone:"amber"}),(0,n.jsx)(N,{icon:"speed",label:"Output speed",value:u(r.decodeTokensPerSecond," tok/s"),hint:`Latency/10k input ${m(r.latencyMsPer10kInputTokens)}`,help:"Tốc độ sinh token trung b\xecnh sau khi model bắt đầu trả lời.",tone:"slate"}),(0,n.jsx)(N,{icon:"payments",label:"Cost ước t\xednh",value:x(t.cost),hint:"Dựa tr\xean pricing đ\xe3 cấu h\xecnh",help:"Chi ph\xed suy ra từ token usage v\xe0 bảng gi\xe1 hiện tại.",tone:"green"})]}),(0,n.jsxs)("div",{className:"grid min-w-0 gap-5 xl:grid-cols-[2fr_1fr]",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Tần suất request & token theo thời gian"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Cột xanh l\xe0 token, cột v\xe0ng l\xe0 số request trong từng bucket thời gian."})]}),(0,n.jsx)(S,{})]}),(0,n.jsx)(R,{data:e.timeSeries||[]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"T\xf3m tắt active"}),(0,n.jsx)("div",{className:"mt-4 space-y-3",children:[["API key đang d\xf9ng",t.activeApiKeys],["Provider active",t.activeProviders],["Model active",t.activeModels],["Endpoint active",t.activeEndpoints],["Cached tokens",t.cachedTokens],["Reasoning tokens",t.reasoningTokens],["Latency AVG",m(r.avgLatencyMs||s.avgMs)],["Latency P50",m(r.p50LatencyMs||s.p50Ms)],["Latency P99",m(r.p99LatencyMs||s.p99Ms)],["TTFT P95",m(r.p95TtftMs)],["Input P95",d(r.p95PromptTokens||0)],["Long input >=30k",c(r.longInputRate)]].map(([e,t])=>(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-background px-3 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-text-muted",children:e}),(0,n.jsx)("span",{className:"font-semibold text-text-main",children:"number"==typeof t?o(t):t})]},e))})]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top API key d\xf9ng nhiều token"}),(0,n.jsx)(I,{rows:(e.clientRequests?.topApiKeysByTokens||e.groups?.apiKeys||[]).slice(0,8),columns:[{key:"name",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.name||e.label}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.fingerprint||e.apiKeyFingerprint,e.ownerUser||e.apiKeyOwner?` \xb7 ${e.ownerUser||e.apiKeyOwner}`:""]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"P95/Max input",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.p95PromptTokens||0)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxPromptTokens||0)]})]})}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top Source IP d\xf9ng nhiều token"}),(0,n.jsx)(I,{rows:(e.clientRequests?.topSourceIpsByTokens||[]).slice(0,8),columns:[{key:"label",label:"Source IP",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"heavy",label:"Nặng",render:e=>(0,n.jsxs)("span",{className:"text-xs text-text-muted",children:[o(e.heavyRequests||0)," req"]})}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]})]})]})}function B({data:e}){let t=e.clientRequests||{},s=t.summary||{},r=t.topHeavyUsers||[],l=t.topProblemClients||[],a=t.topApiKeysByTokens||[],i=t.topSourceIpsByTokens||[];t.topSourceIpsByHeavyRequests;let x=t.inputBuckets||[],u=e=>(0,n.jsxs)("div",{className:"min-w-[220px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.label}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.ownerUser?`Owner ${e.ownerUser}`:e.apiKeyName||"Kh\xf4ng c\xf3 owner"}),(0,n.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:e.apiKeyFingerprint||e.primaryClientIp||e.key})]}),h=e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Nặng ",o(e.heavyRequests)," \xb7 ",c(e.heavyRequestRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["P95 input ",d(e.p95PromptTokens)," \xb7 Max ",d(e.maxPromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=70k ",o(e.extremeInputRequests)," \xb7 ",c(e.extremeInputRate)]})]});return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(N,{icon:"person_alert",label:"Top user nặng nhất",value:s.topUserLabel||"-",hint:`${d(s.topUserTokens)} token \xb7 ${c(s.topUserTokenShare)} tổng token`,tone:s.topUserTokenShare>=.35?"amber":"slate"}),(0,n.jsx)(N,{icon:"vpn_key",label:"Top API key nhiều token",value:s.topApiKeyLabel||"-",hint:`${d(s.topApiKeyTokens)} token \xb7 ${c(s.topApiKeyTokenShare)} tổng token`,tone:s.topApiKeyTokenShare>=.35?"amber":"blue"}),(0,n.jsx)(N,{icon:"lan",label:"Top IP nhiều token",value:s.topSourceIpLabel||"-",hint:`${d(s.topSourceIpTokens)} token \xb7 ${c(s.topSourceIpTokenShare)} tổng token`,tone:s.topSourceIpTokenShare>=.35?"amber":"purple"}),(0,n.jsx)(N,{icon:"input",label:"Input d\xe0i >=30k",value:c(s.longInputBucketShare||0),hint:`>=70k ${c(s.extremeInputShare||0)}`,tone:(s.extremeInputShare||0)>=.1?"amber":"green"}),(0,n.jsx)(N,{icon:"groups",label:"User/API key được theo d\xf5i",value:o(s.trackedUsers||0),hint:"Theo owner/API key fingerprint/source IP",tone:"blue"}),(0,n.jsx)(N,{icon:"network_check",label:"Top IP request nặng",value:s.topSourceIpHeavyLabel||"-",hint:`${o(s.topSourceIpHeavyRequests||0)} request >=30k input/total`,tone:s.topSourceIpHeavyRequests?"amber":"slate"}),(0,n.jsx)(N,{icon:"report",label:"Client lỗi nhiều",value:o(s.problemClients||0),hint:"Nh\xf3m user/API key c\xf3 error rows",tone:s.problemClients?"amber":"green"})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top user/API key gửi request nặng nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo tổng input/output token của request th\xe0nh c\xf4ng c\xf3 token. D\xf9ng để ph\xe1t hiện user VS Code/agent đang tạo tải long-context lớn."})]}),(0,n.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-xs font-semibold text-primary",children:"Kh\xf4ng hiển thị full bearer token"})]}),(0,n.jsx)(I,{rows:r,columns:[{key:"user",label:"User/API key",render:u},{key:"quality",label:"\xc1p lực",render:e=>(0,n.jsx)(K,{level:e.level,label:e.pressureLabel})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input pressure",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Avg ",d(e.avgPromptTokens)," \xb7 P95 ",d(e.p95PromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Max ",d(e.maxPromptTokens)," \xb7 >=30k ",c(e.longInputRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=50k ",c(e.hugeInputRate)," \xb7 >=70k ",c(e.extremeInputRate)]})]})},{key:"latency",label:"Latency / TTFT",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["P95 ",m(e.p95LatencyMs)," \xb7 Max ",m(e.maxLatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT P95 ",m(e.p95TtftMs)," \xb7 Slow ",c(e.slowRequestRate)]})]})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"topIps",label:"IP / Tool",render:e=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(L,{items:e.topIps}),(0,n.jsx)(L,{items:e.topTools})]})},{key:"meta",label:"Meta",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["Key ",o(e.apiKeyCount)," \xb7 IP ",o(e.sourceIpCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{children:["Session ",o(e.sessionCount)," \xb7 Last ",b(e.lastSeen)]})]})}],empty:"Kh\xf4ng c\xf3 request th\xe0nh c\xf4ng c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top API key d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo tổng input + output token từ UsageHistory, kh\xf4ng lộ full bearer token."})]}),(0,n.jsx)(I,{rows:a,columns:[{key:"apiKey",label:"API key",render:e=>(0,n.jsxs)("div",{className:"min-w-[220px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.label}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.apiKeyOwner?`Owner ${e.apiKeyOwner}`:e.apiKeyName||e.primarySourceTool||"-"}),(0,n.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:e.apiKeyFingerprint||e.primaryClientIp||e.key})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input nặng",render:h},{key:"meta",label:"Nguồn",render:e=>(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["IP ",o(e.sourceIpCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 API key c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top Source IP d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Dựa tr\xean UsageHistory n\xean c\xf3 input/output token, kh\xe1c với bảng Source IP từ Prompt Logs chỉ đếm log."})]}),(0,n.jsx)(I,{rows:i,columns:[{key:"ip",label:"Source IP",render:e=>(0,n.jsxs)("div",{className:"min-w-[180px]",children:[(0,n.jsx)("div",{className:"font-mono text-sm font-semibold text-text-main",children:e.label}),(0,n.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:["Tool ",o(e.sourceToolCount)," \xb7 API key ",o(e.apiKeyCount)]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input nặng",render:h},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Ph\xe2n bố request theo k\xedch thước input"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Gi\xfap admin biết workload đang l\xe0 chat ngắn hay long-context VS Code/agent."})]}),(0,n.jsx)(I,{rows:x,columns:[{key:"label",label:"Input bucket",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"share",label:"Tỷ trọng",render:e=>c(e.share)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"latency",label:"Latency P95/MAX",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[m(e.p95LatencyMs)," / ",m(e.maxLatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT P95 ",m(e.p95TtftMs)]})]})}],empty:"Kh\xf4ng c\xf3 dữ liệu bucket input."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Client/API key lỗi nhiều"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng để ph\xe1t hiện sai endpoint/model/auth/policy hoặc client tool cấu h\xecnh sai."})]}),(0,n.jsx)(I,{rows:l,columns:[{key:"user",label:"Client",render:u},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"source",label:"IP/Tool",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"font-mono",children:e.primaryClientIp||"-"}),(0,n.jsx)("div",{className:"text-text-muted",children:e.primarySourceTool||"-"})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 client lỗi theo bộ lọc hiện tại."})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"G\xf3c nh\xecn monitor client n\xean d\xf9ng"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"C\xe1c chỉ số n\xe0y bổ sung cho latency/model để admin ph\xe2n biệt server chậm hay client gửi request qu\xe1 nặng."})]}),(0,n.jsx)("div",{className:"grid gap-3 text-sm md:grid-cols-2 xl:grid-cols-3",children:[["Token/user","X\xe1c định user/API key tạo tải lớn nhất, hữu \xedch cho quota v\xe0 hướng dẫn workflow VS Code."],["Input bucket","Nếu phần lớn request nằm ở 30k-70k+, P95/P99 cao chủ yếu do prompt eval/context d\xe0i."],["TTFT theo user","TTFT cao cho một user thường l\xe0 input d\xe0i hoặc chờ slot, kh\xf4ng nhất thiết provider lỗi."],["Error theo client","T\xe1ch lỗi sai endpoint/model/API key khỏi lỗi server/provider để kh\xf4ng cảnh b\xe1o nhầm."],["Source IP/tool","Ph\xe1t hiện m\xe1y/tool gửi request nhiều hoặc cấu h\xecnh sai."],["Top request nặng","D\xf9ng Raw usage để drill-down request cụ thể khi một user k\xe9o tải hệ thống."]].map(([e,t])=>(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:t})]},e))})]})]})}function G({data:e}){return(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Thống k\xea theo API key"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Kh\xf4ng hiển thị full bearer token. Dashboard chỉ d\xf9ng fingerprint/masked key."})]}),(0,n.jsx)(I,{rows:e.groups?.apiKeys||[],columns:[{key:"name",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.fingerprint,e.ownerUser?` \xb7 Owner: ${e.ownerUser}`:""]})]})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"success",label:"OK/Lỗi",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{className:"text-green-600",children:["OK ",o(e.success)]}),(0,n.jsxs)("div",{className:"text-red-600",children:["Lỗi ",o(e.errors)]})]})},{key:"tokens",label:"In/Out token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"topProviders",label:"Top provider",render:e=>(0,n.jsx)(L,{items:e.topProviders})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})}function z({data:e}){let t=e.clientRequests?.topSourceIpsByTokens||[],s=e.clientRequests?.topSourceIpsByHeavyRequests||[],r=e=>(0,n.jsxs)("div",{className:"min-w-[180px]",children:[(0,n.jsx)("div",{className:"font-mono text-sm font-semibold text-text-main",children:e.label}),(0,n.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:["API key ",o(e.apiKeyCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]});return(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top IP d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Aggregate từ UsageHistory, xếp theo tổng input + output token."})]}),(0,n.jsx)(I,{rows:t,columns:[{key:"ip",label:"Source IP",render:r},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top IP gửi request nặng nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo số request input/total token từ 30k trở l\xean, sau đ\xf3 theo max/P95 input."})]}),(0,n.jsx)(I,{rows:s,columns:[{key:"ip",label:"Source IP",render:r},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"heavy",label:"Request nặng",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Nặng ",o(e.heavyRequests)," \xb7 ",c(e.heavyRequestRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["P95 input ",d(e.p95PromptTokens)," \xb7 Max ",d(e.maxPromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=70k ",o(e.extremeInputRequests)," \xb7 ",c(e.extremeInputRate)]})]})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP gửi request nặng trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Source IP từ Prompt Logs"}),(0,n.jsx)(I,{rows:e.promptLogs?.topClientIps||[],columns:[{key:"label",label:"IP",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topTools",label:"Tools",render:e=>(0,n.jsx)(L,{items:e.topTools})},{key:"topModels",label:"Models",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Source tool"}),(0,n.jsx)(I,{rows:e.promptLogs?.topSourceTools||[],columns:[{key:"label",label:"Tool",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topIps",label:"Top IP",render:e=>(0,n.jsx)(L,{items:e.topIps})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{className:"xl:col-span-2",children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Session nhiều hoạt động"}),(0,n.jsx)(I,{rows:e.promptLogs?.topSessions||[],columns:[{key:"label",label:"Session",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"topIps",label:"IP",render:e=>(0,n.jsx)(L,{items:e.topIps})},{key:"topTools",label:"Tool",render:e=>(0,n.jsx)(L,{items:e.topTools})},{key:"topModels",label:"Model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})]})}function W({data:e}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Provider"}),(0,n.jsx)(I,{rows:e.groups?.providers||[],columns:[{key:"label",label:"Provider",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Model"}),(0,n.jsx)(I,{rows:e.groups?.models||[],columns:[{key:"label",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Lỗi",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Provider account / connection"}),(0,n.jsx)(I,{rows:e.groups?.providerAccounts||[],columns:[{key:"label",label:"Account",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.label}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider||e.connectionId})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Lỗi",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Endpoint"}),(0,n.jsx)(I,{rows:e.groups?.endpoints||[],columns:[{key:"label",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})]})}function X({data:e}){let t=e.experience||{},s=t.thresholds||{},r=e.thinkingAnalytics||{},l=e.largeContextAnalytics||{},a=t.byModel||[],i=t.slowestRequests||[];return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(N,{icon:"verified",label:"Đ\xe1nh gi\xe1 tổng",value:h(t.score),hint:`${t.label||"-"} \xb7 ${o(t.samples)} mẫu success c\xf3 token`,help:"Điểm chất lượng trải nghiệm tổng hợp từ c\xe1c request th\xe0nh c\xf4ng c\xf3 token.",tone:t.tone||"slate"}),(0,n.jsx)(N,{icon:"timer",label:"Latency AVG / P95",value:`${m(t.avgLatencyMs)} / ${m(t.p95LatencyMs)}`,hint:`P50 ${m(t.p50LatencyMs)} \xb7 P99 ${m(t.p99LatencyMs)}`,help:"AVG l\xe0 trung b\xecnh; P95 thể hiện nh\xf3m 5% request chậm nhất.",tone:"purple"}),(0,n.jsx)(N,{icon:"bolt",label:"TTFT AVG / P95",value:`${m(t.avgTtftMs)} / ${m(t.p95TtftMs)}`,hint:"TTFT cao thường l\xe0 queue/prompt eval/input d\xe0i",help:"Thời gian từ l\xfac gửi request đến token đầu ti\xean.",tone:t.slowTtftRate>=.2?"amber":"blue"}),(0,n.jsx)(N,{icon:"keyboard_double_arrow_up",label:"Input AVG / P95",value:`${d(t.avgPromptTokens)} / ${d(t.p95PromptTokens)}`,hint:`>=30k ${c(t.longInputRate)} \xb7 >=50k ${c(t.hugeInputRate)}`,help:"Input c\xe0ng lớn th\xec prompt eval v\xe0 TTFT thường c\xe0ng cao."}),(0,n.jsx)(N,{icon:"running_with_errors",label:"Slow request",value:c(t.slowRequestRate),hint:`Latency >= ${m(s.slowLatencyMs||45e3)} \xb7 rất chậm ${c(t.verySlowRequestRate)}`,help:"Tỷ lệ request ho\xe0n tất chậm hơn ngưỡng vận h\xe0nh.",tone:t.slowRequestRate>=.2?"amber":"green"}),(0,n.jsx)(N,{icon:"pending_actions",label:"Slow TTFT",value:c(t.slowTtftRate),hint:`TTFT >= ${m(s.slowTtftMs||2e4)}`,help:"Tỷ lệ request chờ token đầu ti\xean qu\xe1 l\xe2u.",tone:t.slowTtftRate>=.2?"amber":"green"}),(0,n.jsx)(N,{icon:"speed",label:"Output tốc độ",value:u(t.decodeTokensPerSecond," tok/s"),hint:`Output/latency ${u(t.outputTokensPerSecond," tok/s")}`,tone:"slate"}),(0,n.jsx)(N,{icon:"data_usage",label:"Latency / 10k input",value:m(t.latencyMsPer10kInputTokens),hint:"Hữu \xedch khi VS Code gửi 30k–70k token",help:"Chuẩn h\xf3a latency theo k\xedch thước input để so s\xe1nh c\xf4ng bằng hơn.",tone:"slate"}),(0,n.jsx)(N,{icon:"psychology_alt",label:"Thinking auto-off",value:c(r.autoOffRate),hint:`${o(r.autoOffRequests||0)} / ${o(r.totalRequests||0)} request`,help:"Request bị tắt thinking tự động do vượt ngưỡng prompt chars.",tone:(r.autoOffRate||0)>=.3?"amber":"green"}),(0,n.jsx)(N,{icon:"toggle_off",label:"Thinking OFF",value:c(r.thinkingOffRate),hint:`ON ${c(r.thinkingOnRate)} \xb7 unknown ${c(r.unknownRate)}`,help:"Tỷ lệ request cuối c\xf9ng chạy ở chế độ kh\xf4ng thinking.",tone:(r.thinkingOffRate||0)>=.5?"blue":"slate"}),(0,n.jsx)(N,{icon:"data_object",label:"Large context",value:c(l.gte50kRate),hint:`>=30k ${c(l.gte30kRate)} \xb7 >=100k ${c(l.gte100kRate)}`,help:"Tỷ lệ request c\xf3 context lớn; thường l\xe0 nguy\xean nh\xe2n l\xe0m P95/P99 tăng.",tone:(l.gte50kRate||0)>=.3?"amber":"slate"})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Thinking Analytics"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Theo d\xf5i request bật/tắt thinking v\xe0 tỷ lệ auto-off do vượt ngưỡng prompt chars."})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:[["Thinking ON",o(r.thinkingOnRequests||0),c(r.thinkingOnRate)],["Thinking OFF",o(r.thinkingOffRequests||0),c(r.thinkingOffRate)],["Auto-off hit",o(r.autoOffRequests||0),c(r.autoOffRate)],["C\xf3 ngưỡng auto-off",o(r.thresholdConfiguredRequests||0),`hit ${c(r.autoOffEligibleHitRate)}`]].map(([e,t,s])=>(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-xl font-semibold text-text-main",children:t}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:s})]},e))}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(I,{rows:r.byModel||[],empty:"Chưa c\xf3 dữ liệu thinking trong khoảng lọc.",columns:[{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.provider})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"autoOff",label:"Auto-off",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.autoOffRequests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.autoOffRate)})]})},{key:"thinking",label:"ON/OFF",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:["ON ",o(e.thinkingOnRequests)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["OFF ",o(e.thinkingOffRequests)]})]})},{key:"chars",label:"Chars avg/max",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.avgPromptChars)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxPromptChars)]})]})}]})})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Large Context Analytics"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Bucket theo request size, ưu ti\xean prompt chars; nếu chưa c\xf3 chars th\xec fallback prompt tokens."})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:[[">=30k",l.gte30kRequests,l.gte30kRate],[">=50k",l.gte50kRequests,l.gte50kRate],[">=100k",l.gte100kRequests,l.gte100kRate]].map(([e,t,s])=>(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-xl font-semibold text-text-main",children:o(t||0)}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:c(s)})]},e))}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(I,{rows:l.buckets||[],empty:"Chưa c\xf3 large context buckets trong khoảng lọc.",columns:[{key:"label",label:"Bucket",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Req",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.requests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.share)})]})},{key:"chars",label:"Size avg/max",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.avgRequestSize)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxRequestSize)]})]})},{key:"latency",label:"Latency/TTFT",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:m(e.avgLatencyMs)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT ",m(e.avgTtftMs)]})]})},{key:"autoOff",label:"Auto-off",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.autoOffRequests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.autoOffRate)})]})}]})})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"C\xe1ch đọc trải nghiệm user"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Nh\xf3m n\xe0y chỉ t\xednh request th\xe0nh c\xf4ng c\xf3 token v\xe0 latency > 0. Error/pending/success 0-token kh\xf4ng trộn v\xe0o tốc độ model. TTFT l\xe0 thời gian tới token đầu ti\xean; với VS Code input 30k–70k, TTFT cao thường phản \xe1nh chờ slot hoặc prompt eval d\xe0i."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Nhanh/chậm thực tế"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"Latency AVG/P50/P95/MAX cho biết user phải chờ bao l\xe2u để request ho\xe0n tất."})]}),(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Queue hoặc prompt eval"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"TTFT cao + input P95 cao l\xe0 t\xedn hiệu request d\xe0i, hết slot hoặc upstream đang queue."})]}),(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"VS Code / agent"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"Theo d\xf5i tỷ lệ input >=30k/50k/70k để biết P95/P99 cao c\xf3 phải do context cực d\xe0i hay kh\xf4ng."})]})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Chất lượng phản hồi theo provider/model"}),(0,n.jsx)(I,{rows:a,empty:"Chưa c\xf3 mẫu latency cho model trong khoảng lọc.",columns:[{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"quality",label:"Đ\xe1nh gi\xe1",render:e=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)($,{level:e.level,label:e.labelQuality}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:h(e.score)})]})},{key:"samples",label:"Mẫu",render:e=>o(e.samples)},{key:"latency",label:"Latency P50/P95/MAX",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[m(e.p50LatencyMs)," / ",m(e.p95LatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",m(e.maxLatencyMs)]})]})},{key:"ttft",label:"TTFT P95",render:e=>m(e.p95TtftMs)},{key:"input",label:"Input avg/P95",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[d(e.avgPromptTokens)," / ",d(e.p95PromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=30k ",c(e.longInputRate)]})]})},{key:"slow",label:"Chậm",render:e=>(0,n.jsx)(A,{value:e.slowRequestRate})},{key:"speed",label:"Output tok/s",render:e=>u(e.outputTokensPerSecond," tok/s")}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Request chậm nhất"}),(0,n.jsx)(I,{rows:i,empty:"Kh\xf4ng c\xf3 request chậm trong khoảng lọc.",columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"latency",label:"Latency / TTFT",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"font-semibold",children:m(e.latencyMs)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT ",m(e.ttftMs)]})]})},{key:"tokens",label:"In / Out",render:e=>(0,n.jsx)(M,{row:e})},{key:"apiKeyName",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:e.apiKeyName}),(0,n.jsx)("div",{className:"font-mono text-xs text-text-muted",children:e.apiKeyFingerprint})]})},{key:"sourceTool",label:"Tool/IP",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:e.sourceTool||"-"}),(0,n.jsx)("div",{className:"font-mono text-text-muted",children:e.clientIp||"-"})]})},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint||"-"})}]})]})]})}function Z({data:e}){let t=e.requestErrors||{},s=t.summary||{},r=e.overview||{},l=Number(r.serverErrorRate||0),a=Number(r.clientErrorRate||0),i=Number(r.rateLimitErrorRate||0),d=[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner})},{key:"status",label:"Status",render:e=>(0,n.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:e.status})},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"requests",label:"Lỗi",render:e=>o(e.errors||e.requests)},{key:"errorType",label:"Type",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.errorType||e.errorCode||"-"})},{key:"sampleMessage",label:"Sample",render:e=>(0,n.jsx)(F,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}];return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[(0,n.jsx)(E,{icon:"dns",label:"Server/provider",value:s.serverImpacting||0,hint:`${c(l)} tr\xean tổng request`,tone:s.serverImpacting?"red":"green"}),(0,n.jsx)(E,{icon:"cloud_off",label:"Upstream",value:s.upstream||0,hint:"Provider/model server, timeout, network, 5xx",tone:s.upstream?"red":"green"}),(0,n.jsx)(E,{icon:"router",label:"Gateway",value:s.gateway||0,hint:"Lỗi nội bộ BlueRouter/gateway",tone:s.gateway?"purple":"green"}),(0,n.jsx)(E,{icon:"integration_instructions",label:"Client/request",value:s.client||0,hint:`${c(a)} do endpoint/model/body/auth`,tone:s.client?"slate":"green"}),(0,n.jsx)(E,{icon:"speed",label:"Rate/quota",value:s.rateLimit||0,hint:`${c(i)} rate-limit/quota`,tone:s.rateLimit?"amber":"green"})]}),(0,n.jsx)("div",{className:"rounded-2xl border border-blue-500/20 bg-blue-500/10 p-4 text-sm text-blue-700 dark:text-blue-300",children:(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"rule_settings"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:"Ph\xe2n loại lỗi đ\xe3 t\xe1ch client khỏi server/provider"}),(0,n.jsxs)("div",{className:"mt-1 opacity-90",children:["Cảnh b\xe1o vận h\xe0nh n\xean ưu ti\xean nh\xf3m ",(0,n.jsx)("b",{children:"Server/provider"})," gồm gateway, upstream, timeout, network v\xe0 5xx. Nh\xf3m ",(0,n.jsx)("b",{children:"Client/request"})," vẫn được log đầy đủ nhưng thường l\xe0 sai endpoint, model, auth, JSON/body hoặc context."]})]})]})}),e.anomalies?.length?(0,n.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:e.anomalies.map((e,t)=>(0,n.jsx)(_,{anomaly:e},t))}):(0,n.jsxs)("div",{className:"rounded-2xl border border-green-500/20 bg-green-500/10 p-4 text-sm text-green-700 dark:text-green-300",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-2 align-[-5px]",children:"check_circle"}),"Chưa ph\xe1t hiện bất thường server/provider r\xf5 r\xe0ng theo bộ lọc hiện tại."]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Lỗi server/provider cần xử l\xfd"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Chỉ gồm gateway/upstream/server-impacting errors. Đ\xe2y l\xe0 bảng quan trọng nhất cho vận h\xe0nh."})]}),(0,n.jsxs)("span",{className:"rounded-full bg-red-500/10 px-3 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:[o(s.serverImpacting||0)," lỗi"]})]}),(0,n.jsx)(I,{rows:t.topServerErrors||[],columns:d,empty:"Kh\xf4ng c\xf3 lỗi server/provider trong khoảng lọc."})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Lỗi client/request sai"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Sai endpoint, model, auth, JSON/body, context length. D\xf9ng để hướng dẫn client sửa request."})]}),(0,n.jsx)(I,{rows:t.topClientErrors||[],columns:d.filter(e=>!["sampleMessage"].includes(e.key)),empty:"Kh\xf4ng c\xf3 lỗi client/request trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Ph\xe2n bố loại lỗi"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xe1ch nguồn chịu tr\xe1ch nhiệm để kh\xf4ng nhầm lỗi client th\xe0nh lỗi server."})]}),(0,n.jsx)(I,{rows:t.byFaultOwner||[],columns:[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner||e.key})},{key:"requests",label:"Số lỗi",render:e=>o(e.requests)},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 lỗi để ph\xe2n loại."})]})]}),t.topRateLimitErrors?.length?(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Rate limit / quota"}),(0,n.jsx)(I,{rows:t.topRateLimitErrors||[],columns:d})]}):null,(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Tất cả lỗi raw theo status/provider/model/endpoint"}),(0,n.jsx)(I,{rows:[...e.groups?.errors||[]].sort((e,t)=>new Date(p(t.lastSeen)||0)-new Date(p(e.lastSeen)||0)||Number(t.errors||t.requests||0)-Number(e.errors||e.requests||0)),columns:[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner})},{key:"status",label:"Status",render:e=>(0,n.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:e.status})},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"requests",label:"Lỗi",render:e=>o(e.errors||e.requests)},{key:"apiKey",label:"API key",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.apiKey})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Status distribution"}),(0,n.jsx)(I,{rows:e.groups?.statuses||[],columns:[{key:"label",label:"Status"},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]})]})}function Y({data:e}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top request nặng token"}),(0,n.jsx)(I,{rows:e.heavyRequests||[],columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"apiKeyName",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:e.apiKeyName}),(0,n.jsx)("div",{className:"font-mono text-xs text-text-muted",children:e.apiKeyFingerprint})]})},{key:"accountName",label:"Account"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"status",label:"Status"}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Recent usage"}),(0,n.jsx)(I,{rows:e.recentUsage||[],columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"apiKeyName",label:"API key"},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"status",label:"Status"}]})]})]})}function J(){let{isAdmin:e,isMonitorAdmin:t,isAiGatewaysMonitor:s}=(0,l.s)(),[a,o]=(0,r.useState)({period:"today",dateFrom:"",dateTo:"",provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:"",clientIp:"",sourceTool:"",sessionId:"",keyword:""}),[d,c]=(0,r.useState)(null),[x,m]=(0,r.useState)(!0),[u,h]=(0,r.useState)(""),[p,g]=(0,r.useState)("overview"),y=function(e,t=450){let[s,n]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let s=setTimeout(()=>n(e),t);return()=>clearTimeout(s)},[e,t]),s}(a,450),N=(0,r.useRef)(0),f=(0,r.useCallback)(async({clear:e=!1,filtersOverride:t=null}={})=>{let s=N.current+1;N.current=s,e&&c(null),m(!0),h("");try{let e=t||y,n=k(e,{timeZone:v()}),r=await fetch(`/api/dashboard/analytics?${n}`,{cache:"no-store"}),l=await r.json().catch(()=>({}));if(s!==N.current)return;if(!r.ok)throw Error(l.error||"Kh\xf4ng tải được dữ liệu analytics");c(l)}catch(e){if(s!==N.current)return;h(e.message||"Kh\xf4ng tải được dữ liệu analytics")}finally{s===N.current&&m(!1)}},[y]);(0,r.useEffect)(()=>{f({clear:!0})},[f]);let T=d?.options||{},w=(0,r.useMemo)(()=>d?.generatedAt?b(d.generatedAt):"-",[d]);return(0,n.jsxs)("div",{className:"space-y-5 p-4 md:p-6",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-primary",children:[(0,n.jsx)("span",{className:"material-symbols-outlined",children:"monitoring"}),(0,n.jsx)("span",{className:"text-sm font-semibold uppercase tracking-wide",children:"BlueRouter Analytics"})]}),(0,n.jsx)("h1",{className:"mt-2 text-2xl font-bold text-text-main",children:"Thống k\xea sử dụng Gateway"}),(0,n.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-text-muted",children:"Theo d\xf5i tần suất request, input/output token, API key, provider, model, endpoint, Source IP, source tool v\xe0 lỗi vận h\xe0nh."})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-surface px-4 py-3 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"schedule"}),(0,n.jsxs)("div",{children:["Generated: ",w]})]})]}),(0,n.jsx)(H,{filters:a,setFilters:o,options:T,onRefresh:e=>f({filtersOverride:e||a}),onExportCsv:()=>{let e=k(a,{format:"csv",timeZone:v()});window.open(`/api/dashboard/analytics?${e}`,"_blank","noopener,noreferrer")},loading:x,showProviderFilters:e||t||s}),u?(0,n.jsxs)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4 text-sm text-red-700 dark:text-red-300",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-2 align-[-5px]",children:"error"}),u]}):null,d?.qualityNotes?.length?(0,n.jsx)(U,{notes:d.qualityNotes}):null,(0,n.jsx)("div",{className:"flex flex-wrap gap-2 rounded-2xl border border-border bg-surface p-2",children:i.map(e=>(0,n.jsxs)("button",{onClick:()=>g(e.value),className:j("flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition",p===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-background hover:text-text-main"),children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon}),e.label]},e.value))}),x&&!d?(0,n.jsx)(q,{}):null,!x&&d&&d.overview?.requests===0&&0===(d.promptLogs?.total||0)?(0,n.jsx)(P,{title:"Chưa c\xf3 dữ liệu analytics",description:"Kh\xf4ng c\xf3 UsageHistory hoặc Prompt Logs theo bộ lọc hiện tại."}):null,d?(0,n.jsxs)(n.Fragment,{children:["overview"===p?(0,n.jsx)(D,{data:d}):null,"apiKeys"===p?(0,n.jsx)(G,{data:d}):null,"clients"===p?(0,n.jsx)(B,{data:d}):null,"sources"===p?(0,n.jsx)(z,{data:d}):null,"providers"===p?(0,n.jsx)(W,{data:d}):null,"experience"===p?(0,n.jsx)(X,{data:d}):null,"errors"===p?(0,n.jsx)(Z,{data:d}):null,"raw"===p?(0,n.jsx)(Y,{data:d}):null]}):null]})}},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},94027:(e,t,s)=>{"use strict";s.d(t,{Y:()=>o,s:()=>d});var n=s(95155),r=s(12115),l=s(14051),a=s.n(l);let i=(0,r.createContext)(null);function o({children:e}){let[t,s]=(0,r.useState)(null),[l,a]=(0,r.useState)(!0),[d,c]=(0,r.useState)(""),x=(0,r.useCallback)(async()=>{a(!0),c("");try{let e=await fetch("/api/auth/status",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t?.error||"Kh\xf4ng tải được trạng th\xe1i đăng nhập");return s(t||{}),t||{}}catch(e){return c(e?.message||"Kh\xf4ng tải được trạng th\xe1i đăng nhập"),s({}),{}}finally{a(!1)}},[]);(0,r.useEffect)(()=>{let e=!1;return(async()=>{a(!0),c("");try{let t=await fetch("/api/auth/status",{cache:"no-store"}),n=await t.json().catch(()=>({}));if(e)return;if(!t.ok)throw Error(n?.error||"Kh\xf4ng tải được trạng th\xe1i đăng nhập");s(n||{})}catch(t){e||(c(t?.message||"Kh\xf4ng tải được trạng th\xe1i đăng nhập"),s({}))}finally{e||a(!1)}})(),()=>{e=!0}},[]);let m=(0,r.useMemo)(()=>{let e,s,n,r,l;return s=(e=t&&"object"==typeof t?t:{}).displayName||e.oidcName||e.oidcEmail||e.userId||"",n=!0===e.isAdmin,r=!0===e.isMonitorAdmin,l=!0===e.isAiGatewaysMonitor,{status:e,displayName:s,userId:e.userId||"",loginMethod:e.loginMethod||"",role:e.role||"guest",isAdmin:n,isMonitorAdmin:r,isAiGatewaysMonitor:l,canManageApiKeys:!0===e.canManageApiKeys||n||r,canUseMonitorAdminTabs:!0===e.canUseMonitorAdminTabs||n||r,canViewAllAnalytics:!0===e.canViewAllAnalytics||n||r||l}},[t]),u=(0,r.useMemo)(()=>({...m,loading:l,error:d,reload:x}),[m,l,d,x]);return(0,n.jsx)(i.Provider,{value:u,children:e})}function d(){let e=(0,r.useContext)(i);return e||{status:{},displayName:"",userId:"",loginMethod:"",role:"admin",isAdmin:!0,isMonitorAdmin:!1,isAiGatewaysMonitor:!1,canManageApiKeys:!0,canUseMonitorAdminTabs:!0,canViewAllAnalytics:!0,loading:!1,error:"",reload:async()=>({})}}o.propTypes={children:a().node}}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=39944)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-7955be4ef5b827d6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{2276:(e,s,a)=>{Promise.resolve().then(a.bind(a,55987))},55987:(e,s,a)=>{"use strict";a.d(s,{default:()=>x});var t=a(95155),l=a(12115),r=a(3534),o=a(28777),n=a(52679),i=a(61082),d=a(35497);let c={enabled:!1,type:"mysql",host:"",port:"",database:"",username:"",password:"",ssl:!1,createDatabase:!1,logClientRequest:!0,logSourceRequest:!0,logTargetRequest:!0,logProviderResponse:!1,logErrors:!0,retentionDays:30};function g({label:e,value:s,onChange:a,type:l="text",placeholder:r="",disabled:o=!1}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e}),(0,t.jsx)("input",{type:l,value:s||"",placeholder:r,disabled:o,onChange:e=>a(e.target.value),className:"w-full rounded border border-border bg-surface px-2 py-1.5 text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]})}function u({label:e,checked:s,onChange:a,disabled:l=!1}){return(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-text-main",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!s,disabled:l,onChange:e=>a(e.target.checked)}),e]})}function p(){let[e,s]=(0,l.useState)(c),[a,r]=(0,l.useState)(!1),[o,n]=(0,l.useState)(null),[i,p]=(0,l.useState)(null),x=e=>s(s=>({...s,...e})),b=async()=>{r(!0),p(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/prompt-log-db"),a=await e.json();if(!e.ok)throw Error(a.error||"Failed to load config");s({...c,...a.config||{}})}catch(e){p(e.message||"Failed to load config")}finally{r(!1)}};(0,l.useEffect)(()=>{b()},[]);let h=async()=>{r(!0),p(null),n(null);try{let a=await fetch("/api/cli-tools/antigravity-mitm/prompt-log-db",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e})}),t=await a.json();if(!a.ok)throw Error(t.error||"Failed to save config");s({...c,...t.config||{}}),n("Saved")}catch(e){p(e.message||"Failed to save config")}finally{r(!1)}},m=async s=>{r(!0),p(null),n(null);try{let a=await fetch("/api/cli-tools/antigravity-mitm/prompt-log-db",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,config:e})}),t=await a.json();if(!a.ok)throw Error(t.error||"Action failed");n(t.message||t.init?.message||"OK")}catch(e){p(e.message||"Action failed")}finally{r(!1)}},y="postgres"===e.type||"mysql"===e.type;return(0,t.jsx)(d.Zp,{title:"Prompt Log Database",subtitle:"Store MITM/Copilot prompt logs in a queryable database",icon:"database",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(d.Ex,{variant:e.enabled?"success":"default",children:e.enabled?"Enabled":"Disabled"}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"File logs still remain available under DATA_DIR/logs/requests."})]}),(0,t.jsx)("div",{className:"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-3 text-xs text-yellow-700 dark:text-yellow-300",children:'Prompt logs may contain source code, selected code, internal URLs, user prompts, and provider responses. Checked stages store full raw JSON; prompt/response text columns keep only short previews. Per-combo "hide content" still redacts raw JSON.'}),(0,t.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:"Database type"}),(0,t.jsxs)("select",{value:e.type,disabled:a,onChange:s=>{let a=s.target.value;x({type:a,port:"postgres"===a?e.port||"5432":"mysql"===a?e.port||"3306":e.port})},className:"w-full rounded border border-border bg-surface px-2 py-1.5 text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,t.jsx)("option",{value:"mysql",children:"MySQL / MariaDB"}),(0,t.jsx)("option",{value:"postgres",children:"PostgreSQL"})]})]}),(0,t.jsx)(g,{label:"Retention days",type:"number",value:String(e.retentionDays||30),onChange:e=>x({retentionDays:Number(e)||30}),disabled:a})]}),y&&(0,t.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,t.jsx)(g,{label:"Host",value:e.host,placeholder:"127.0.0.1",onChange:e=>x({host:e}),disabled:a}),(0,t.jsx)(g,{label:"Port",value:e.port,placeholder:"postgres"===e.type?"5432":"3306",onChange:e=>x({port:e}),disabled:a}),(0,t.jsx)(g,{label:"Database",value:e.database,placeholder:"bluerouter_logs",onChange:e=>x({database:e}),disabled:a}),(0,t.jsx)(g,{label:"Username",value:e.username,placeholder:"bluerouter",onChange:e=>x({username:e}),disabled:a}),(0,t.jsx)(g,{label:"Password",type:"password",value:e.password,placeholder:"Leave as ******** to keep existing password",onChange:e=>x({password:e}),disabled:a}),(0,t.jsxs)("div",{className:"flex flex-col justify-end gap-2",children:[(0,t.jsx)(u,{label:"Use SSL",checked:e.ssl,onChange:e=>x({ssl:e}),disabled:a}),(0,t.jsx)(u,{label:"Create database if missing",checked:e.createDatabase,onChange:e=>x({createDatabase:e}),disabled:a})]})]}),(0,t.jsxs)("div",{className:"grid gap-2 rounded-lg border border-border bg-surface/40 p-3 md:grid-cols-2",children:[(0,t.jsx)(u,{label:"Enable database prompt logging",checked:e.enabled,onChange:e=>x({enabled:e}),disabled:a}),(0,t.jsx)(u,{label:"Log client request JSON",checked:e.logClientRequest,onChange:e=>x({logClientRequest:e}),disabled:a}),(0,t.jsx)(u,{label:"Log normalized/source request JSON",checked:e.logSourceRequest,onChange:e=>x({logSourceRequest:e}),disabled:a}),(0,t.jsx)(u,{label:"Log target/provider request JSON",checked:e.logTargetRequest,onChange:e=>x({logTargetRequest:e}),disabled:a}),(0,t.jsx)(u,{label:"Log provider response JSON",checked:e.logProviderResponse,onChange:e=>x({logProviderResponse:e}),disabled:a}),(0,t.jsx)(u,{label:"Log errors",checked:e.logErrors,onChange:e=>x({logErrors:e}),disabled:a})]}),y&&(0,t.jsxs)("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/10 p-3 text-xs text-blue-700 dark:text-blue-300",children:["Prompt logs now support MySQL/MariaDB and PostgreSQL only. MySQL/MariaDB requires ",(0,t.jsx)("code",{children:"mysql2"}),"; PostgreSQL requires ",(0,t.jsx)("code",{children:"pg"}),"."]}),o&&(0,t.jsx)("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 p-2 text-xs text-green-600",children:o}),i&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 p-2 text-xs text-red-500",children:i}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.$n,{size:"sm",variant:"secondary",onClick:b,loading:a,children:"Reload"}),(0,t.jsx)(d.$n,{size:"sm",variant:"secondary",onClick:()=>m("test"),loading:a,children:"Test connection"}),(0,t.jsx)(d.$n,{size:"sm",variant:"secondary",onClick:()=>m("init"),loading:a,children:"Initialize schema"}),(0,t.jsx)(d.$n,{size:"sm",onClick:h,loading:a,children:"Save"}),(0,t.jsx)(d.$n,{size:"sm",variant:"success",onClick:()=>m("save-and-init"),loading:a,children:"Save & initialize"})]})]})})}function x(){let[e,s]=(0,l.useState)([]),[a,d]=(0,l.useState)([]),[c,g]=(0,l.useState)({}),[u,x]=(0,l.useState)(!1),[b,h]=(0,l.useState)(null),[m,y]=(0,l.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,l.useEffect)(()=>{f(),v(),j(),w()},[]);let f=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let a=await e.json();s(a.connections||[])}}catch{}},v=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},j=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();g(s.aliases||{})}}catch{}},w=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();x(s.cloudEnabled||!1)}}catch{}},S=()=>e.filter(e=>!1!==e.isActive),C=Object.entries(r.wn);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-4 text-sm text-yellow-700 dark:text-yellow-300",children:[(0,t.jsx)("span",{className:"material-symbols-rounded align-middle text-base",children:"warning"})," ","⚠️ MITM intercepts HTTPS traffic of IDE tools (Antigravity, GitHub Copilot, Kiro) via local CA to redirect requests to your providers. May violate ToS → account ban. Use at your own risk."]}),(0,t.jsx)(i.tA,{apiKeys:a,cloudEnabled:u,onStatusChange:y}),(0,t.jsx)(i.k0,{serverRunning:m.running,onChanged:e=>y(s=>({...s,certExists:e?.certExists??s.certExists}))}),(0,t.jsx)(p,{}),C.map(([e,s])=>(0,t.jsx)(i.kn,{tool:{...s,id:e},isExpanded:b===e,onToggle:()=>h(b===e?null:e),serverRunning:m.running,dnsActive:m.dnsStatus?.[e]||!1,hasCachedPassword:m.hasCachedPassword||!1,needsSudoPassword:!1!==m.needsSudoPassword,isWin:!0===m.isWin,apiKeys:a,activeProviders:S(),hasActiveProviders:S().some(e=>(0,o.KC)(e.provider).length>0||(0,n.mq)(e.provider)||(0,n.gb)(e.provider)),modelAliases:c,cloudEnabled:u,onDnsChange:e=>y(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))]})}}},e=>{e.O(0,[2574,3862,246,4546,5772,5564,5263,5497,4525,8441,3794,7358],()=>e(e.s=2276)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-90f89d4fa21e857a.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{7973:(e,a,t)=>{Promise.resolve().then(t.bind(t,64561))},14051:(e,a,t)=>{e.exports=t(34701)()},34701:(e,a,t)=>{"use strict";var s=t(82114);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,a,t,r,l,o){if(o!==s){var i=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 i.name="Invariant Violation",i}}function a(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:l,resetWarningCache:r};return t.PropTypes=t,t}},44656:(e,a,t)=>{"use strict";t.d(a,{BrandingProvider:()=>p,notifyBrandingChanged:()=>c,useBranding:()=>u});var s=t(95155),r=t(12115),l=t(14051),o=t.n(l);let i={siteTitle:"",siteShortName:"",siteDescription:"",logoUrl:null,faviconUrl:null,logoMime:null,faviconMime:null,hasLogo:!1,hasFavicon:!1},n=(0,r.createContext)({...i,loading:!0,refresh:async()=>{}}),d="bluerouter:branding-updated";function c(){window.dispatchEvent(new CustomEvent(d))}function p({initialBranding:e,children:a}){let[t,l]=(0,r.useState)(e||i),[o,c]=(0,r.useState)(!e),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/branding",{cache:"no-store"});if(!e.ok)return;let a=await e.json();l({...i,...a})}catch{}finally{c(!1)}},[]);(0,r.useEffect)(()=>{u()},[u]),(0,r.useEffect)(()=>{let e=()=>u();return window.addEventListener(d,e),()=>window.removeEventListener(d,e)},[u]);let m=(0,r.useMemo)(()=>({...t,loading:o,refresh:u}),[t,o,u]);return(0,s.jsx)(n.Provider,{value:m,children:a})}function u(){return(0,r.useContext)(n)}p.propTypes={initialBranding:o().object,children:o().node}},64561:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>b});var s=t(95155),r=t(12115),l=t(44656);let o="(|(sAMAccountName={{username}})(userPrincipalName={{username}})(mail={{username}}))",i="image/svg+xml,image/png,image/webp,image/jpeg,image/gif",n=`${i},image/x-icon,image/vnd.microsoft.icon,.ico`;function d({status:e}){if(!e?.message)return null;let a="error"===e.type?"text-red-600 bg-red-50 border-red-200":"text-green-700 bg-green-50 border-green-200";return(0,s.jsx)("div",{className:`mt-3 rounded-xl border px-4 py-3 text-sm ${a}`,children:e.message})}function c({icon:e,title:a,desc:t,children:r}){return(0,s.jsxs)("section",{className:"rounded-2xl border border-border bg-surface p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"mb-5 flex items-start gap-3",children:[e&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:e}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-text-main",children:a}),t&&(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:t})]})]}),r]})}function p({label:e,hint:a,children:t}){return(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"mb-1 block text-sm font-semibold text-text-main",children:e}),t,a&&(0,s.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:a})]})}function u(e){return(0,s.jsx)("input",{...e,className:`w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary ${e.className||""}`})}function m(e){return(0,s.jsx)("textarea",{...e,className:`w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary ${e.className||""}`})}function x({title:e,desc:a,checked:t,onChange:r,disabled:l}){return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-xl border border-border bg-background px-4 py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-text-main",children:e}),a&&(0,s.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:a})]}),(0,s.jsx)("button",{type:"button",disabled:l,onClick:()=>r(!t),className:`relative mt-0.5 h-6 w-11 rounded-full transition disabled:opacity-50 ${t?"bg-primary":"bg-border"}`,children:(0,s.jsx)("span",{className:`absolute top-0.5 h-5 w-5 rounded-full bg-white transition ${t?"left-5":"left-0.5"}`})})]})}function b(){let[e,a]=(0,r.useState)({}),[t,b]=(0,r.useState)(!0),[h,g]=(0,r.useState)({current:"",new:"",confirm:""}),[y,f]=(0,r.useState)({type:"",message:""}),[v,w]=(0,r.useState)(!1),[j,D]=(0,r.useState)(!1),[N,A]=(0,r.useState)({type:"",message:""}),C=(0,r.useRef)(null),[U,S]=(0,r.useState)("admin"),[L,k]=(0,r.useState)({type:"",message:""}),[P,G]=(0,r.useState)({ldapEnabled:!1,ldapUrl:"",ldapBindDn:"",ldapBindPassword:"",ldapUserBaseDn:"",ldapUserSearchFilter:o,ldapUserNameAttribute:"sAMAccountName",ldapUserDisplayAttribute:"displayName",ldapUserEmailAttribute:"mail",ldapLoginAllowedGroupDn:"",ldapAdminGroupDn:"",ldapMonitorAdminGroupDn:"",ldapAiGatewaysMonitorsGroupDn:"",ldapNestedGroups:!0,ldapAllowedUsers:[],ldapTlsRejectUnauthorized:!0,ldapConnectTimeoutMs:8e3}),[I,O]=(0,r.useState)({type:"",message:""}),[B,E]=(0,r.useState)(!1),[M,T]=(0,r.useState)(!1),[R,F]=(0,r.useState)(""),[_,$]=(0,r.useState)([]),[V,z]=(0,r.useState)(!1),[W,q]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[J,H]=(0,r.useState)(""),[K,Q]=(0,r.useState)({type:"",message:""}),[Y,X]=(0,r.useState)(!1),[Z,ee]=(0,r.useState)(!1),[ea,et]=(0,r.useState)({type:"",message:""}),es=(0,l.useBranding)(),[er,el]=(0,r.useState)(""),[eo,ei]=(0,r.useState)(""),[en,ed]=(0,r.useState)(""),[ec,ep]=(0,r.useState)({type:"",message:""}),[eu,em]=(0,r.useState)(!1),[ex,eb]=(0,r.useState)(!1),[eh,eg]=(0,r.useState)(!1),[ey,ef]=(0,r.useState)(!1),ev=(0,r.useRef)(null),ew=(0,r.useRef)(null),ej=async()=>{b(!0);try{let e=await fetch("/api/settings",{cache:"no-store"}),t=await e.json();a(t),S(t.localLoginUsername||"admin"),G({ldapEnabled:!0===t.ldapEnabled,ldapUrl:t.ldapUrl||"",ldapBindDn:t.ldapBindDn||"",ldapBindPassword:"",ldapUserBaseDn:t.ldapUserBaseDn||t.ldapBaseDn||"",ldapUserSearchFilter:t.ldapUserSearchFilter||o,ldapUserNameAttribute:t.ldapUserNameAttribute||"sAMAccountName",ldapUserDisplayAttribute:t.ldapUserDisplayAttribute||"displayName",ldapUserEmailAttribute:t.ldapUserEmailAttribute||"mail",ldapLoginAllowedGroupDn:t.ldapLoginAllowedGroupDn||"",ldapAdminGroupDn:t.ldapAdminGroupDn||"",ldapMonitorAdminGroupDn:t.ldapMonitorAdminGroupDn||"",ldapAiGatewaysMonitorsGroupDn:t.ldapAiGatewaysMonitorsGroupDn||"",ldapNestedGroups:!1!==t.ldapNestedGroups,ldapAllowedUsers:Array.isArray(t.ldapAllowedUsers)?t.ldapAllowedUsers:[],ldapTlsRejectUnauthorized:!1!==t.ldapTlsRejectUnauthorized,ldapConnectTimeoutMs:t.ldapConnectTimeoutMs||8e3}),q({authMode:t.authMode||"password",oidcIssuerUrl:t.oidcIssuerUrl||"",oidcClientId:t.oidcClientId||"",oidcScopes:t.oidcScopes||"openid profile email",oidcLoginLabel:t.oidcLoginLabel||"Sign in with OIDC"}),el(t.siteTitle||""),ei(t.siteShortName||""),ed(t.siteDescription||""),("oidc"===t.authMode||"both"===t.authMode)&&ee(!0)}catch(e){console.log("Failed to fetch settings:",e)}finally{b(!1)}};(0,r.useEffect)(()=>{ej()},[]);let eD=async e=>{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Failed to save settings");return a(e=>({...e,...s})),s},eN=async t=>{et({type:"",message:""});let s=!1!==e.sidebarAdvancedToolsVisible;a(e=>({...e,sidebarAdvancedToolsVisible:t}));try{let e=await eD({sidebarAdvancedToolsVisible:t}),s=!1!==e.sidebarAdvancedToolsVisible;a(e=>({...e,sidebarAdvancedToolsVisible:s})),window.dispatchEvent(new CustomEvent("bluerouter:sidebar-advanced-tools",{detail:{visible:s}})),et({type:"success",message:s?"Advanced tools are visible in the sidebar.":"Advanced tools are hidden from the sidebar."})}catch(e){a(e=>({...e,sidebarAdvancedToolsVisible:s})),window.dispatchEvent(new CustomEvent("bluerouter:sidebar-advanced-tools",{detail:{visible:s}})),et({type:"error",message:e.message||"Failed to save sidebar setting."})}},eA=async e=>{e.preventDefault(),k({type:"",message:""});try{let e=await eD({localLoginUsername:U});S(e.localLoginUsername||U||"admin"),k({type:"success",message:"Local account name saved."})}catch(e){k({type:"error",message:e.message})}},eC=async e=>{if(e.preventDefault(),h.new!==h.confirm)return void f({type:"error",message:"Passwords do not match"});w(!0),f({type:"",message:""});try{await eD({currentPassword:h.current,newPassword:h.new}),f({type:"success",message:"Password updated successfully"}),g({current:"",new:"",confirm:""})}catch(e){f({type:"error",message:e.message||"Failed to update password"})}finally{w(!1)}},eU=async()=>{D(!0),A({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(a.error||"Failed to export database")}let a=await e.json(),t=JSON.stringify(a,null,2),s=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(s),l=document.createElement("a"),o=new Date().toISOString().replace(/[.:]/g,"-");l.href=r,l.download=`bluerouter-backup-${o}.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(r),A({type:"success",message:"Database backup downloaded."})}catch(e){A({type:"error",message:e.message||"Failed to export database."})}finally{D(!1)}},eS=async e=>{let a=e.target.files?.[0];if(a){D(!0),A({type:"",message:""});try{let e=await a.text(),t=JSON.parse(e),s=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await s.json().catch(()=>({}));if(!s.ok)throw Error(r.error||"Failed to import database");await ej(),A({type:"success",message:"Database imported successfully."})}catch(e){A({type:"error",message:e.message||"Invalid backup file."})}finally{C.current&&(C.current.value=""),D(!1)}}},eL=(e,a)=>G(t=>({...t,[e]:a})),ek=async e=>{e?.preventDefault?.(),E(!0),O({type:"",message:""});try{let e={...P,ldapBaseDn:P.ldapUserBaseDn,ldapAllowedUsers:P.ldapAllowedUsers};e.ldapBindPassword||delete e.ldapBindPassword;let a=await eD(e);G(e=>({...e,ldapBindPassword:"",ldapEnabled:!0===a.ldapEnabled,ldapUserBaseDn:a.ldapUserBaseDn||a.ldapBaseDn||e.ldapUserBaseDn,ldapLoginAllowedGroupDn:a.ldapLoginAllowedGroupDn||"",ldapAdminGroupDn:a.ldapAdminGroupDn||"",ldapMonitorAdminGroupDn:a.ldapMonitorAdminGroupDn||"",ldapAiGatewaysMonitorsGroupDn:a.ldapAiGatewaysMonitorsGroupDn||"",ldapNestedGroups:!1!==a.ldapNestedGroups,ldapAllowedUsers:Array.isArray(a.ldapAllowedUsers)?a.ldapAllowedUsers:e.ldapAllowedUsers})),O({type:"success",message:"LDAP settings saved."})}catch(e){O({type:"error",message:e.message||"Failed to save LDAP settings"})}finally{E(!1)}},eP=async()=>{T(!0),O({type:"",message:""});try{await ek();let e=await fetch("/api/auth/ldap/test",{method:"POST"}),a=await e.json().catch(()=>({}));e.ok&&a.ok?O({type:"success",message:a.message||"LDAP connection OK."}):O({type:"error",message:a.error||"LDAP test failed."})}catch(e){O({type:"error",message:e.message||"LDAP test failed."})}finally{T(!1)}},eG=async()=>{z(!0),O({type:"",message:""});try{await ek();let e=await fetch(`/api/auth/ldap/users?q=${encodeURIComponent(R)}`,{cache:"no-store"}),a=await e.json().catch(()=>({}));e.ok?($(a.users||[]),O({type:"success",message:`Loaded ${(a.users||[]).length} LDAP user(s).`})):O({type:"error",message:a.error||"Failed to load LDAP users."})}catch(e){O({type:"error",message:e.message||"Failed to load LDAP users."})}finally{z(!1)}},eI=e=>{let a=String(e||"").trim();a&&G(e=>{let t=new Set(e.ldapAllowedUsers||[]);return t.has(a)?t.delete(a):t.add(a),{...e,ldapAllowedUsers:[...t]}})},eO=async(a=W.authMode||"password")=>{let t=W.oidcIssuerUrl.trim(),s=W.oidcClientId.trim(),r=W.oidcScopes.trim(),l=W.oidcLoginLabel.trim(),o=J.trim();if("password"!==a&&(!t||!s||!o)&&!e.oidcConfigured)return void Q({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});X(!0),Q({type:"",message:""});try{let e={authMode:a,oidcIssuerUrl:t,oidcClientId:s,oidcScopes:r||"openid profile email",oidcLoginLabel:l||"Sign in with OIDC"};o&&(e.oidcClientSecret=o);let i=await eD(e);q({authMode:i.authMode||a,oidcIssuerUrl:i.oidcIssuerUrl||t,oidcClientId:i.oidcClientId||s,oidcScopes:i.oidcScopes||r||"openid profile email",oidcLoginLabel:i.oidcLoginLabel||l||"Sign in with OIDC"}),H(""),Q({type:"success",message:"OIDC settings saved."})}catch(e){Q({type:"error",message:e.message||"Failed to save OIDC settings"})}finally{X(!1)}},eB=async(e,a)=>{if(!a)return;if(a.size>1048576)return void ep({type:"error",message:"File exceeds 1 MB limit."});let t="logo"===e?eb:eg;t(!0),ep({type:"",message:""});try{let t=new FormData;t.append("asset",e),t.append("file",a);let s=await fetch("/api/branding/upload",{method:"POST",body:t}),r=await s.json().catch(()=>({}));if(!s.ok)throw Error(r.error||"Upload failed");(0,l.notifyBrandingChanged)(),ep({type:"success",message:`${"logo"===e?"Logo":"Favicon"} uploaded.`})}catch(e){ep({type:"error",message:e.message||"Upload failed."})}finally{t(!1)}},eE=async e=>{let a=e.target.files?.[0];await eB("logo",a),ev.current&&(ev.current.value="")},eM=async e=>{let a=e.target.files?.[0];await eB("favicon",a),ew.current&&(ew.current.value="")},eT=async e=>{e.preventDefault(),em(!0),ep({type:"",message:""});try{await eD({siteTitle:er.trim(),siteShortName:eo.trim(),siteDescription:en.trim()}),(0,l.notifyBrandingChanged)(),ep({type:"success",message:"Branding text saved."})}catch(e){ep({type:"error",message:e.message||"Failed to save branding."})}finally{em(!1)}},eR=async e=>{ep({type:"",message:""});try{let a=await fetch(`/api/branding?asset=${e}`,{method:"DELETE"}),t=await a.json().catch(()=>({}));if(!a.ok)throw Error(t.error||"Failed to remove asset");(0,l.notifyBrandingChanged)(),ep({type:"success",message:`${"logo"===e?"Logo":"Favicon"} removed.`})}catch(e){ep({type:"error",message:e.message||"Failed to remove asset."})}},eF=async()=>{ef(!0),ep({type:"",message:""});try{let e=await fetch("/api/branding",{method:"DELETE"});if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(a.error||"Failed to reset branding")}await eD({siteTitle:"",siteShortName:"",siteDescription:""}),el(""),ei(""),ed(""),(0,l.notifyBrandingChanged)(),ep({type:"success",message:"Branding reset to defaults."})}catch(e){ep({type:"error",message:e.message||"Failed to reset branding."})}finally{ef(!1)}};return t?(0,s.jsx)("div",{className:"p-8 text-text-muted",children:"Loading settings..."}):(0,s.jsxs)("div",{className:"mx-auto max-w-6xl space-y-6 p-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-text-main",children:"Settings"}),(0,s.jsx)("p",{className:"mt-1 text-text-muted",children:"Configure local dashboard login, LDAP/Active Directory login, and OIDC login."})]}),(0,s.jsxs)(c,{icon:"view_sidebar",title:"Sidebar tools",desc:"Show or hide advanced dashboard tools to keep the sidebar clean.",children:[(0,s.jsx)(x,{title:"Show Advanced tools",desc:"When disabled, Media / Web, AI Traffic Gateway, CLI Tools, Proxy Pools, Skills, Console Log and Translator are hidden from the sidebar. Core admin pages remain visible.",checked:!1!==e.sidebarAdvancedToolsVisible,onChange:eN}),(0,s.jsx)(d,{status:ea})]}),(0,s.jsxs)(c,{icon:"palette",title:"Branding",desc:"Customize site title, logo and favicon shown in the dashboard, browser tab and login page. Max 1 MB per file.",children:[(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-sm font-semibold text-text-main",children:"Logo"}),(0,s.jsxs)("div",{className:"flex items-center gap-4 rounded-xl border border-border bg-background p-4",children:[(0,s.jsx)("div",{className:"flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-surface",children:es?.logoUrl?(0,s.jsx)("img",{src:es.logoUrl,alt:"Current logo",className:"max-h-full max-w-full object-contain"}):(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:"hub"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Shown in the dashboard sidebar and login page. SVG, PNG, WebP, JPEG, GIF."}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",disabled:ex,onClick:()=>ev.current?.click(),className:"rounded-xl bg-primary px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50",children:ex?"Uploading...":es?.logoUrl?"Replace logo":"Upload logo"}),es?.logoUrl?(0,s.jsx)("button",{type:"button",onClick:()=>eR("logo"),className:"rounded-xl border border-border px-3 py-1.5 text-xs font-semibold text-text-main hover:border-red-300 hover:text-red-600",children:"Remove"}):null]})]}),(0,s.jsx)("input",{ref:ev,type:"file",accept:i,className:"hidden",onChange:eE})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-sm font-semibold text-text-main",children:"Favicon"}),(0,s.jsxs)("div",{className:"flex items-center gap-4 rounded-xl border border-border bg-background p-4",children:[(0,s.jsx)("div",{className:"flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-surface",children:es?.faviconUrl?(0,s.jsx)("img",{src:es.faviconUrl,alt:"Current favicon",className:"max-h-10 max-w-10 object-contain"}):(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:"public"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Shown in the browser tab. ICO, SVG, PNG, WebP, JPEG, GIF."}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",disabled:eh,onClick:()=>ew.current?.click(),className:"rounded-xl bg-primary px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50",children:eh?"Uploading...":es?.faviconUrl?"Replace favicon":"Upload favicon"}),es?.faviconUrl?(0,s.jsx)("button",{type:"button",onClick:()=>eR("favicon"),className:"rounded-xl border border-border px-3 py-1.5 text-xs font-semibold text-text-main hover:border-red-300 hover:text-red-600",children:"Remove"}):null]})]}),(0,s.jsx)("input",{ref:ew,type:"file",accept:n,className:"hidden",onChange:eM})]})]})]}),(0,s.jsxs)("form",{onSubmit:eT,className:"space-y-3",children:[(0,s.jsx)(p,{label:"Site title",hint:"Shown in browser tab and login page. Leave blank for default.",children:(0,s.jsx)(u,{value:er,onChange:e=>el(e.target.value),placeholder:"AI Router Gateway"})}),(0,s.jsx)(p,{label:"Company short name",hint:"Shown in dashboard sidebar and login hero text. Defaults to site title/sidebar default or 'Fujinet' on login.",children:(0,s.jsx)(u,{value:eo,onChange:e=>ei(e.target.value),placeholder:"Fujinet"})}),(0,s.jsx)(p,{label:"Description",hint:"Used for browser metadata.",children:(0,s.jsx)(m,{rows:3,value:en,onChange:e=>ed(e.target.value),placeholder:"AI Infrastructure Management"})}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"submit",disabled:eu,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white disabled:opacity-50",children:eu?"Saving...":"Save branding text"}),(0,s.jsx)("button",{type:"button",disabled:ey,onClick:eF,className:"rounded-xl border border-border px-4 py-2 text-sm font-semibold text-text-main hover:border-red-300 hover:text-red-600 disabled:opacity-50",children:ey?"Resetting...":"Reset to defaults"})]})]})]}),(0,s.jsx)(d,{status:ec})]}),(0,s.jsx)(c,{icon:"shield",title:"Dashboard Login",desc:"Local account remains available even when LDAP is enabled.",children:(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,s.jsxs)("form",{onSubmit:eA,className:"space-y-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-text-main",children:"Local account"}),(0,s.jsx)(p,{label:"Local username",children:(0,s.jsx)(u,{value:U,onChange:e=>S(e.target.value)})}),(0,s.jsx)("button",{className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white",children:"Save account"}),(0,s.jsx)(d,{status:L})]}),(0,s.jsxs)("form",{onSubmit:eC,className:"space-y-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-text-main",children:"Local password"}),e.hasPassword&&(0,s.jsx)(p,{label:"Current password",children:(0,s.jsx)(u,{type:"password",value:h.current,onChange:e=>g({...h,current:e.target.value}),required:!0})}),(0,s.jsx)(p,{label:"New password",children:(0,s.jsx)(u,{type:"password",value:h.new,onChange:e=>g({...h,new:e.target.value}),required:!0})}),(0,s.jsx)(p,{label:"Confirm password",children:(0,s.jsx)(u,{type:"password",value:h.confirm,onChange:e=>g({...h,confirm:e.target.value}),required:!0})}),(0,s.jsx)("button",{disabled:v,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white disabled:opacity-50",children:e.hasPassword?"Update Password":"Set Password"}),(0,s.jsx)(d,{status:y})]})]})}),(0,s.jsxs)(c,{icon:"database",title:"Database Backup",desc:"Export or restore the local bluerouter configuration database.",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("button",{onClick:eU,disabled:j,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white disabled:opacity-50",children:"Download Backup"}),(0,s.jsx)("button",{onClick:()=>C.current?.click(),disabled:j,className:"rounded-xl border border-border px-4 py-2 text-sm font-semibold text-text-main hover:border-primary/50 disabled:opacity-50",children:"Import Backup"}),(0,s.jsx)("input",{ref:C,type:"file",accept:"application/json",className:"hidden",onChange:eS})]}),(0,s.jsx)(d,{status:N})]}),(0,s.jsx)(c,{icon:"corporate_fare",title:"LDAP / Active Directory Login",desc:"Search users from a User Base DN, restrict login by group DN, and grant admin by group DN. The old Selected LDAP users list is kept as a manual admin list.",children:(0,s.jsxs)("form",{onSubmit:ek,className:"space-y-5",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:(0,s.jsx)("button",{type:"button",onClick:()=>eL("ldapEnabled",!P.ldapEnabled),className:`rounded-xl px-3 py-2 text-sm font-semibold ${P.ldapEnabled?"bg-primary text-white":"border border-border text-text-muted"}`,children:P.ldapEnabled?"Enabled":"Disabled"})}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(p,{label:"LDAP URL",children:(0,s.jsx)(u,{value:P.ldapUrl,onChange:e=>eL("ldapUrl",e.target.value),placeholder:"ldap://dc01.company.local:389"})}),(0,s.jsx)(p,{label:"LDAP User Base DN",hint:"OU/container/domain where user objects are searched. Do not use a group DN here.",children:(0,s.jsx)(u,{value:P.ldapUserBaseDn,onChange:e=>eL("ldapUserBaseDn",e.target.value),placeholder:"OU=Users,OU=xxx,DC=xx,DC=vn"})}),(0,s.jsx)(p,{label:"LDAP Bind DN",children:(0,s.jsx)(u,{value:P.ldapBindDn,onChange:e=>eL("ldapBindDn",e.target.value),placeholder:"CN=svc-bluerouter,OU=Service Accounts,DC=company,DC=local"})}),(0,s.jsx)(p,{label:"LDAP Bind Password",children:(0,s.jsx)(u,{type:"password",value:P.ldapBindPassword,onChange:e=>eL("ldapBindPassword",e.target.value),placeholder:e.ldapHasBindPassword?"Saved — leave blank to keep":"Service account password"})}),(0,s.jsx)(p,{label:"LDAP Login Allowed Group DN",hint:"Only members of this group can log in. Leave blank to allow any valid LDAP user.",children:(0,s.jsx)(u,{value:P.ldapLoginAllowedGroupDn,onChange:e=>eL("ldapLoginAllowedGroupDn",e.target.value),placeholder:"CN=Apikeys_Groups,OU=AppGroups,OU=xxx,DC=xx,DC=vn"})}),(0,s.jsx)(p,{label:"LDAP Admin Group DN",hint:"Members of this group get full admin dashboard access.",children:(0,s.jsx)(u,{value:P.ldapAdminGroupDn,onChange:e=>eL("ldapAdminGroupDn",e.target.value),placeholder:"CN=BlueRouter_Admins,OU=AppGroups,OU=xxx,DC=xx,DC=vn"})}),(0,s.jsx)(p,{label:"LDAP Monitor Admin Group DN",hint:"Members can use only Endpoint, API Keys, Usage, Analytics, Quota Tracker and Prompt Logs with admin-like permissions inside those tabs.",children:(0,s.jsx)(u,{value:P.ldapMonitorAdminGroupDn,onChange:e=>eL("ldapMonitorAdminGroupDn",e.target.value),placeholder:"CN=BlueRouter_Monitor_Admins,OU=AppGroups,OU=xxx,DC=xx,DC=vn"})}),(0,s.jsx)(p,{label:"LDAP AI Gateways Monitors Group DN",hint:"Members log in as regular users but the Analytics page aggregates statistics for every API key that has an owner, instead of only their own keys.",children:(0,s.jsx)(u,{value:P.ldapAiGatewaysMonitorsGroupDn,onChange:e=>eL("ldapAiGatewaysMonitorsGroupDn",e.target.value),placeholder:"CN=BlueRouter_AI_Gateways_Monitors,OU=AppGroups,OU=xxx,DC=xx,DC=vn"})})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(p,{label:"User search filter",hint:"Use {{username}} placeholder.",children:(0,s.jsx)(u,{value:P.ldapUserSearchFilter,onChange:e=>eL("ldapUserSearchFilter",e.target.value)})}),(0,s.jsx)(p,{label:"Login group mode",hint:"Nested groups uses AD matching rule 1.2.840.113556.1.4.1941.",children:(0,s.jsx)(x,{title:"Nested group membership",desc:"Recommended for Active Directory nested groups.",checked:P.ldapNestedGroups,onChange:e=>eL("ldapNestedGroups",e)})}),(0,s.jsx)(p,{label:"Username attribute",children:(0,s.jsx)(u,{value:P.ldapUserNameAttribute,onChange:e=>eL("ldapUserNameAttribute",e.target.value)})}),(0,s.jsx)(p,{label:"Display attribute",children:(0,s.jsx)(u,{value:P.ldapUserDisplayAttribute,onChange:e=>eL("ldapUserDisplayAttribute",e.target.value)})}),(0,s.jsx)(p,{label:"Email attribute",children:(0,s.jsx)(u,{value:P.ldapUserEmailAttribute,onChange:e=>eL("ldapUserEmailAttribute",e.target.value)})}),(0,s.jsx)(p,{label:"Connect timeout ms",children:(0,s.jsx)(u,{type:"number",value:P.ldapConnectTimeoutMs,onChange:e=>eL("ldapConnectTimeoutMs",e.target.value)})})]}),(0,s.jsx)(x,{title:"Reject invalid TLS certificates",desc:"Disable only for test/self-signed LDAP TLS.",checked:P.ldapTlsRejectUnauthorized,onChange:e=>eL("ldapTlsRejectUnauthorized",e)}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-background p-4",children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-text-main",children:"Manual admin users / LDAP owner list"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Users loaded here come from Login Allowed Group DN when set. Selected users are also treated as manual admins for backward compatibility."})]}),(0,s.jsxs)("div",{className:"mb-3 flex gap-2",children:[(0,s.jsx)(u,{value:R,onChange:e=>F(e.target.value),placeholder:"Search users..."}),(0,s.jsx)("button",{type:"button",onClick:eG,disabled:V,className:"rounded-xl border border-border px-4 py-2 text-sm font-semibold text-text-main disabled:opacity-50",children:V?"Loading...":"Load users"})]}),_.length>0&&(0,s.jsx)("div",{className:"max-h-72 overflow-auto rounded-xl border border-border",children:_.map(e=>{let a=P.ldapAllowedUsers.includes(e.username);return(0,s.jsxs)("button",{type:"button",onClick:()=>eI(e.username),className:`flex w-full items-center justify-between gap-3 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 ${a?"bg-primary/10":"bg-background hover:bg-surface"}`,children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-semibold text-text-main",children:e.displayName||e.username}),(0,s.jsxs)("span",{className:"ml-2 text-text-muted",children:[e.username,e.email?` \xb7 ${e.email}`:""]})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:a?"check_circle":"radio_button_unchecked"})]},e.dn||e.username)})}),(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"mb-2 text-sm font-semibold text-text-main",children:["Selected manual admin users (",P.ldapAllowedUsers.length,")"]}),0===P.ldapAllowedUsers.length?(0,s.jsx)("div",{className:"text-sm text-text-muted",children:"No users selected."}):(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:P.ldapAllowedUsers.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>eI(e),className:"rounded-full border border-primary/30 bg-primary/10 px-3 py-1 text-xs text-primary",children:[e," \xd7"]},e))})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:eP,disabled:M,className:"rounded-xl border border-border px-4 py-2 text-sm font-semibold text-text-main disabled:opacity-50",children:M?"Testing...":"Save & test LDAP"}),(0,s.jsx)("button",{type:"submit",disabled:B,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white disabled:opacity-50",children:B?"Saving...":"Save LDAP settings"})]}),(0,s.jsx)(d,{status:I})]})}),(0,s.jsxs)(c,{icon:"lock_open",title:"OIDC Dashboard Login",desc:"oidc"===e.authMode?"OIDC active":"both"===e.authMode?"Password + OIDC active":"Optional SSO via Authentik/Keycloak/Google",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ee(e=>!e),className:"mb-4 rounded-xl border border-border px-4 py-2 text-sm font-semibold text-text-main",children:Z?"Hide OIDC settings":"Show OIDC settings"}),Z&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:[{value:"password",title:"Password/LDAP",desc:"Keep local and LDAP login."},{value:"oidc",title:"OIDC only",desc:"Disable local/LDAP login when configured."},{value:"both",title:"Both",desc:"Allow either OIDC or local/LDAP."}].map(e=>{let a=W.authMode===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>q(a=>({...a,authMode:e.value})),className:`rounded-xl border p-3 text-left ${a?"border-primary bg-primary/10":"border-border bg-background hover:border-primary/40"}`,children:[(0,s.jsx)("div",{className:"font-semibold text-text-main",children:e.title}),(0,s.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.desc})]},e.value)})}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(p,{label:"Issuer URL",children:(0,s.jsx)(u,{value:W.oidcIssuerUrl,onChange:e=>q({...W,oidcIssuerUrl:e.target.value})})}),(0,s.jsx)(p,{label:"Client ID",children:(0,s.jsx)(u,{value:W.oidcClientId,onChange:e=>q({...W,oidcClientId:e.target.value})})}),(0,s.jsx)(p,{label:"Client Secret",children:(0,s.jsx)(u,{type:"password",value:J,onChange:e=>H(e.target.value),placeholder:e.oidcConfigured?"Saved — leave blank to keep":"Client secret"})}),(0,s.jsx)(p,{label:"Scopes",children:(0,s.jsx)(u,{value:W.oidcScopes,onChange:e=>q({...W,oidcScopes:e.target.value})})}),(0,s.jsx)(p,{label:"Login label",children:(0,s.jsx)(u,{value:W.oidcLoginLabel,onChange:e=>q({...W,oidcLoginLabel:e.target.value})})})]}),(0,s.jsx)("button",{type:"button",onClick:()=>eO(),disabled:Y,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white disabled:opacity-50",children:Y?"Saving...":"Save OIDC settings"}),(0,s.jsx)(d,{status:K})]})]})]})}},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=7973)),_N_E=e.O()}]);
|