@jheavenknows/bluerouter 5.5.25 → 5.5.26

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.
Files changed (661) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +18 -18
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/[id]/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/[kind]/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  61. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  62. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  64. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  66. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  70. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  71. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  72. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  74. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/audit-proxy/me/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/audit-proxy/root-ca/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/audit-proxy/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/audit-proxy/users/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/view-mode/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-model-profiles/model-catalog/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/codex-catalog/download/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/codex-catalog/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/codex-catalog/upload/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/api-key-models/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/personal-cloud-combos/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/move/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/personal-cloud-providers/shares/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/personal-cloud-providers/visibility/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/provider-nodes/combo-references/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/provider-nodes/custom-embedding/manage/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/provider-nodes/openai-compatible/manage/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/settings/database/export/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/settings/prompt-log-db/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/v1/rate-limits/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  237. package/app/.next-cli-build/server/app/callback.html +1 -1
  238. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  239. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  240. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  242. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  243. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  244. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
  247. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  251. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
  252. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_head.segment.rsc +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_index.segment.rsc +5 -5
  254. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +9 -9
  257. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +4 -4
  258. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  261. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +9 -9
  262. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +5 -5
  264. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  267. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  268. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  271. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  272. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  274. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.html +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +8 -8
  277. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +3 -3
  278. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +8 -8
  283. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_index.segment.rsc +5 -5
  285. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_tree.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  288. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  293. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  295. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/cluster.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
  298. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
  303. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_head.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_index.segment.rsc +5 -5
  305. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_tree.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  308. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  312. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  313. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  315. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  325. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/logs.html +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/logs.rsc +6 -6
  328. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/logs.segments/_full.segment.rsc +6 -6
  333. package/app/.next-cli-build/server/app/dashboard/logs.segments/_head.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/logs.segments/_index.segment.rsc +5 -5
  335. package/app/.next-cli-build/server/app/dashboard/logs.segments/_tree.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  338. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  343. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  344. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  346. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/personal.html +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/personal.rsc +7 -7
  349. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal/__PAGE__.segment.rsc +2 -2
  350. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  353. package/app/.next-cli-build/server/app/dashboard/personal.segments/_full.segment.rsc +7 -7
  354. package/app/.next-cli-build/server/app/dashboard/personal.segments/_head.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/personal.segments/_index.segment.rsc +5 -5
  356. package/app/.next-cli-build/server/app/dashboard/personal.segments/_tree.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  359. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  360. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  364. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  366. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
  369. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
  374. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +5 -5
  376. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
  379. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
  384. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +5 -5
  386. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/providers/embedding.html +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/providers/embedding.rsc +7 -7
  389. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding/__PAGE__.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_full.segment.rsc +7 -7
  395. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_head.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_index.segment.rsc +5 -5
  397. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_tree.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.html +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.rsc +7 -7
  400. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text/__PAGE__.segment.rsc +2 -2
  401. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  405. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_full.segment.rsc +7 -7
  406. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_head.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_index.segment.rsc +5 -5
  408. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_tree.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/providers/image.html +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/providers/image.rsc +7 -7
  411. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image/__PAGE__.segment.rsc +2 -2
  412. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_full.segment.rsc +7 -7
  417. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_index.segment.rsc +5 -5
  419. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_tree.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  422. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  427. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  428. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  430. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/providers/stt.html +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/providers/stt.rsc +7 -7
  433. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt/__PAGE__.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_full.segment.rsc +7 -7
  439. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_head.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_index.segment.rsc +5 -5
  441. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_tree.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/providers/tts.html +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/providers/tts.rsc +7 -7
  444. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts/__PAGE__.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_full.segment.rsc +7 -7
  450. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_index.segment.rsc +5 -5
  452. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_tree.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/providers/web.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/providers/web.rsc +7 -7
  455. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web/__PAGE__.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_full.segment.rsc +7 -7
  461. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_head.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_index.segment.rsc +5 -5
  463. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_tree.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  466. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  467. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  473. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  476. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  486. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  487. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  491. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  493. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
  496. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor.segment.rsc +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
  501. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_head.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_index.segment.rsc +5 -5
  503. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  506. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  517. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  522. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  524. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  529. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  532. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  534. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  537. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  538. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  539. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  540. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  541. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  542. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  543. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  544. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  547. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  549. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  550. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  551. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  552. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  553. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  554. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  556. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  557. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  559. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  561. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  562. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  563. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  564. package/app/.next-cli-build/server/app/index.html +1 -1
  565. package/app/.next-cli-build/server/app/index.rsc +5 -5
  566. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  567. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  568. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  570. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  572. package/app/.next-cli-build/server/app/landing.html +1 -1
  573. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  574. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  575. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  577. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  578. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  580. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  581. package/app/.next-cli-build/server/app/login.html +1 -1
  582. package/app/.next-cli-build/server/app/login.rsc +6 -6
  583. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  584. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  585. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  586. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  588. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  589. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  590. package/app/.next-cli-build/server/app-paths-manifest.json +18 -18
  591. package/app/.next-cli-build/server/chunks/2428.js +1 -1
  592. package/app/.next-cli-build/server/chunks/318.js +1 -1
  593. package/app/.next-cli-build/server/chunks/3399.js +1 -1
  594. package/app/.next-cli-build/server/chunks/3738.js +1 -1
  595. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  596. package/app/.next-cli-build/server/chunks/5024.js +1 -1
  597. package/app/.next-cli-build/server/chunks/5210.js +1 -1
  598. package/app/.next-cli-build/server/chunks/6118.js +1 -1
  599. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  600. package/app/.next-cli-build/server/chunks/6992.js +1 -1
  601. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  602. package/app/.next-cli-build/server/pages/404.html +1 -1
  603. package/app/.next-cli-build/server/pages/500.html +1 -1
  604. package/app/.next-cli-build/static/chunks/{5263-b7941fae776c4373.js → 5263-827de68ed8132a29.js} +1 -1
  605. package/app/.next-cli-build/static/chunks/{7413-87f4038b5317729f.js → 7413-2cc83a72bcf459e1.js} +1 -1
  606. package/app/.next-cli-build/static/chunks/8723-c429b062393b6348.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/{page-fa6ae9cb4ba87b70.js → page-1bb88dd0ad65807c.js} +1 -1
  608. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/audit-proxy/{page-8ddbfc576e6c54b4.js → page-30cd3f3e9f363bef.js} +1 -1
  609. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-3b6fe31430b96954.js → page-70e158890ae4fc83.js} +1 -1
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-678b01b8b35e85fd.js → page-ce7ac6694fbbb678.js} +1 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/model-profiles/{page-3c1dbf4a4cb14dcb.js → page-f521e8417f2e2f31.js} +1 -1
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-0498f663a08738f1.js → page-0ecc380c93debdab.js} +1 -1
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-c64166b1525750d0.js → page-5ade313a9167c99b.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-b027f589b9f76fa8.js → page-0e22441e0507f163.js} +1 -1
  615. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-b28c25f5c4b94189.js → page-11e60a551b0228c1.js} +1 -1
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/logs/console/{page-7e0fb3db5ded3275.js → page-0a6293eb31eab332.js} +1 -1
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-e5b6794cd8a6364f.js → page-a08c52db4e01d8e3.js} +1 -1
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-68040f2d7e3f076b.js → page-07644039f6bf80ee.js} +1 -1
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-71731eef239fdab0.js → page-6c63098dc771e280.js} +1 -1
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{page-b28c25f5c4b94189.js → page-11e60a551b0228c1.js} +1 -1
  622. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/{page-db1a1700eea425f9.js → page-9ef9615e95c6d98c.js} +1 -1
  623. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/{layout-4d30604723c64128.js → layout-478314699bce9b31.js} +1 -1
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/{page-4c7c9a82cd4c06e4.js → page-9a5af94bcad73254.js} +1 -1
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovidermonitor/{page-b729e99653688409.js → page-33d2948585dccd8c.js} +1 -1
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalquota/{page-0537a2fa161b82eb.js → page-d5a701cfcbeb0aaa.js} +1 -1
  627. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-bfe98cb1f3da9ddd.js → page-57581f6add7284d5.js} +1 -1
  628. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-dfb9cb61a2e3114b.js → page-3567ff1ce2261dcf.js} +1 -1
  629. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/embedding/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  630. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/embedding/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  631. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  632. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  633. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image-to-text/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  634. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image-to-text/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  635. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-1710ccdfda2a7cbf.js → page-82eca1407d4266c2.js} +1 -1
  636. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-f195d485859696b8.js → page-267a7602579ef6f4.js} +1 -1
  637. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  638. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/page-e870a4cb95e2a8bc.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/[id]/page-c927b95886c5f0d6.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/page-e870a4cb95e2a8bc.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/web/[kind]/[id]/{page-e46c0847d86fc008.js → page-7dedb965c7920eb8.js} +1 -1
  642. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/web/{page-71731eef239fdab0.js → page-6c63098dc771e280.js} +1 -1
  643. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-2043197f3715fe4c.js → page-94f864cc2f20b76d.js} +1 -1
  644. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-3a4844e727cfec8f.js → page-a8165d10ab8301ef.js} +1 -1
  645. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-1b1ae93c3f398083.js → page-8ff70e1fe63630c5.js} +1 -1
  646. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-bc64c0e184eef9d3.js → page-78d24f71ba0846fa.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-b6a76e695fa879b2.js → page-d08272fd14e6b4af.js} +1 -1
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-c33de7f43266076b.js → layout-8b4790ae13ade152.js} +1 -1
  649. package/app/.next-cli-build/static/chunks/app/{layout-bf4de7a5f9e7315c.js → layout-9b0fc956496699bb.js} +1 -1
  650. package/app/.next-cli-build/static/chunks/app/login/{page-071c3519fddc7b20.js → page-534a498e40d54531.js} +1 -1
  651. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  652. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  653. package/app/package.json +1 -1
  654. package/package.json +1 -1
  655. package/app/.next-cli-build/static/chunks/2793-b3a4461f8347c3f1.js +0 -1
  656. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/page-f408f6e27a9760bb.js +0 -1
  657. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/[id]/page-182a798f8ca008a1.js +0 -1
  658. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/page-f408f6e27a9760bb.js +0 -1
  659. /package/app/.next-cli-build/static/{8HLcfPZQbiQFkzvYyYlAK → 5AQ_UrmD1tq7tn1M3F6jS}/_buildManifest.js +0 -0
  660. /package/app/.next-cli-build/static/{8HLcfPZQbiQFkzvYyYlAK → 5AQ_UrmD1tq7tn1M3F6jS}/_ssgManifest.js +0 -0
  661. /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.5.18-to-5.5.19-5.5.19-20260918-094232 → upgrade-5.5.25-to-5.5.26-5.5.26-20260923-102955}/data.sqlite +0 -0
@@ -21,4 +21,4 @@ function getUserName(user) {
21
21
  "theme": "dark",
22
22
  "hasCompletedOnboarding": true
23
23
  }`}({baseUrl:tW,apiKey:ta.key,codingModel:tZ.codingModel,fastModel:tZ.fastModel}):"",t0=ta?['# C\xe1ch 1: PowerShell installer\nirm https://claude.ai/install.ps1 | iex\n\n# C\xe1ch 2: CMD installer\ncurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd\n\n# C\xe1ch 3: npm (cần c\xe0i Node.js trước)\nnpm install -g @anthropic-ai/claude-code\nclaude --version\nmkdir $env:USERPROFILE\\.claude -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.claude\\settings.json", @\'',tQ,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nclaude"].join("\n"):"",t1=ti?x(ti,tG):{codingModel:"programmer",fastModel:"programmer-fast"},t2=ti?function({baseUrl:e,apiKey:t,codingModel:n,fastModel:s}){let r=n||"programmer",l=s||r||"programmer-fast",a=`bluerouter/${r}`,o=`bluerouter/${l}`,i={[r]:{name:r,limit:{context:12e4,output:3e4},modalities:{input:["text","image"],output:["text"]}}};return l!==r&&(i[l]={name:l,limit:{context:12e4,output:3e4},modalities:{input:["text"],output:["text"]}}),JSON.stringify({$schema:"https://opencode.ai/config.json",provider:{bluerouter:{npm:"@ai-sdk/openai-compatible",name:"BlueRouter",options:{baseURL:e||"https://models-gateway.example.com/v1",apiKey:t||"sk-xxxxx"},models:i}},model:a,small_model:o,compaction:{auto:!0,prune:!0,reserved:3e4},agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:o}}},null,2)}({baseUrl:tz,apiKey:ti.key,codingModel:t1.codingModel,fastModel:t1.fastModel}):"",t3=ti?['npm install -g opencode-ai\nopencode --version\nmkdir $env:APPDATA\\opencode -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:APPDATA\\opencode\\opencode.json", @\'',t2,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nopencode"].join("\n"):"";(0,r.useEffect)(()=>{if(!tc)return;let e=!1;return fetch("/api/codex-catalog").then(e=>e.ok?e.json():null).then(t=>{e||tu(t)}).catch(()=>{e||tu(null)}),()=>{e=!0}},[tc]);let t5=!!tm?.exists,t4=async e=>{if(e){tp(!0),tg({type:"",message:""});try{let t=new FormData;t.append("file",e);let n=await fetch("/api/codex-catalog/upload",{method:"POST",body:t}),s=await n.json().catch(()=>({}));if(!n.ok)throw Error(s.error||"Tải l\xean thất bại");tu(s),tg({type:"success",message:`Đ\xe3 tải l\xean ${s.modelCount} model.`})}catch(e){tg({type:"error",message:e.message||"Tải l\xean thất bại"})}finally{tp(!1)}}},t7=async e=>{let t=e.target.files?.[0];await t4(t),tf.current&&(tf.current.value="")},t8=async()=>{tp(!0),tg({type:"",message:""});try{let e=await fetch("/api/codex-catalog",{method:"DELETE"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Xo\xe1 thất bại");tu(t),tg({type:"success",message:"Đ\xe3 xo\xe1 catalog."})}catch(e){tg({type:"error",message:e.message||"Xo\xe1 thất bại"})}finally{tp(!1)}},t6=tc?x(tc,tG):{codingModel:"programmer",fastModel:"programmer-fast"},t9=tc?function({baseUrl:e,codingModel:t,hasCatalog:n}){let s=[`model = "${t||"programmer"}"`,'model_provider = "bluerouter"'];return n&&s.push(`model_catalog_json = '${m}'`),s.push("# Uncomment 3 d\xf2ng dưới khi d\xf9ng local model:","# model_context_window = 120000","# model_auto_compact_token_limit = 90000",'# model_auto_compact_token_limit_scope = "total"',"","[model_providers.bluerouter]",'name = "BlueRouter"',`base_url = "${e||"https://models-gateway.example.com"}"`,'env_key = "OPENAI_API_KEY"','wire_api = "responses"'),s.join("\n")}({baseUrl:tz,codingModel:t6.codingModel,hasCatalog:t5}):"",ne=tc?function({model:e}){return`model = "${e}"`}({model:t6.fastModel||t6.codingModel}):"",nt=tc?["npm install -g @openai/codex","codex --version","mkdir $env:USERPROFILE\\.codex -Force","$utf8NoBom = New-Object System.Text.UTF8Encoding $false",'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',t9,"'@, $utf8NoBom)","","# Profile fast: chạy bằng codex -p fast",'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\fast.config.toml", @\'',ne,"'@, $utf8NoBom)",...t5?["",`# Bấm n\xfat "Tải ${m}" ở tr\xean, rồi ch\xe9p file v\xe0o đ\xfang thư mục n\xe0y:`,`# Move-Item -Force "$env:USERPROFILE\\Downloads\\${m}" "$env:USERPROFILE\\.codex\\${m}"`]:[],"",`$env:OPENAI_API_KEY = "${tc.key}"`,`setx OPENAI_API_KEY "${tc.key}"`,"cd D:\\path\\to\\your-project","codex"].join("\n"):"",nn=tj?x(tj,tG):{codingModel:tG||"YOUR_MODEL",fastModel:tG||"YOUR_MODEL"},ns=tj?function({baseUrl:e,apiKey:t,codingModel:n,fastModel:s}){let r=n||"programmer",l=s||r||"programmer-fast",a=e||"https://models-gateway.example.com/v1";return JSON.stringify({env:{OPENAI_API_KEY:t||"sk-xxxxx"},security:{auth:{selectedType:"openai"}},model:{name:r},modelProviders:{openai:[{id:r,name:r,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:12e4,maxRetries:2,contextWindowSize:12e4,samplingParams:{temperature:.2}}},{id:l,name:l,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:6e4,maxRetries:2,reasoning:!1,contextWindowSize:12e4,samplingParams:{temperature:.2,max_tokens:4096}}}]}},null,2)}({baseUrl:tz,apiKey:tj.key,codingModel:nn.codingModel,fastModel:nn.fastModel}):"",nr=tj?['npm install -g @qwen-code/qwen-code\nqwen --version\nmkdir $env:USERPROFILE\\.qwen -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.qwen\\settings.json", @\'',ns,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${tj.key}"`,`$env:OPENAI_BASE_URL = "${tz}"`,`$env:OPENAI_MODEL = "${nn.codingModel}"`,`setx OPENAI_API_KEY "${tj.key}"`,`setx OPENAI_BASE_URL "${tz}"`,`setx OPENAI_MODEL "${nn.codingModel}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n"):"",nl=(0,r.useMemo)(()=>{let e=new Map;for(let t of z){let n=d(t.username||t.email||t.userPrincipalName||t.sAMAccountName);n&&e.set(n,{id:n,label:`${t.displayName||t.username||n}${t.email?` \xb7 ${t.email}`:""}`})}for(let t of p){let n=d(t.ownerUser||t.createdByUser);n&&!e.has(n)&&e.set(n,{id:n,label:n})}return tK&&!e.has(tK)&&e.set(tK,{id:tK,label:`${tK} (t\xf4i)`}),[...e.values()].sort((e,t)=>e.label.localeCompare(t.label))},[z,p,tK]),na=(n=c(ee),u=c(Z),!(n.length===u.length&&n.every((e,t)=>e===u[t]))),no=V||!E.trim()||0===Z.length||tB,ni=!!tk||"all"!==tC,nd=async()=>{A(!0),O("");try{let e=new URLSearchParams;e.set("page",String(tS)),e.set("pageSize",String(tO)),tk&&e.set("q",tk),"all"!==tC&&e.set("status",tC);let t=await fetch(`/api/keys?${e.toString()}`,{cache:"no-store"}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng tải được danh s\xe1ch API keys");let s=n.keys||[],r=n.pagination||{page:tS,pageSize:tO,total:s.length,totalAll:s.length,totalPages:1,search:tk,status:tC};if(0===s.length&&Number(r.total||0)>0&&tS>1)return void tP(Math.max(1,Number(r.totalPages||1)));let l=c(n.apiKeyDefaultModels||(n.apiKeyDefaultModel?[n.apiKeyDefaultModel]:[]));b(s),tE(r),eX(n.apiKeyTotal??r.totalAll??r.total??s.length);let a=f(n.apiKeyDefaultPolicy||i,i);Q(l),et(l),el(a),eo(a),eG(n.apiKeyLimit??5),eJ(n.apiKeyCount??r.totalAll??s.length),"number"==typeof n.globalApiKeyLimit&&n.globalApiKeyLimit>0&&(eQ(n.globalApiKeyLimit),e1(String(n.globalApiKeyLimit))),n.apiKeyLimitOverrides&&"object"==typeof n.apiKeyLimitOverrides&&e4(n.apiKeyLimitOverrides),eB(!0===n.globalCavemanEnabled),eW(n.globalCavemanLevel||"full")}catch(e){O(e.message||"Kh\xf4ng tải được danh s\xe1ch API keys")}finally{A(!1)}};(0,r.useEffect)(()=>{ts(window.location.origin)},[]),(0,r.useEffect)(()=>{let e=setTimeout(()=>{tP(1),tw(tv.trim())},350);return()=>clearTimeout(e)},[tv]),(0,r.useEffect)(()=>{nd()},[tS,tO,tk,tC]),(0,r.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch("/api/keys?page=1&pageSize=1",{cache:"no-store"}),n=await t.json().catch(()=>({}));if(!t.ok||e)return;eB(!0===n.globalCavemanEnabled),eW(n.globalCavemanLevel||"full")}catch{}},n=()=>t(),s=()=>{"visible"===document.visibilityState&&t()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",s);let r=window.setInterval(t,3e4);return()=>{e=!0,window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",s),window.clearInterval(r)}},[]),(0,r.useEffect)(()=>{!T&&tK&&M(tK)},[tK,T]);let nc=async()=>{if(!ef&&!ey){ev(!0);try{let[e,t,n]=await Promise.allSettled([tF?fetch("/api/providers",{cache:"no-store"}):Promise.resolve(null),fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]),s=[],r=[];if("fulfilled"===e.status&&e.value?.ok){let t=await e.value.json().catch(()=>({}));s.push(...t.connections||[])}if("fulfilled"===t.status&&t.value.ok){let e=await t.value.json().catch(()=>({}));r.push(...e.connections||[])}if(ep(tF?[...s,...r]:r),"fulfilled"===n.status&&n.value.ok){let e=await n.value.json().catch(()=>({}));eg(e.aliases||{})}ej(!0)}catch{}finally{ev(!1)}}},nx=async(e=H)=>{if(tF){J(!0);try{let t=await fetch(`/api/auth/ldap/users?q=${encodeURIComponent(e||"")}`,{cache:"no-store"}),n=await t.json().catch(()=>({}));t.ok&&W(n.users||[])}catch{}finally{J(!1)}}},nm=async()=>{if(tF&&0!==ee.length){es(!0),O("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultModels:ee})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng lưu được default models");let n=c(t.apiKeyDefaultModels||(t.apiKeyDefaultModel?[t.apiKeyDefaultModel]:[])),s=f(t.apiKeyDefaultPolicy||i,i);Q(n),et(n),el(s),eo(s)}catch(e){O(e.message||"Kh\xf4ng lưu được default models")}finally{es(!1)}}},nu=e=>{"number"==typeof e?.globalApiKeyLimit&&e.globalApiKeyLimit>0&&(eQ(e.globalApiKeyLimit),e1(String(e.globalApiKeyLimit))),e?.apiKeyLimitOverrides&&"object"==typeof e.apiKeyLimitOverrides&&e4(e.apiKeyLimitOverrides)},nh=async()=>{if(!tF)return;let e=Number.parseInt(e0,10);if(!Number.isFinite(e)||e<=0)return void O("Giới hạn global phải l\xe0 số nguy\xean dương.");e3(!0),O("");try{let t=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userApiKeyLimit:e})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng lưu được global API key limit");nu(n)}catch(e){O(e.message||"Kh\xf4ng lưu được global API key limit")}finally{e3(!1)}},np=async e=>{if(!tF)return!1;tt(!0),O("");try{let t=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userApiKeyLimitOverrides:e})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng lưu được per-user override");return nu(n),!0}catch(e){return O(e.message||"Kh\xf4ng lưu được per-user override"),!1}finally{tt(!1)}},nb=async()=>{let e=d(e7),t=Number.parseInt(e6,10);if(!e)return void O("Nhập username/email cần override.");if(!Number.isFinite(t)||t<=0)return void O("Giới hạn per-user phải l\xe0 số nguy\xean dương.");let n={...e5,[e]:t};await np(n)&&(e8(""),e9(""))},ng=async e=>{let t={...e5};delete t[e],await np(t)},nf=async e=>{if(!tF)return;let t=f(e,i);ed(!0),O("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultPolicy:t})}),n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||"Kh\xf4ng lưu được default policy");let s=f(n.apiKeyDefaultPolicy||t,i);el(s),eo(s),ex(!1)}catch(e){O(e.message||"Kh\xf4ng lưu được default policy")}finally{ed(!1)}},nj=async()=>{if(E.trim()){if(0===Z.length)return void O("Admin cần cấu h\xecnh default models trước khi tạo API key.");if(tB)return void O(`Mỗi user chỉ được tạo tối đa ${tR} API keys.
24
- C\xf3 thể d\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`);X(!0),O("");try{let e=tF?d(K||T||tK):void 0,t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.trim(),ownerUser:e})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng tạo được API key");D(n.key),L(""),R(""),I(!1),tP(1),await nd()}catch(e){O(e.message||"Kh\xf4ng tạo được API key")}finally{X(!1)}}},ny=async(e,t)=>{let n=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await n.json().catch(()=>({}));return n.ok?(await nd(),!0):(O(s.error||"Kh\xf4ng cập nhật được API key"),!1)},nv=async()=>{if(!eN)return;let e=c(ew);if(0===e.length)return void O("H\xe3y chọn \xedt nhất một model trước khi lưu quyền truy cập API key.");eS(!0),O("");try{await ny(eN.id,{allowedModels:e})&&(ek(null),eC([]))}finally{eS(!1)}},nN=async e=>{if(eP){eL(!0),O("");try{await ny(eP.id,{limits:f(e)})&&(eO(null),eI(i))}finally{eL(!1)}}},nk=async()=>{if(eP){eL(!0),O("");try{await ny(eP.id,{limits:{}})&&(eO(null),eI(i))}finally{eL(!1)}}},nw=async e=>{if(!eT)return!1;eD(!0),O("");try{let t=await fetch(`/api/keys/${eT.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng lưu được cấu h\xecnh Caveman");return await nd(),e_(null),!0}catch(t){let e=t?.message||"Kh\xf4ng lưu được cấu h\xecnh Caveman";throw O(e),Error(e)}finally{eD(!1)}};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Quản l\xfd API Keys"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:tF?"Bảng quản trị API key c\xf3 t\xecm kiếm, lọc trạng th\xe1i v\xe0 ph\xe2n trang để kh\xf4ng render qu\xe1 nhiều key c\xf9ng l\xfac.":`Bạn c\xf3 thể quản l\xfd API key của t\xe0i khoản m\xecnh. Mỗi user thường sở hữu tối đa ${tR} API keys. D\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(l.$n,{variant:"outline",onClick:nd,disabled:v,children:v?"Đang tải...":"Refresh"}),(0,s.jsx)(l.$n,{onClick:()=>{I(!0),!T&&tK&&M(tK)},disabled:tB,children:"Tạo API Key"})]})]}),S?(0,s.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600 whitespace-pre-line",children:S}):null,(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsx)(w,{label:"Tổng API keys",value:tD,hint:tF?"To\xe0n hệ thống":`${tU}/${tR} key của bạn`}),(0,s.jsx)(w,{label:"Đang hiển thị",value:tq,hint:ni?"Theo bộ lọc hiện tại":"Kh\xf4ng filter"}),(0,s.jsx)(w,{label:"Page size",value:tO,hint:"Chỉ tải số d\xf2ng của trang hiện tại"})]}),tF?null:(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Giới hạn API key theo user"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["T\xe0i khoản của bạn đang c\xf3 ",tU,"/",tR," API keys. Key bị disabled vẫn được t\xednh v\xe0o giới hạn."]})]}),(0,s.jsx)("span",{className:"rounded-full border border-border bg-surface px-3 py-1 text-sm",children:tB?"Đ\xe3 đạt giới hạn":"C\xf2n c\xf3 thể tạo th\xeam"})]})}),(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Default models cho API key mới"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"API key mới sẽ mặc định được d\xf9ng c\xe1c model n\xe0y. Cần cấu h\xecnh \xedt nhất một default model trước khi tạo API key."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[Z.length>0?(0,s.jsx)(j,{models:Z,emptyLabel:"Chưa cấu h\xecnh default models"}):(0,s.jsx)("span",{className:"text-sm text-red-600",children:"Chưa cấu h\xecnh default models"}),tF?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eu(!0),nc()},children:ee.length>0?`Đ\xe3 chọn ${ee.length} model`:"Chọn default models..."}),(0,s.jsx)(l.$n,{size:"sm",onClick:nm,disabled:!na||en||0===ee.length,children:en?"Đang lưu...":"Lưu"})]}):null]}),tF?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:ey?"Đang tải danh s\xe1ch model...":"Danh s\xe1ch model chỉ tải khi mở bộ chọn để trang load nhanh hơn."}):null]})}),(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Default policy cho API key mới"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Policy n\xe0y được tự động g\xe1n cho key mới. Policy ri\xeang từng key vẫn c\xf3 thể override sau khi tạo."})]}),tF?(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eo(f(er||i,i)),ex(!0)},children:"Chỉnh default policy"}):null]}),(0,s.jsx)(y,{limits:er,showThinking:tF,showOutputLimit:tF})]})})]}),tF?(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Giới hạn số API key cho mỗi user"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Global default \xe1p dụng cho mọi user thường. Per-user override sẽ ghi đ\xe8 global cho user cụ thể (nhập 0 hoặc bấm X\xf3a để bỏ override v\xe0 quay lại global)."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,s.jsxs)("label",{className:"flex-1",children:[(0,s.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Global default (\xe1p dụng cho user kh\xf4ng c\xf3 override)"}),(0,s.jsx)("input",{type:"number",min:"1",value:e0,onChange:e=>e1(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),(0,s.jsx)(l.$n,{onClick:nh,disabled:e2||Number.parseInt(e0,10)===eZ,children:e2?"Đang lưu...":"Lưu global"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border p-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Per-user override"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Ghi đ\xe8 global cho user cụ thể. Override sẽ \xe1p dụng lu\xf4n cả cho key hiện c\xf3 (chặn tạo key mới nếu vượt)."}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)("input",{value:e7,onChange:e=>e8(e.target.value),placeholder:"username hoặc email",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)("input",{type:"number",min:"1",value:e6,onChange:e=>e9(e.target.value),placeholder:"Giới hạn key",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary sm:w-40"}),(0,s.jsx)(l.$n,{onClick:nb,disabled:te,children:te?"Đang lưu...":"Th\xeam / Cập nhật"})]}),0===Object.keys(e5).length?(0,s.jsxs)("div",{className:"mt-3 rounded-xl border border-dashed border-border bg-surface p-3 text-xs text-text-muted",children:["Chưa c\xf3 user n\xe0o được override. Global = ",eZ," key."]}):(0,s.jsx)("div",{className:"mt-3 overflow-hidden rounded-xl border border-border",children:(0,s.jsxs)("table",{className:"min-w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-surface text-xs text-text-muted",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"User"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Giới hạn"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"H\xe0nh động"})]})}),(0,s.jsx)("tbody",{children:Object.entries(e5).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>(0,s.jsxs)("tr",{className:"border-t border-border",children:[(0,s.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e}),(0,s.jsx)("td",{className:"px-3 py-2",children:t}),(0,s.jsx)("td",{className:"px-3 py-2 text-right",children:(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:te,onClick:()=>ng(e),children:"X\xf3a"})})]},e))})]})})]})]})}):null,(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Th\xf4ng tin API endpoint"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng API key b\xean dưới để gọi gateway theo chuẩn OpenAI-compatible. Endpoint lấy theo domain hiện tại của dashboard."})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Chat Completions"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tH})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>tT(tz,"api-base-url"),children:"api-base-url"===tL?"Đ\xe3 copy Base URL":"Copy Base URL"}),(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>tT(tH,"api-chat-endpoint"),children:"api-chat-endpoint"===tL?"Đ\xe3 copy Endpoint":"Copy Endpoint"})]})]})}),U?(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"font-medium",children:"Đ\xe3 tạo API key"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-sm",children:U}),(0,s.jsxs)("div",{className:"text-sm text-text-muted",children:["H\xe3y copy ngay. Key mới mặc định được d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard, trừ khi admin chỉnh quyền model/policy.",(0,s.jsx)(j,{models:Z,emptyLabel:"default models"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{size:"sm",onClick:()=>tT(U,"created"),children:"created"===tL?"Đ\xe3 copy":"Copy"}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>D(""),children:"Đ\xf3ng"})]})]})}):null,(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-end xl:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Danh s\xe1ch API keys"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xecm theo t\xean key, owner, model, id hoặc một phần API key. Backend chỉ trả về page hiện tại."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:tv,onChange:e=>tN(e.target.value),placeholder:"T\xecm API key, owner, model...",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary sm:w-80"}),(0,s.jsxs)("select",{value:tC,onChange:e=>{tA(e.target.value),tP(1)},className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,s.jsx)("option",{value:"active",children:"Chỉ key đang bật"}),(0,s.jsx)("option",{value:"inactive",children:"Chỉ key đ\xe3 tắt"})]}),ni?(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{tN(""),tw(""),tA("all"),tP(1)},children:"X\xf3a lọc"}):null]})]}),v?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải API keys..."}):0===p.length?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:ni?"Kh\xf4ng t\xecm thấy API key ph\xf9 hợp bộ lọc.":"Chưa c\xf3 API key n\xe0o."}):(0,s.jsx)(F,{keys:p,copied:tL,copy:tT,isAdmin:tF,globalCavemanEnabled:eq,globalCavemanLevel:ez,onToggleActive:(e,t)=>ny(e,{isActive:t}),onApiTest:tl,onClaudeSettings:to,onOpenCodeSettings:td,onCodexSettings:e=>{tg({type:"",message:""}),tx(e)},onQwenSettings:ty,onRename:(e,t)=>{let n=prompt("T\xean API key mới",t||"");n?.trim()&&ny(e,{name:n.trim()})},onRotate:e=>{e?.id&&B({title:"Đổi API key",message:"Hệ thống sẽ tạo chuỗi API key mới cho record n\xe0y v\xe0 giữ nguy\xean t\xean, owner, model, policy. Key cũ sẽ hết hiệu lực ngay sau khi đổi.",onConfirm:async()=>{B(null),O("");let t=await fetch(`/api/keys/${e.id}/rotate`,{method:"POST"}),n=await t.json().catch(()=>({}));if(!t.ok)return void O(n.error||"Kh\xf4ng đổi được API key");let s=n.rotatedKey||n.key?.key||"";s&&D(s),await nd()}})},onEditModels:e=>{ek(e),eC(c(e.allowedModels)),nc()},onEditPolicy:e=>{tF&&(eO(e),eI(g(e.limits)?f(e.limits):i))},onEditCaveman:e_,onShowCavemanInfo:eK,onCavemanTest:eR,onAssignOwner:(e,t)=>{if(!tF)return;let n=prompt("G\xe1n owner username/email",t||tK||"");null!==n&&ny(e,{ownerUser:d(n)})},onDelete:e=>{B({title:"X\xf3a API Key",message:"Bạn chắc chắn muốn x\xf3a API key n\xe0y? Thao t\xe1c n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.",onConfirm:async()=>{B(null),(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&await nd()}})}}),(0,s.jsx)(C,{pagination:tI,pageSize:tO,onPageChange:tP,onPageSizeChange:e=>{t$(e),tP(1)},loading:v})]})}),(0,s.jsx)(l.aF,{isOpen:$,onClose:()=>I(!1),title:"Tạo API Key",size:"lg",children:(0,s.jsxs)("div",{className:"space-y-4",children:[0===Z.length?(0,s.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:"Admin cần cấu h\xecnh default models trước khi tạo API key."}):tB?(0,s.jsxs)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:["Bạn đ\xe3 đạt giới hạn ",tR," API keys. H\xe3y x\xf3a bớt key cũ trước khi tạo key mới."]}):(0,s.jsxs)("div",{className:"text-sm text-text-muted",children:["Key n\xe0y sẽ được tạo với quyền d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard.",(0,s.jsx)(j,{models:Z})]}),(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean API key"}),(0,s.jsx)("input",{value:E,onChange:e=>L(e.target.value),placeholder:"VD: VSCode, LibreChat, team-user",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),tF?(0,s.jsxs)("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Owner user"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{value:H,onChange:e=>G(e.target.value),placeholder:"Nhập từ kh\xf3a rồi bấm Tải",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>nx(H),disabled:Y,children:Y?"Đang tải":"Tải LDAP"})]}),(0,s.jsxs)("select",{value:T,onChange:e=>M(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,s.jsxs)("option",{value:tK||"",children:["G\xe1n cho t\xf4i (",tK||"local",")"]}),nl.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,s.jsx)("input",{value:K,onChange:e=>R(e.target.value),placeholder:"username hoặc email, kh\xf4ng bắt buộc",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"LDAP kh\xf4ng tự tải khi mở trang để giảm thời gian load. C\xf3 thể nhập owner thủ c\xf4ng hoặc nhập từ kh\xf3a rồi bấm Tải LDAP."})]}):(0,s.jsxs)("p",{className:"rounded-xl border border-border bg-surface p-3 text-sm text-text-muted",children:["Owner: ",tK||"user hiện tại"]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>I(!1),children:"Hủy"}),(0,s.jsx)(l.$n,{onClick:nj,disabled:no,children:V?"Đang tạo...":"Tạo"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tr,onClose:()=>tl(null),title:"API Test bằng curl Windows",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Lệnh dưới đ\xe2y gọi thử endpoint Chat Completions bằng API key đang chọn v\xe0 đ\xe3 nh\xfang sẵn Bearer token."}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tr?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Endpoint"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tH})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model test"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tY})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Lệnh curl cho Windows CMD"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tX})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"D\xe1n lệnh v\xe0o CMD hoặc Windows Terminal để test nhanh. Nếu domain dashboard chạy sau reverse proxy, endpoint sẽ d\xf9ng đ\xfang domain đang mở tr\xean tr\xecnh duyệt."}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>tl(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{onClick:()=>tT(tX,`api-test-curl-${tr?.id||"current"}`),children:tL===`api-test-curl-${tr?.id||"current"}`?"Đ\xe3 copy":"Copy lệnh curl"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!ta,onClose:()=>to(null),title:"Claude Code Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy nội dung JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.claude\\settings.json"})," để Claude Code gọi qua gateway n\xe0y. Model coding d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:tZ.codingModel}),"; model fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:tZ.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:ta?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tZ.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tQ})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Claude Code CLI tr\xean Windows"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t0})]}),(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: 2 d\xf2ng auto-compact/context window đ\xe3 được comment sẵn; chỉ uncomment khi d\xf9ng local model. Nếu c\xe0i bằng npm th\xec m\xe1y cần c\xe0i Node.js trước. Chạy Claude Code trong thư mục project, kh\xf4ng chạy trong C:\\WINDOWS\\system32. Nếu d\xf9ng model fast ri\xeang như programmer-fast th\xec API key n\xe0y cũng phải được ph\xe9p d\xf9ng model đ\xf3 trong cột Model."}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>to(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(t0,`claude-code-help-${ta?.id||"current"}`),children:tL===`claude-code-help-${ta?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(tQ,`claude-code-settings-${ta?.id||"current"}`),children:tL===`claude-code-settings-${ta?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!ti,onClose:()=>td(null),title:"OpenCode Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%APPDATA%\\opencode\\opencode.json"})," hoặc ",(0,s.jsx)("span",{className:"font-mono",children:"opencode.json"})," trong project. Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t1.codingModel}),"; explorer/fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t1.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:ti?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model ch\xednh"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t1.codingModel})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model fast"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t1.fastModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"opencode.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t2})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy OpenCode tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t3})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: API key n\xe0y cần được ph\xe9p gọi cả ",t1.codingModel," v\xe0 ",t1.fastModel,". Nếu OpenCode đang d\xf9ng đường dẫn config kh\xe1c, c\xf3 thể đặt file opencode.json ngay trong thư mục project."]}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>td(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(t3,`opencode-help-${ti?.id||"current"}`),children:tL===`opencode-help-${ti?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(t2,`opencode-settings-${ti?.id||"current"}`),children:tL===`opencode-settings-${ti?.id||"current"}`?"Đ\xe3 copy settings":"Copy opencode.json"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tc,onClose:()=>tx(null),title:"Codex Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy TOML dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),". API key được set bằng biến m\xf4i trường ",(0,s.jsx)("span",{className:"font-mono",children:"OPENAI_API_KEY"}),". Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t6.codingModel}),"; profile fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t6.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tc?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t6.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"%USERPROFILE%\\.codex\\config.toml"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t9})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:["%USERPROFILE%\\.codex\\fast.config.toml — chạy bằng ",(0,s.jsx)("span",{className:"font-mono",children:"codex -p fast"})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ne})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-text-muted",children:m}),tm?.exists?(0,s.jsxs)("a",{href:"/api/codex-catalog/download",download:m,className:"rounded-lg border border-border px-3 py-1.5 text-xs font-medium hover:bg-surface-2",children:["Tải ",m]}):(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Admin chưa tải l\xean"})]}),(0,s.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["File n\xe0y khai metadata model cho Codex: tắt cảnh b\xe1o ",(0,s.jsx)("span",{className:"font-mono",children:"Model metadata for ... not found"}),", khai đ\xfang context window v\xe0 mức reasoning. Tải về rồi để ",(0,s.jsx)("strong",{children:"chung thư mục với config.toml"})," — tức l\xe0 ",(0,s.jsxs)("span",{className:"font-mono",children:["%USERPROFILE%\\.codex\\",m]}),". Kh\xf4ng đổi t\xean file."]}),tm?.exists&&(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsxs)("span",{children:[(tm.sizeBytes/1024).toFixed(0)," KB"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[tm.modelCount," model"]}),tm.updatedAt&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:["cập nhật ",new Date(tm.updatedAt).toLocaleString("vi-VN")]})]})]}),tm?.exists&&tm.slugs?.length>0&&(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1",children:[tm.slugs.map(e=>(0,s.jsx)("span",{className:"rounded-md border border-border px-1.5 py-0.5 font-mono text-[10px] text-text-muted",children:e},e)),tm.truncatedSlugs&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"…"})]}),t_&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[(0,s.jsx)("input",{ref:tf,type:"file",accept:"application/json,.json",className:"hidden",onChange:t7}),(0,s.jsx)(l.$n,{variant:"outline",size:"sm",disabled:th,onClick:()=>tf.current?.click(),children:th?"Đang xử l\xfd...":tm?.exists?"Thay file kh\xe1c":"Tải file l\xean"}),tm?.exists&&(0,s.jsx)(l.$n,{variant:"ghost",size:"sm",disabled:th,onClick:t8,children:"Xo\xe1"}),tb.message&&(0,s.jsx)("span",{className:`text-xs ${"error"===tb.type?"text-red-600":"text-emerald-600"}`,children:tb.message}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Sinh bằng ",(0,s.jsx)("span",{className:"font-mono",children:"scripts/gen-codex-model-catalog.mjs"})," tr\xean m\xe1y đ\xe3 c\xe0i Codex."]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Codex tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:nt})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: c\xe1c d\xf2ng context window v\xe0 auto-compact đ\xe3 được comment sẵn; chỉ uncomment khi d\xf9ng local model. Profile fast nằm ở file ri\xeang ",(0,s.jsx)("span",{className:"font-mono",children:"fast.config.toml"})," (Codex đời mới kh\xf4ng c\xf2n nhận bảng ",(0,s.jsx)("span",{className:"font-mono",children:"[profiles.*]"})," trong config.toml); n\xf3 chỉ ghi đ\xe8 ",(0,s.jsx)("span",{className:"font-mono",children:"model"}),", c\xf2n provider v\xe0 base URL kế thừa từ config.toml. ",tm?.exists?(0,s.jsxs)(s.Fragment,{children:["Nhớ tải ",(0,s.jsx)("span",{className:"font-mono",children:m})," về đặt cạnh config.toml — thiếu file đ\xf3 Codex sẽ b\xe1o lỗi khi khởi động v\xec config.toml đang trỏ tới n\xf3."]}):"Khi admin tải model_catalog.json l\xean, config.toml ở tr\xean sẽ tự c\xf3 th\xeam d\xf2ng model_catalog_json."," Nếu c\xe0i bằng npm th\xec m\xe1y cần c\xe0i Node.js trước. setx chỉ lưu biến m\xf4i trường cho terminal mở sau. Codex d\xf9ng OpenAI-compatible endpoint của BlueRouter."]}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>tx(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(nt,`codex-help-${tc?.id||"current"}`),children:tL===`codex-help-${tc?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(t9,`codex-settings-${tc?.id||"current"}`),children:tL===`codex-settings-${tc?.id||"current"}`?"Đ\xe3 copy settings":"Copy config.toml"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tj,onClose:()=>ty(null),title:"Qwen Code Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.qwen\\settings.json"})," để Qwen Code gọi qua OpenAI-compatible endpoint của BlueRouter. Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:nn.codingModel}),"; model fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:nn.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tj?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:nn.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ns})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Qwen Code tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:nr})]}),(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo settings.json hợp lệ v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Qwen Code hỗ trợ OpenAI-compatible provider n\xean d\xf9ng tốt với BlueRouter."}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>ty(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(nr,`qwen-code-help-${tj?.id||"current"}`),children:tL===`qwen-code-help-${tj?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(ns,`qwen-code-settings-${tj?.id||"current"}`),children:tL===`qwen-code-settings-${tj?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,s.jsx)(_,{apiKey:eF,fallbackModels:Z,onClose:()=>eR(null)}),(0,s.jsx)(P,{apiKey:eT,globalEnabled:eq,globalLevel:ez,onClose:()=>e_(null),onSave:nw,saving:eU}),(0,s.jsx)(P,{apiKey:eM,globalEnabled:eq,globalLevel:ez,onClose:()=>eK(null),onSave:()=>{},saving:!1,infoOnly:!0}),(0,s.jsx)(k,{open:!!eN,keyName:eN?.name,models:ew,setModels:eC,activeProviders:eh,modelAliases:eb,onClose:()=>{ek(null),eC([])},onSave:nv,saving:eA,personalOnly:!tF,extraModels:Z}),(0,s.jsx)(N,{isOpen:ec,keyName:"Default cho API key mới",policy:ea,setPolicy:eo,onClose:()=>{ex(!1),eo(er||i)},onSave:nf,saving:ei}),(0,s.jsx)(N,{isOpen:!!eP,keyName:eP?.name,policy:e$,setPolicy:eI,onClose:()=>{eO(null),eI(i)},onSave:nN,onClear:nk,saving:eE}),(0,s.jsx)(l.rq,{isOpen:em,onClose:()=>eu(!1),onSelect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&et(e=>c([...e,t]))},onDeselect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&et(e=>c(e).filter(e=>e!==t))},activeProviders:eh,modelAliases:eb,title:"Chọn default models cho API key",addedModelValues:ee,closeOnSelect:!1}),q?(0,s.jsx)(l.uo,{isOpen:!!q,onClose:()=>B(null),onConfirm:q.onConfirm,title:q.title,message:q.message,confirmText:"X\xf3a",cancelText:"Hủy",variant:"danger"}):null]})}},61771:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var s=n(95155),r=n(12115),l=n(35497),a=n(94027);let o="api-keys-bulk-default-models-result";function i(){let[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(!1),[d,c]=(0,r.useState)(""),[x,m]=(0,r.useState)(""),{isAdmin:u}=(0,a.s)();if((0,r.useEffect)(()=>{let e=window.sessionStorage.getItem(o);e&&(window.sessionStorage.removeItem(o),c(e))},[]),!u)return null;let h=async()=>{t(!1),i(!0),c(""),m("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({applyDefaultModelsToExistingKeys:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng th\xeam được default models v\xe0o API key hiện c\xf3");let n=t.apiKeyDefaultModelsApplied||{},s=Number(n.updated||0),r=Number(n.unchanged||0),l=Number(n.legacyFullAccessSkipped||0),a=`Đ\xe3 bổ sung default models cho ${s} API key. ${r} key đ\xe3 c\xf3 đủ model; ${l} key Legacy full access được giữ nguy\xean.`;window.sessionStorage.setItem(o,a),window.location.reload()}catch(e){m(e?.message||"Kh\xf4ng th\xeam được default models v\xe0o API key hiện c\xf3")}finally{i(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 rounded-2xl border border-border bg-surface/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0 text-sm",children:[(0,s.jsx)("div",{className:"font-medium text-text-main",children:"\xc1p Default models cho API key hiện c\xf3"}),(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Chỉ th\xeam model c\xf2n thiếu; kh\xf4ng x\xf3a model đ\xe3 g\xe1n v\xe0 kh\xf4ng thu hẹp quyền của key Legacy full access."}),d?(0,s.jsx)("div",{className:"mt-1 text-xs text-emerald-700 dark:text-emerald-300",children:d}):null,x?(0,s.jsx)("div",{className:"mt-1 text-xs text-red-600",children:x}):null]}),(0,s.jsx)(l.$n,{size:"sm",variant:"outline",onClick:()=>t(!0),disabled:n,children:n?"Đang th\xeam...":"Th\xeam Default models v\xe0o tất cả API key"})]}),(0,s.jsx)(l.uo,{isOpen:e,onClose:()=>!n&&t(!1),onConfirm:h,title:"Th\xeam Default models v\xe0o tất cả API key?",message:"Hệ thống sẽ th\xeam c\xe1c Default models đ\xe3 lưu v\xe0o mọi API key c\xf3 danh s\xe1ch model giới hạn. Model đ\xe3 g\xe1n sẵn vẫn được giữ nguy\xean. API key Legacy full access sẽ kh\xf4ng bị thay đổi để tr\xe1nh v\xf4 t\xecnh thu hẹp quyền truy cập.",confirmText:"Th\xeam v\xe0o tất cả",cancelText:"Hủy"})]})}},72143:()=>{},84578:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,72143,23)),Promise.resolve().then(n.bind(n,56484)),Promise.resolve().then(n.bind(n,61771)),Promise.resolve().then(n.bind(n,87572))},87572:(e,t,n)=>{"use strict";n.d(t,{default:()=>I});var s=n(95155),r=n(12115),l=n(46442),a=n(98500),o=n.n(a),i=n(35497),d=n(94027),c=n(11059),x=n(9385);let m="https://models-gateway.example.com";function u(e,t=""){return String(e??"").trim()||t}function h(e){let t=String(e??"").trim().replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:t}function p(e){return String(e??"").replace(/`/g,"``").replace(/"/g,'`"')}function b(e){let t=new Map;for(let n of x.pA){let s=(0,x.cL)(e,n);if(!s)continue;let r=t.get(s);r?(r.roles.push(n),r.contextWindow=Math.max(r.contextWindow,(0,x.u1)(e,n))):t.set(s,{model:s,roles:[n],contextWindow:(0,x.u1)(e,n)})}return[...t.values()]}let g={claude:"Claude Code",opencode:"OpenCode",codex:"Codex",qwen:"Qwen Code"},f=new Set(["claude","codex"]);function j(e){let t=String(e||"");return t?t.length<=12?`${t.slice(0,4)}••••`:`${t.slice(0,8)}••••••••${t.slice(-4)}`:""}function y(e,t){return t?String(e||"").split(t).join(j(t)):e}async function v(e,t){if(!e||!t)return null;let n=new URLSearchParams({page:"1",pageSize:"25",q:t}),s=await fetch(`/api/keys?${n.toString()}`,{cache:"no-store"});return s.ok&&((await s.json().catch(()=>({}))).keys||[]).find(t=>t?.key===e)||null}function N({label:e,model:t,detail:n}){return(0,s.jsxs)("div",{className:"min-w-0 rounded-xl border border-border bg-background px-3 py-2.5",children:[(0,s.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wide text-text-muted",children:e}),(0,s.jsx)("div",{className:"mt-1 truncate font-mono text-xs font-medium text-text-main",title:t||"—",children:t||"—"}),(0,s.jsx)("div",{className:"mt-1 truncate text-[11px] text-text-muted",title:n,children:n})]})}function k({enabled:e,coder:t,apiKey:n,missingModels:r}){return e?t?n?r.length>0?(0,s.jsxs)("div",{className:"min-h-[44px] rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:["API key chưa được cấp quyền cho ",(0,s.jsx)("span",{className:"font-mono",children:r.join(", ")}),". Guide kh\xf4ng tự fallback model kh\xe1c."]}):(0,s.jsxs)("div",{className:"flex min-h-[44px] items-center gap-2 rounded-xl border border-emerald-500/20 bg-emerald-500/5 px-3 py-2 text-xs text-text-muted",children:[(0,s.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-emerald-500"}),"Config sẵn s\xe0ng để copy v\xe0 \xe1p dụng."]}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600",children:"Kh\xf4ng đọc được API key từ modal hiện tại."}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Chưa cấu h\xecnh Coder model cho profile n\xe0y."}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-dashed border-border px-3 py-2 text-xs text-text-muted",children:"Profile đang tắt. Admin c\xf3 thể bật trong CLI Model Settings."})}function w({tool:e,profile:t}){if("claude"!==e&&"codex"!==e)return null;let n=(0,x.u1)(t,"coder"),r=(0,x.u1)(t,"fast"),l=(0,x.u1)(t,"thinking"),a=Number(t?.autoCompactPct||75),o=(0,x.Zn)(t),i=new Set([n,r,l]).size>1;return(0,s.jsx)("div",{className:"mt-3 overflow-hidden rounded-xl border-2 border-amber-400/60 bg-amber-500/10 shadow-sm dark:border-amber-400/40",children:(0,s.jsxs)("div",{className:"flex gap-3 p-3 sm:p-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[22px] text-amber-600 dark:text-amber-300",children:"warning"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-amber-800 dark:text-amber-200",children:"Quan trọng khi đổi model Local"}),"claude"===e?(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-amber-900/90 dark:text-amber-100/90",children:["Config b\xean dưới đang đặt ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["CLAUDE_CODE_AUTO_COMPACT_WINDOW=",n]})," theo ",(0,s.jsx)("strong",{children:"Coder"}),". Nếu bạn đổi model Local đang sử dụng sang Fast, Thinking hoặc model kh\xe1c c\xf3 Max Context kh\xe1c, ",(0,s.jsx)("strong",{children:"kh\xf4ng chỉ đổi t\xean model"})," — h\xe3y sửa ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"CLAUDE_CODE_AUTO_COMPACT_WINDOW"})," theo đ\xfang Max Context của model đ\xf3 trước khi chạy. ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE"})," hiện l\xe0 ",(0,s.jsxs)("strong",{children:[a,"%"]}),"."]}):(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-amber-900/90 dark:text-amber-100/90",children:["Config b\xean dưới đang t\xednh theo ",(0,s.jsx)("strong",{children:"Coder"}),": ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["model_context_window=",n]})," v\xe0 ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["model_auto_compact_token_limit=",o]}),". Nếu bạn đổi model Local đang sử dụng, ",(0,s.jsx)("strong",{children:"kh\xf4ng chỉ đổi t\xean model"})," — h\xe3y cập nhật ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"model_context_window"})," theo Max Context mới v\xe0 t\xednh lại ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"model_auto_compact_token_limit"})," theo mức ",(0,s.jsxs)("strong",{children:[a,"%"]}),"."]}),i?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 rounded-lg border border-amber-400/30 bg-background/70 px-2.5 py-2 font-mono text-[11px] text-amber-900 dark:text-amber-100",children:[(0,s.jsxs)("span",{children:["Coder: ",n.toLocaleString()]}),(0,s.jsxs)("span",{children:["Fast: ",r.toLocaleString()]}),(0,s.jsxs)("span",{children:["Thinking: ",l.toLocaleString()]})]}):null]})]})})}function C({activeView:e,setActiveView:t,configMeta:n,config:r,applyCommands:l}){let a="config"===e;return(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-background",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-surface/60 px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"inline-flex w-fit rounded-lg border border-border bg-background p-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t("config"),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${a?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-main"}`,children:n.label}),(0,s.jsx)("button",{type:"button",onClick:()=>t("powershell"),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${!a?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-main"}`,children:"PowerShell"})]}),(0,s.jsx)("span",{className:"truncate font-mono text-[11px] text-text-muted",children:a?n.path:"Apply config on Windows"})]}),(0,s.jsx)("pre",{className:"h-[340px] overflow-auto p-4 text-[11px] leading-5 text-text-main custom-scrollbar",children:a?r:l})]})}function A({scope:e,profile:t,tool:n,baseUrl:l,apiKey:a,selectedKey:o,copied:d,copy:c}){let[f,j]=(0,r.useState)("config"),v="local"===e,S=t?.enabled===!0,P=(0,x.cL)(t,"coder"),O=(0,x.cL)(t,"fast",P),$=(0,x.cL)(t,"thinking",P),I=function(e){switch(e){case"claude":return{label:"settings.json",path:"%USERPROFILE%\\.claude\\settings.json",command:"claude"};case"opencode":return{label:"opencode.json",path:"%APPDATA%\\opencode\\opencode.json",command:"opencode"};case"codex":return{label:"config.toml",path:"%USERPROFILE%\\.codex\\config.toml",command:"codex"};case"qwen":return{label:"settings.json",path:"%USERPROFILE%\\.qwen\\settings.json",command:"qwen"};default:return{label:"config",path:"",command:""}}}(n),E=S&&!!P&&!!a,L=E?function({tool:e,baseUrl:t,apiKey:n,profile:s,scope:r}){switch(e){case"claude":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=(0,x.cL)(n,"fast",r),a=(0,x.cL)(n,"thinking",r),o={ANTHROPIC_BASE_URL:String(u(e,m)??"").trim().replace(/\/+$/,"").replace(/\/v1$/,""),ANTHROPIC_AUTH_TOKEN:u(t,"sk-xxxxx"),ANTHROPIC_MODEL:r,ANTHROPIC_SMALL_FAST_MODEL:l,ANTHROPIC_DEFAULT_OPUS_MODEL:a,ANTHROPIC_DEFAULT_SONNET_MODEL:r,ANTHROPIC_DEFAULT_HAIKU_MODEL:l};return"local"===s&&(o.CLAUDE_CODE_AUTO_COMPACT_WINDOW=String((0,x.u1)(n,"coder")),o.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=String(n.autoCompactPct||75)),JSON.stringify({env:o,theme:"dark",hasCompletedOnboarding:!0},null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});case"opencode":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=(0,x.cL)(n,"fast",r),a=(0,x.cL)(n,"thinking",r),o={};for(let e of b(n)){let t={name:e.model};"local"===s&&(t.limit={context:e.contextWindow,output:Math.min(3e4,Math.max(4096,Math.floor(e.contextWindow/4)))}),o[e.model]=t}let i={explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`bluerouter/${l}`}};a&&a!==r&&(i.thinking={description:"Thinking/reasoning subagent",mode:"subagent",model:`bluerouter/${a}`});let d={$schema:"https://opencode.ai/config.json",provider:{bluerouter:{npm:"@ai-sdk/openai-compatible",name:"BlueRouter",options:{baseURL:h(u(e,m)),apiKey:u(t,"sk-xxxxx")},models:o}},model:`bluerouter/${r}`,small_model:`bluerouter/${l}`,agent:i};return"local"===s&&(d.compaction={auto:!0,prune:!0,reserved:Math.max(4096,(0,x.u1)(n,"coder")-(0,x.Zn)(n))}),JSON.stringify(d,null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});case"codex":return function({baseUrl:e,profile:t,scope:n}){let s=(0,x.cL)(t,"coder","programmer"),r=(0,x.cL)(t,"fast",s),l=(0,x.cL)(t,"thinking",s),a=[`model = "${s}"`,'model_provider = "bluerouter"'];return"local"===n&&a.push(`model_context_window = ${(0,x.u1)(t,"coder")}`,`model_auto_compact_token_limit = ${(0,x.Zn)(t)}`,'model_auto_compact_token_limit_scope = "total"',"model_catalog_json = 'model_catalog.json'"),a.push("","[model_providers.bluerouter]",'name = "BlueRouter"',`base_url = "${h(u(e,m))}"`,'env_key = "OPENAI_API_KEY"','wire_api = "responses"'),r&&a.push("","[profiles.fast]",`model = "${r}"`,'model_provider = "bluerouter"'),l&&l!==r&&a.push("","[profiles.thinking]",`model = "${l}"`,'model_provider = "bluerouter"'),a.join("\n")}({baseUrl:t,profile:s,scope:r});case"qwen":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=b(n).map(t=>{let n=new Set(t.roles),r=n.has("fast")&&!n.has("coder")&&!n.has("thinking"),l={timeout:r?6e4:12e4,maxRetries:2,samplingParams:{temperature:.2,...r?{max_tokens:4096}:{}}};return r&&(l.reasoning=!1),"local"===s&&(l.contextWindowSize=t.contextWindow),{id:t.model,name:t.model,envKey:"OPENAI_API_KEY",baseUrl:h(u(e,m)),generationConfig:l}});return JSON.stringify({env:{OPENAI_API_KEY:u(t,"sk-xxxxx")},security:{auth:{selectedType:"openai"}},model:{name:r},modelProviders:{openai:l}},null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});default:return""}}({tool:n,baseUrl:l,apiKey:a,profile:t,scope:e}):"",T=E?function({tool:e,config:t,apiKey:n,baseUrl:s,profile:r}){let l=(0,x.cL)(r,"coder","programmer"),a=p(n),o=p(h(u(s,m))),i=p(l),d="$utf8NoBom = New-Object System.Text.UTF8Encoding $false";switch(e){case"claude":return["mkdir $env:USERPROFILE\\.claude -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.claude\\settings.json", @\'',t,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nclaude"].join("\n");case"opencode":return["mkdir $env:APPDATA\\opencode -Force",d,'[System.IO.File]::WriteAllText("$env:APPDATA\\opencode\\opencode.json", @\'',t,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nopencode"].join("\n");case"codex":return["mkdir $env:USERPROFILE\\.codex -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',t,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${a}"`,`setx OPENAI_API_KEY "${a}"`,"cd D:\\path\\to\\your-project\ncodex"].join("\n");case"qwen":return["mkdir $env:USERPROFILE\\.qwen -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.qwen\\settings.json", @\'',t,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${a}"`,`$env:OPENAI_BASE_URL = "${o}"`,`$env:OPENAI_MODEL = "${i}"`,`setx OPENAI_API_KEY "${a}"`,`setx OPENAI_BASE_URL "${o}"`,`setx OPENAI_MODEL "${i}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n");default:return""}}({tool:n,config:L,apiKey:a,baseUrl:l,profile:t}):"",_=Array.isArray(o?.allowedModels)?o.allowedModels:[],M=_.length>0?(0,x.FY)(t).filter(e=>!_.includes(e)):[],K=`${n}-${e}`,F=v?`${t?.autoCompactPct||75}% \xb7 ${(0,x.Zn)(t).toLocaleString()} tokens`:"Managed by cloud provider";return(0,s.jsxs)("section",{className:"flex min-w-0 flex-col rounded-2xl border border-border bg-surface/40 p-4 shadow-sm sm:p-5",children:[(0,s.jsxs)("div",{className:"flex min-h-[72px] items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-border bg-background px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.12em] text-text-muted",children:v?"Local":"Cloud"}),(0,s.jsx)("h3",{className:"truncate text-base font-semibold text-text-main",children:t?.providerName||(v?"Local AI":"Cloud AI")})]}),(0,s.jsx)("p",{className:"mt-1.5 text-xs leading-5 text-text-muted",children:v?"Local model, context v\xe0 auto-compact do admin quản l\xfd.":`Cloud mapping ri\xeang cho ${g[n]}; kh\xf4ng d\xf9ng chung model với CLI kh\xe1c.`})]}),(0,s.jsx)("span",{className:`shrink-0 rounded-full px-2.5 py-1 text-[11px] font-medium ${S?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-300":"bg-background text-text-muted"}`,children:S?"Enabled":"Disabled"})]}),(0,s.jsxs)("div",{className:"mt-4 grid gap-2 sm:grid-cols-3",children:[(0,s.jsx)(N,{label:"Coder",model:P,detail:v&&P?`${(0,x.u1)(t,"coder").toLocaleString()} tokens`:"Primary model"}),(0,s.jsx)(N,{label:"Fast",model:O,detail:v&&O?`${(0,x.u1)(t,"fast").toLocaleString()} tokens`:"Fast profile"}),(0,s.jsx)(N,{label:"Thinking",model:$,detail:v&&$?`${(0,x.u1)(t,"thinking").toLocaleString()} tokens`:"Reasoning profile"})]}),(0,s.jsxs)("div",{className:"mt-2 flex min-h-[40px] items-center justify-between gap-3 rounded-xl border border-border bg-background px-3 py-2 text-xs",children:[(0,s.jsx)("span",{className:"text-text-muted",children:v?"Auto compact":"Context policy"}),(0,s.jsx)("span",{className:"truncate text-right font-medium text-text-main",children:F})]}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(k,{enabled:S,coder:P,apiKey:a,missingModels:M})}),v&&E&&"claude"===n?(0,s.jsx)(w,{tool:n,profile:t}):null,E?(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)(C,{activeView:f,setActiveView:j,configMeta:I,config:y(L,a),applyCommands:y(T,a)}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-end gap-2",children:[(0,s.jsx)(i.$n,{variant:"outline",size:"sm",onClick:()=>c(T,`${K}-apply`),children:d===`${K}-apply`?"Đ\xe3 copy PowerShell":"Copy PowerShell"}),(0,s.jsx)(i.$n,{size:"sm",onClick:()=>c(L,`${K}-config`),children:d===`${K}-config`?"Đ\xe3 copy config":`Copy ${I.label}`})]})]}):null]})}function S({tool:e,seed:t}){let[n,l]=(0,r.useState)(()=>(0,x.j5)(x.O0)),[a,m]=(0,r.useState)(null),[u,h]=(0,r.useState)(!0),[p,b]=(0,r.useState)(""),{copied:y,copy:N}=(0,c.C)(),{isAdmin:k,canManageApiKeys:w}=(0,d.s)(),C=String(t?.apiKey||""),P=String(t?.baseUrl||""),O=String(t?.keyName||""),$=g[e]||"CLI",I=(0,r.useMemo)(()=>(function(e){switch(e){case"claude":return"# C\xe1ch 1: PowerShell installer\nirm https://claude.ai/install.ps1 | iex\n\n# C\xe1ch 2: CMD installer\ncurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd\n\n# C\xe1ch 3: npm (cần c\xe0i Node.js trước)\nnpm install -g @anthropic-ai/claude-code\nclaude --version";case"opencode":return"npm install -g opencode-ai\nopencode --version";case"codex":return'# C\xe0i Codex kh\xf4ng cần Node/npm (cần sh, v\xed dụ Git Bash hoặc WSL)\ncurl -fsSL https://chatgpt.com/codex/install.sh | sh\ncodex --version\n\n# Lưu API key vĩnh viễn cho Windows user hiện tại\n[Environment]::SetEnvironmentVariable("OPENAI_API_KEY","sk-xxx","User")';case"qwen":return"npm install -g @qwen-code/qwen-code\nqwen --version";default:return""}})(e).replaceAll("sk-xxx",C),[e,C]),E=f.has(e),L=(0,x.Ek)(n,e);return(0,r.useEffect)(()=>{let e=!1;return h(!0),b(""),Promise.allSettled([fetch("/api/cli-model-profiles",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được CLI model profiles");return(0,x.j5)(t.profiles||{})}),v(C,O)]).then(([t,n])=>{e||("fulfilled"===t.status?l(t.value):b(t.reason?.message||"Kh\xf4ng tải được CLI model profiles; đang d\xf9ng local defaults."),"fulfilled"===n.status&&m(n.value),h(!1))}),()=>{e=!0}},[C,O,e]),(0,s.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-surface/35 p-4 sm:p-5",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2.5 py-1 text-[11px] font-semibold text-primary",children:$}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Configuration guide"})]}),(0,s.jsx)("p",{className:"mt-2 max-w-4xl text-sm leading-6 text-text-muted",children:E?`Chọn Local hoặc ${$} Cloud. Hai profile độc lập nhưng d\xf9ng chung API key v\xe0 gateway.`:`${$} chỉ sử dụng Local Model profile; Cloud Provider kh\xf4ng \xe1p dụng cho tool n\xe0y.`}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,s.jsxs)("span",{className:"rounded-lg border border-border bg-background px-2.5 py-1.5",children:["API key ",(0,s.jsx)("span",{className:"ml-1 font-mono text-text-main",children:j(C)||"kh\xf4ng x\xe1c định"})]}),(0,s.jsxs)("span",{className:"max-w-full rounded-lg border border-border bg-background px-2.5 py-1.5",children:["Base URL ",(0,s.jsx)("span",{className:"ml-1 break-all font-mono text-text-main",children:P||"/v1"})]})]})]}),k||w?(0,s.jsxs)(o(),{href:"/dashboard/cli-tools/model-profiles",className:"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-xl border border-border bg-background px-3 py-2 text-sm font-medium text-text-main transition hover:border-primary/50 hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"}),"CLI Model Settings"]}):null]})}),u?(0,s.jsx)("div",{className:"rounded-xl border border-dashed border-border p-4 text-center text-sm text-text-muted",children:"Đang tải CLI model settings..."}):null,p?(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:p}):null,E?(0,s.jsxs)("div",{className:"grid items-stretch gap-4 xl:grid-cols-2",children:[(0,s.jsx)(A,{scope:"local",profile:n.local,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N}),(0,s.jsx)(A,{scope:"cloud",profile:L,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N})]}):(0,s.jsx)("div",{className:"mx-auto max-w-4xl",children:(0,s.jsx)(A,{scope:"local",profile:n.local,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N})}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/35 p-4 sm:p-5",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-semibold text-text-main",children:["C\xe0i ",$," tr\xean Windows"]}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-5 text-text-muted",children:E?"Lệnh c\xe0i d\xf9ng chung cho Local v\xe0 Cloud. Sau khi c\xe0i, chọn tab PowerShell trong profile muốn \xe1p dụng.":"Sau khi c\xe0i, chọn tab PowerShell trong Local profile ph\xeda tr\xean."})]}),(0,s.jsx)(i.$n,{variant:"outline",size:"sm",onClick:()=>N(I,`${e}-install`),children:y===`${e}-install`?"Đ\xe3 copy lệnh c\xe0i":"Copy lệnh c\xe0i"})]}),(0,s.jsx)("pre",{className:"mt-3 max-h-[150px] overflow-auto rounded-xl border border-border bg-background p-3 text-[11px] leading-5 text-text-main custom-scrollbar",children:I})]}),(0,s.jsx)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 px-3 py-2.5 text-xs leading-5 text-text-muted",children:"CLI Model Settings chỉ ảnh hưởng config/hướng dẫn sinh trong Dashboard. Kh\xf4ng chỉnh request pipeline, provider routing, combo, load balancing hoặc model routing runtime."})]})}let P="/api/cli-model-profiles/model-catalog";function O(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return fetch(`${P}?meta=1`,{cache:"no-store"}).then(async n=>{let s=await n.json().catch(()=>({}));!e&&n.ok&&t(s.catalog||null)}).catch(()=>{}),()=>{e=!0}},[]),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:"Local only"}),(0,s.jsx)("div",{className:"text-sm font-semibold text-text-main",children:"Codex model_catalog.json"})]}),(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-text-muted",children:["Local config d\xf9ng ",(0,s.jsx)("code",{className:"rounded bg-surface px-1 font-mono",children:"model_catalog_json = 'model_catalog.json'"}),". Download file v\xe0 đặt cạnh ",(0,s.jsx)("code",{className:"rounded bg-surface px-1 font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),", sau đ\xf3 restart Codex. Cloud Codex kh\xf4ng d\xf9ng file n\xe0y."]}),e?.available?(0,s.jsxs)("a",{href:P,download:"model_catalog.json",className:"mt-2 inline-flex items-center gap-1.5 rounded-lg border border-border px-2.5 py-1.5 text-xs font-medium text-primary transition hover:border-primary/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"download"}),"Download model_catalog.json"]}):(0,s.jsx)("div",{className:"mt-2 text-xs text-amber-700 dark:text-amber-300",children:"Admin chưa upload model_catalog.json."})]})}let $={"Claude Code Settings":"claude","OpenCode Settings":"opencode","Codex Settings":"codex","Qwen Code Settings":"qwen"};function I({children:e}){let t=(0,r.useCallback)(({title:e,children:t})=>{let n=$[String(e||"")];if(!n)return null;let l=function(e){let t=[];!function e(t,n){if(null!=t&&"boolean"!=typeof t){if("string"==typeof t||"number"==typeof t)return void n.push(String(t));if(Array.isArray(t)){for(let s of t)e(s,n);return}(0,r.isValidElement)(t)&&e(t.props?.children,n)}}(e,t);let n=t.join("\n"),s=n.match(/\bsk-[A-Za-z0-9._~-]{8,}\b/)?.[0]||"",l="";for(let e=0;e<t.length-1;e+=1){if("API Key"!==String(t[e]).trim())continue;let n=String(t[e+1]||"").trim();if(n&&!n.startsWith("sk-")){l=n;break}}let a=(n.match(/https?:\/\/[^\s\"'<>]+/g)||[]).map(e=>e.replace(/[),.;]+$/,""));return{apiKey:s,baseUrl:a.find(e=>/\/v1\/?$/i.test(e))||a.find(e=>/\/v1(?:\/|$)/i.test(e))||"",keyName:l}}(t);return{size:"full",className:"!max-w-6xl",footer:null,children:(0,s.jsxs)("div",{className:"space-y-4",children:["codex"===n?(0,s.jsx)(O,{}):null,(0,s.jsx)(S,{tool:n,seed:l},`${n}:${l.apiKey}`)]})}},[]);return(0,s.jsx)(l.j,{resolver:t,children:e})}}},e=>{e.O(0,[646,6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=84578)),_N_E=e.O()}]);
24
+ C\xf3 thể d\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`);X(!0),O("");try{let e=tF?d(K||T||tK):void 0,t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.trim(),ownerUser:e})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng tạo được API key");D(n.key),L(""),R(""),I(!1),tP(1),await nd()}catch(e){O(e.message||"Kh\xf4ng tạo được API key")}finally{X(!1)}}},ny=async(e,t)=>{let n=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await n.json().catch(()=>({}));return n.ok?(await nd(),!0):(O(s.error||"Kh\xf4ng cập nhật được API key"),!1)},nv=async()=>{if(!eN)return;let e=c(ew);if(0===e.length)return void O("H\xe3y chọn \xedt nhất một model trước khi lưu quyền truy cập API key.");eS(!0),O("");try{await ny(eN.id,{allowedModels:e})&&(ek(null),eC([]))}finally{eS(!1)}},nN=async e=>{if(eP){eL(!0),O("");try{await ny(eP.id,{limits:f(e)})&&(eO(null),eI(i))}finally{eL(!1)}}},nk=async()=>{if(eP){eL(!0),O("");try{await ny(eP.id,{limits:{}})&&(eO(null),eI(i))}finally{eL(!1)}}},nw=async e=>{if(!eT)return!1;eD(!0),O("");try{let t=await fetch(`/api/keys/${eT.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Kh\xf4ng lưu được cấu h\xecnh Caveman");return await nd(),e_(null),!0}catch(t){let e=t?.message||"Kh\xf4ng lưu được cấu h\xecnh Caveman";throw O(e),Error(e)}finally{eD(!1)}};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Quản l\xfd API Keys"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:tF?"Bảng quản trị API key c\xf3 t\xecm kiếm, lọc trạng th\xe1i v\xe0 ph\xe2n trang để kh\xf4ng render qu\xe1 nhiều key c\xf9ng l\xfac.":`Bạn c\xf3 thể quản l\xfd API key của t\xe0i khoản m\xecnh. Mỗi user thường sở hữu tối đa ${tR} API keys. D\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(l.$n,{variant:"outline",onClick:nd,disabled:v,children:v?"Đang tải...":"Refresh"}),(0,s.jsx)(l.$n,{onClick:()=>{I(!0),!T&&tK&&M(tK)},disabled:tB,children:"Tạo API Key"})]})]}),S?(0,s.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600 whitespace-pre-line",children:S}):null,(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsx)(w,{label:"Tổng API keys",value:tD,hint:tF?"To\xe0n hệ thống":`${tU}/${tR} key của bạn`}),(0,s.jsx)(w,{label:"Đang hiển thị",value:tq,hint:ni?"Theo bộ lọc hiện tại":"Kh\xf4ng filter"}),(0,s.jsx)(w,{label:"Page size",value:tO,hint:"Chỉ tải số d\xf2ng của trang hiện tại"})]}),tF?null:(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Giới hạn API key theo user"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["T\xe0i khoản của bạn đang c\xf3 ",tU,"/",tR," API keys. Key bị disabled vẫn được t\xednh v\xe0o giới hạn."]})]}),(0,s.jsx)("span",{className:"rounded-full border border-border bg-surface px-3 py-1 text-sm",children:tB?"Đ\xe3 đạt giới hạn":"C\xf2n c\xf3 thể tạo th\xeam"})]})}),(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Default models cho API key mới"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"API key mới sẽ mặc định được d\xf9ng c\xe1c model n\xe0y. Cần cấu h\xecnh \xedt nhất một default model trước khi tạo API key."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[Z.length>0?(0,s.jsx)(j,{models:Z,emptyLabel:"Chưa cấu h\xecnh default models"}):(0,s.jsx)("span",{className:"text-sm text-red-600",children:"Chưa cấu h\xecnh default models"}),tF?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eu(!0),nc()},children:ee.length>0?`Đ\xe3 chọn ${ee.length} model`:"Chọn default models..."}),(0,s.jsx)(l.$n,{size:"sm",onClick:nm,disabled:!na||en||0===ee.length,children:en?"Đang lưu...":"Lưu"})]}):null]}),tF?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:ey?"Đang tải danh s\xe1ch model...":"Danh s\xe1ch model chỉ tải khi mở bộ chọn để trang load nhanh hơn."}):null]})}),(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Default policy cho API key mới"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Policy n\xe0y được tự động g\xe1n cho key mới. Policy ri\xeang từng key vẫn c\xf3 thể override sau khi tạo."})]}),tF?(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eo(f(er||i,i)),ex(!0)},children:"Chỉnh default policy"}):null]}),(0,s.jsx)(y,{limits:er,showThinking:tF,showOutputLimit:tF})]})})]}),tF?(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Giới hạn số API key cho mỗi user"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Global default \xe1p dụng cho mọi user thường. Per-user override sẽ ghi đ\xe8 global cho user cụ thể (nhập 0 hoặc bấm X\xf3a để bỏ override v\xe0 quay lại global)."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,s.jsxs)("label",{className:"flex-1",children:[(0,s.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Global default (\xe1p dụng cho user kh\xf4ng c\xf3 override)"}),(0,s.jsx)("input",{type:"number",min:"1",value:e0,onChange:e=>e1(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),(0,s.jsx)(l.$n,{onClick:nh,disabled:e2||Number.parseInt(e0,10)===eZ,children:e2?"Đang lưu...":"Lưu global"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border p-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Per-user override"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Ghi đ\xe8 global cho user cụ thể. Override sẽ \xe1p dụng lu\xf4n cả cho key hiện c\xf3 (chặn tạo key mới nếu vượt)."}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)("input",{value:e7,onChange:e=>e8(e.target.value),placeholder:"username hoặc email",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)("input",{type:"number",min:"1",value:e6,onChange:e=>e9(e.target.value),placeholder:"Giới hạn key",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary sm:w-40"}),(0,s.jsx)(l.$n,{onClick:nb,disabled:te,children:te?"Đang lưu...":"Th\xeam / Cập nhật"})]}),0===Object.keys(e5).length?(0,s.jsxs)("div",{className:"mt-3 rounded-xl border border-dashed border-border bg-surface p-3 text-xs text-text-muted",children:["Chưa c\xf3 user n\xe0o được override. Global = ",eZ," key."]}):(0,s.jsx)("div",{className:"mt-3 overflow-hidden rounded-xl border border-border",children:(0,s.jsxs)("table",{className:"min-w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-surface text-xs text-text-muted",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"User"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Giới hạn"}),(0,s.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"H\xe0nh động"})]})}),(0,s.jsx)("tbody",{children:Object.entries(e5).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>(0,s.jsxs)("tr",{className:"border-t border-border",children:[(0,s.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e}),(0,s.jsx)("td",{className:"px-3 py-2",children:t}),(0,s.jsx)("td",{className:"px-3 py-2 text-right",children:(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:te,onClick:()=>ng(e),children:"X\xf3a"})})]},e))})]})})]})]})}):null,(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"Th\xf4ng tin API endpoint"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng API key b\xean dưới để gọi gateway theo chuẩn OpenAI-compatible. Endpoint lấy theo domain hiện tại của dashboard."})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Chat Completions"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tH})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>tT(tz,"api-base-url"),children:"api-base-url"===tL?"Đ\xe3 copy Base URL":"Copy Base URL"}),(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>tT(tH,"api-chat-endpoint"),children:"api-chat-endpoint"===tL?"Đ\xe3 copy Endpoint":"Copy Endpoint"})]})]})}),U?(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"font-medium",children:"Đ\xe3 tạo API key"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-sm",children:U}),(0,s.jsxs)("div",{className:"text-sm text-text-muted",children:["H\xe3y copy ngay. Key mới mặc định được d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard, trừ khi admin chỉnh quyền model/policy.",(0,s.jsx)(j,{models:Z,emptyLabel:"default models"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{size:"sm",onClick:()=>tT(U,"created"),children:"created"===tL?"Đ\xe3 copy":"Copy"}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>D(""),children:"Đ\xf3ng"})]})]})}):null,(0,s.jsx)(l.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-end xl:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Danh s\xe1ch API keys"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xecm theo t\xean key, owner, model, id hoặc một phần API key. Backend chỉ trả về page hiện tại."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:tv,onChange:e=>tN(e.target.value),placeholder:"T\xecm API key, owner, model...",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary sm:w-80"}),(0,s.jsxs)("select",{value:tC,onChange:e=>{tA(e.target.value),tP(1)},className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,s.jsx)("option",{value:"active",children:"Chỉ key đang bật"}),(0,s.jsx)("option",{value:"inactive",children:"Chỉ key đ\xe3 tắt"})]}),ni?(0,s.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{tN(""),tw(""),tA("all"),tP(1)},children:"X\xf3a lọc"}):null]})]}),v?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải API keys..."}):0===p.length?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:ni?"Kh\xf4ng t\xecm thấy API key ph\xf9 hợp bộ lọc.":"Chưa c\xf3 API key n\xe0o."}):(0,s.jsx)(F,{keys:p,copied:tL,copy:tT,isAdmin:tF,globalCavemanEnabled:eq,globalCavemanLevel:ez,onToggleActive:(e,t)=>ny(e,{isActive:t}),onApiTest:tl,onClaudeSettings:to,onOpenCodeSettings:td,onCodexSettings:e=>{tg({type:"",message:""}),tx(e)},onQwenSettings:ty,onRename:(e,t)=>{let n=prompt("T\xean API key mới",t||"");n?.trim()&&ny(e,{name:n.trim()})},onRotate:e=>{e?.id&&B({title:"Đổi API key",message:"Hệ thống sẽ tạo chuỗi API key mới cho record n\xe0y v\xe0 giữ nguy\xean t\xean, owner, model, policy. Key cũ sẽ hết hiệu lực ngay sau khi đổi.",onConfirm:async()=>{B(null),O("");let t=await fetch(`/api/keys/${e.id}/rotate`,{method:"POST"}),n=await t.json().catch(()=>({}));if(!t.ok)return void O(n.error||"Kh\xf4ng đổi được API key");let s=n.rotatedKey||n.key?.key||"";s&&D(s),await nd()}})},onEditModels:e=>{ek(e),eC(c(e.allowedModels)),nc()},onEditPolicy:e=>{tF&&(eO(e),eI(g(e.limits)?f(e.limits):i))},onEditCaveman:e_,onShowCavemanInfo:eK,onCavemanTest:eR,onAssignOwner:(e,t)=>{if(!tF)return;let n=prompt("G\xe1n owner username/email",t||tK||"");null!==n&&ny(e,{ownerUser:d(n)})},onDelete:e=>{B({title:"X\xf3a API Key",message:"Bạn chắc chắn muốn x\xf3a API key n\xe0y? Thao t\xe1c n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.",onConfirm:async()=>{B(null),(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&await nd()}})}}),(0,s.jsx)(C,{pagination:tI,pageSize:tO,onPageChange:tP,onPageSizeChange:e=>{t$(e),tP(1)},loading:v})]})}),(0,s.jsx)(l.aF,{isOpen:$,onClose:()=>I(!1),title:"Tạo API Key",size:"lg",children:(0,s.jsxs)("div",{className:"space-y-4",children:[0===Z.length?(0,s.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:"Admin cần cấu h\xecnh default models trước khi tạo API key."}):tB?(0,s.jsxs)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:["Bạn đ\xe3 đạt giới hạn ",tR," API keys. H\xe3y x\xf3a bớt key cũ trước khi tạo key mới."]}):(0,s.jsxs)("div",{className:"text-sm text-text-muted",children:["Key n\xe0y sẽ được tạo với quyền d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard.",(0,s.jsx)(j,{models:Z})]}),(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean API key"}),(0,s.jsx)("input",{value:E,onChange:e=>L(e.target.value),placeholder:"VD: VSCode, LibreChat, team-user",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),tF?(0,s.jsxs)("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Owner user"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{value:H,onChange:e=>G(e.target.value),placeholder:"Nhập từ kh\xf3a rồi bấm Tải",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>nx(H),disabled:Y,children:Y?"Đang tải":"Tải LDAP"})]}),(0,s.jsxs)("select",{value:T,onChange:e=>M(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,s.jsxs)("option",{value:tK||"",children:["G\xe1n cho t\xf4i (",tK||"local",")"]}),nl.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,s.jsx)("input",{value:K,onChange:e=>R(e.target.value),placeholder:"username hoặc email, kh\xf4ng bắt buộc",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"LDAP kh\xf4ng tự tải khi mở trang để giảm thời gian load. C\xf3 thể nhập owner thủ c\xf4ng hoặc nhập từ kh\xf3a rồi bấm Tải LDAP."})]}):(0,s.jsxs)("p",{className:"rounded-xl border border-border bg-surface p-3 text-sm text-text-muted",children:["Owner: ",tK||"user hiện tại"]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>I(!1),children:"Hủy"}),(0,s.jsx)(l.$n,{onClick:nj,disabled:no,children:V?"Đang tạo...":"Tạo"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tr,onClose:()=>tl(null),title:"API Test bằng curl Windows",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Lệnh dưới đ\xe2y gọi thử endpoint Chat Completions bằng API key đang chọn v\xe0 đ\xe3 nh\xfang sẵn Bearer token."}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tr?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Endpoint"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tH})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model test"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tY})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Lệnh curl cho Windows CMD"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tX})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"D\xe1n lệnh v\xe0o CMD hoặc Windows Terminal để test nhanh. Nếu domain dashboard chạy sau reverse proxy, endpoint sẽ d\xf9ng đ\xfang domain đang mở tr\xean tr\xecnh duyệt."}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>tl(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{onClick:()=>tT(tX,`api-test-curl-${tr?.id||"current"}`),children:tL===`api-test-curl-${tr?.id||"current"}`?"Đ\xe3 copy":"Copy lệnh curl"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!ta,onClose:()=>to(null),title:"Claude Code Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy nội dung JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.claude\\settings.json"})," để Claude Code gọi qua gateway n\xe0y. Model coding d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:tZ.codingModel}),"; model fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:tZ.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:ta?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tZ.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tQ})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Claude Code CLI tr\xean Windows"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t0})]}),(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: 2 d\xf2ng auto-compact/context window đ\xe3 được comment sẵn; chỉ uncomment khi d\xf9ng local model. Nếu c\xe0i bằng npm th\xec m\xe1y cần c\xe0i Node.js trước. Chạy Claude Code trong thư mục project, kh\xf4ng chạy trong C:\\WINDOWS\\system32. Nếu d\xf9ng model fast ri\xeang như programmer-fast th\xec API key n\xe0y cũng phải được ph\xe9p d\xf9ng model đ\xf3 trong cột Model."}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>to(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(t0,`claude-code-help-${ta?.id||"current"}`),children:tL===`claude-code-help-${ta?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(tQ,`claude-code-settings-${ta?.id||"current"}`),children:tL===`claude-code-settings-${ta?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!ti,onClose:()=>td(null),title:"OpenCode Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%APPDATA%\\opencode\\opencode.json"})," hoặc ",(0,s.jsx)("span",{className:"font-mono",children:"opencode.json"})," trong project. Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t1.codingModel}),"; explorer/fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t1.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:ti?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model ch\xednh"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t1.codingModel})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model fast"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t1.fastModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"opencode.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t2})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy OpenCode tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t3})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: API key n\xe0y cần được ph\xe9p gọi cả ",t1.codingModel," v\xe0 ",t1.fastModel,". Nếu OpenCode đang d\xf9ng đường dẫn config kh\xe1c, c\xf3 thể đặt file opencode.json ngay trong thư mục project."]}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>td(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(t3,`opencode-help-${ti?.id||"current"}`),children:tL===`opencode-help-${ti?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(t2,`opencode-settings-${ti?.id||"current"}`),children:tL===`opencode-settings-${ti?.id||"current"}`?"Đ\xe3 copy settings":"Copy opencode.json"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tc,onClose:()=>tx(null),title:"Codex Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy TOML dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),". API key được set bằng biến m\xf4i trường ",(0,s.jsx)("span",{className:"font-mono",children:"OPENAI_API_KEY"}),". Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t6.codingModel}),"; profile fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:t6.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tc?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:t6.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"%USERPROFILE%\\.codex\\config.toml"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:t9})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:["%USERPROFILE%\\.codex\\fast.config.toml — chạy bằng ",(0,s.jsx)("span",{className:"font-mono",children:"codex -p fast"})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ne})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-text-muted",children:m}),tm?.exists?(0,s.jsxs)("a",{href:"/api/codex-catalog/download",download:m,className:"rounded-lg border border-border px-3 py-1.5 text-xs font-medium hover:bg-surface-2",children:["Tải ",m]}):(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Admin chưa tải l\xean"})]}),(0,s.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["File n\xe0y khai metadata model cho Codex: tắt cảnh b\xe1o ",(0,s.jsx)("span",{className:"font-mono",children:"Model metadata for ... not found"}),", khai đ\xfang context window v\xe0 mức reasoning. Tải về rồi để ",(0,s.jsx)("strong",{children:"chung thư mục với config.toml"})," — tức l\xe0 ",(0,s.jsxs)("span",{className:"font-mono",children:["%USERPROFILE%\\.codex\\",m]}),". Kh\xf4ng đổi t\xean file."]}),tm?.exists&&(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsxs)("span",{children:[(tm.sizeBytes/1024).toFixed(0)," KB"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[tm.modelCount," model"]}),tm.updatedAt&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:["cập nhật ",new Date(tm.updatedAt).toLocaleString("vi-VN")]})]})]}),tm?.exists&&tm.slugs?.length>0&&(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1",children:[tm.slugs.map(e=>(0,s.jsx)("span",{className:"rounded-md border border-border px-1.5 py-0.5 font-mono text-[10px] text-text-muted",children:e},e)),tm.truncatedSlugs&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"…"})]}),t_&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[(0,s.jsx)("input",{ref:tf,type:"file",accept:"application/json,.json",className:"hidden",onChange:t7}),(0,s.jsx)(l.$n,{variant:"outline",size:"sm",disabled:th,onClick:()=>tf.current?.click(),children:th?"Đang xử l\xfd...":tm?.exists?"Thay file kh\xe1c":"Tải file l\xean"}),tm?.exists&&(0,s.jsx)(l.$n,{variant:"ghost",size:"sm",disabled:th,onClick:t8,children:"Xo\xe1"}),tb.message&&(0,s.jsx)("span",{className:`text-xs ${"error"===tb.type?"text-red-600":"text-emerald-600"}`,children:tb.message}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Sinh bằng ",(0,s.jsx)("span",{className:"font-mono",children:"scripts/gen-codex-model-catalog.mjs"})," tr\xean m\xe1y đ\xe3 c\xe0i Codex."]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Codex tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:nt})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: c\xe1c d\xf2ng context window v\xe0 auto-compact đ\xe3 được comment sẵn; chỉ uncomment khi d\xf9ng local model. Profile fast nằm ở file ri\xeang ",(0,s.jsx)("span",{className:"font-mono",children:"fast.config.toml"})," (Codex đời mới kh\xf4ng c\xf2n nhận bảng ",(0,s.jsx)("span",{className:"font-mono",children:"[profiles.*]"})," trong config.toml); n\xf3 chỉ ghi đ\xe8 ",(0,s.jsx)("span",{className:"font-mono",children:"model"}),", c\xf2n provider v\xe0 base URL kế thừa từ config.toml. ",tm?.exists?(0,s.jsxs)(s.Fragment,{children:["Nhớ tải ",(0,s.jsx)("span",{className:"font-mono",children:m})," về đặt cạnh config.toml — thiếu file đ\xf3 Codex sẽ b\xe1o lỗi khi khởi động v\xec config.toml đang trỏ tới n\xf3."]}):"Khi admin tải model_catalog.json l\xean, config.toml ở tr\xean sẽ tự c\xf3 th\xeam d\xf2ng model_catalog_json."," Nếu c\xe0i bằng npm th\xec m\xe1y cần c\xe0i Node.js trước. setx chỉ lưu biến m\xf4i trường cho terminal mở sau. Codex d\xf9ng OpenAI-compatible endpoint của BlueRouter."]}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>tx(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(nt,`codex-help-${tc?.id||"current"}`),children:tL===`codex-help-${tc?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(t9,`codex-settings-${tc?.id||"current"}`),children:tL===`codex-settings-${tc?.id||"current"}`?"Đ\xe3 copy settings":"Copy config.toml"})]})]})}),(0,s.jsx)(l.aF,{isOpen:!!tj,onClose:()=>ty(null),title:"Qwen Code Settings",size:"xl",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,s.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.qwen\\settings.json"})," để Qwen Code gọi qua OpenAI-compatible endpoint của BlueRouter. Model ch\xednh d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:nn.codingModel}),"; model fast d\xf9ng ",(0,s.jsx)("span",{className:"font-mono",children:nn.fastModel}),"."]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:tj?.name||"API Key"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tz})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,s.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:nn.codingModel})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,s.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ns})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Qwen Code tr\xean Windows PowerShell"}),(0,s.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:nr})]}),(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo settings.json hợp lệ v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Qwen Code hỗ trợ OpenAI-compatible provider n\xean d\xf9ng tốt với BlueRouter."}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>ty(null),children:"Đ\xf3ng"}),(0,s.jsx)(l.$n,{variant:"outline",onClick:()=>tT(nr,`qwen-code-help-${tj?.id||"current"}`),children:tL===`qwen-code-help-${tj?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,s.jsx)(l.$n,{onClick:()=>tT(ns,`qwen-code-settings-${tj?.id||"current"}`),children:tL===`qwen-code-settings-${tj?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,s.jsx)(_,{apiKey:eF,fallbackModels:Z,onClose:()=>eR(null)}),(0,s.jsx)(P,{apiKey:eT,globalEnabled:eq,globalLevel:ez,onClose:()=>e_(null),onSave:nw,saving:eU}),(0,s.jsx)(P,{apiKey:eM,globalEnabled:eq,globalLevel:ez,onClose:()=>eK(null),onSave:()=>{},saving:!1,infoOnly:!0}),(0,s.jsx)(k,{open:!!eN,keyName:eN?.name,models:ew,setModels:eC,activeProviders:eh,modelAliases:eb,onClose:()=>{ek(null),eC([])},onSave:nv,saving:eA,personalOnly:!tF,extraModels:Z}),(0,s.jsx)(N,{isOpen:ec,keyName:"Default cho API key mới",policy:ea,setPolicy:eo,onClose:()=>{ex(!1),eo(er||i)},onSave:nf,saving:ei}),(0,s.jsx)(N,{isOpen:!!eP,keyName:eP?.name,policy:e$,setPolicy:eI,onClose:()=>{eO(null),eI(i)},onSave:nN,onClear:nk,saving:eE}),(0,s.jsx)(l.rq,{isOpen:em,onClose:()=>eu(!1),onSelect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&et(e=>c([...e,t]))},onDeselect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&et(e=>c(e).filter(e=>e!==t))},activeProviders:eh,modelAliases:eb,title:"Chọn default models cho API key",addedModelValues:ee,closeOnSelect:!1}),q?(0,s.jsx)(l.uo,{isOpen:!!q,onClose:()=>B(null),onConfirm:q.onConfirm,title:q.title,message:q.message,confirmText:"X\xf3a",cancelText:"Hủy",variant:"danger"}):null]})}},61771:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var s=n(95155),r=n(12115),l=n(35497),a=n(94027);let o="api-keys-bulk-default-models-result";function i(){let[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(!1),[d,c]=(0,r.useState)(""),[x,m]=(0,r.useState)(""),{isAdmin:u}=(0,a.s)();if((0,r.useEffect)(()=>{let e=window.sessionStorage.getItem(o);e&&(window.sessionStorage.removeItem(o),c(e))},[]),!u)return null;let h=async()=>{t(!1),i(!0),c(""),m("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({applyDefaultModelsToExistingKeys:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng th\xeam được default models v\xe0o API key hiện c\xf3");let n=t.apiKeyDefaultModelsApplied||{},s=Number(n.updated||0),r=Number(n.unchanged||0),l=Number(n.legacyFullAccessSkipped||0),a=`Đ\xe3 bổ sung default models cho ${s} API key. ${r} key đ\xe3 c\xf3 đủ model; ${l} key Legacy full access được giữ nguy\xean.`;window.sessionStorage.setItem(o,a),window.location.reload()}catch(e){m(e?.message||"Kh\xf4ng th\xeam được default models v\xe0o API key hiện c\xf3")}finally{i(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 rounded-2xl border border-border bg-surface/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0 text-sm",children:[(0,s.jsx)("div",{className:"font-medium text-text-main",children:"\xc1p Default models cho API key hiện c\xf3"}),(0,s.jsx)("div",{className:"text-xs text-text-muted",children:"Chỉ th\xeam model c\xf2n thiếu; kh\xf4ng x\xf3a model đ\xe3 g\xe1n v\xe0 kh\xf4ng thu hẹp quyền của key Legacy full access."}),d?(0,s.jsx)("div",{className:"mt-1 text-xs text-emerald-700 dark:text-emerald-300",children:d}):null,x?(0,s.jsx)("div",{className:"mt-1 text-xs text-red-600",children:x}):null]}),(0,s.jsx)(l.$n,{size:"sm",variant:"outline",onClick:()=>t(!0),disabled:n,children:n?"Đang th\xeam...":"Th\xeam Default models v\xe0o tất cả API key"})]}),(0,s.jsx)(l.uo,{isOpen:e,onClose:()=>!n&&t(!1),onConfirm:h,title:"Th\xeam Default models v\xe0o tất cả API key?",message:"Hệ thống sẽ th\xeam c\xe1c Default models đ\xe3 lưu v\xe0o mọi API key c\xf3 danh s\xe1ch model giới hạn. Model đ\xe3 g\xe1n sẵn vẫn được giữ nguy\xean. API key Legacy full access sẽ kh\xf4ng bị thay đổi để tr\xe1nh v\xf4 t\xecnh thu hẹp quyền truy cập.",confirmText:"Th\xeam v\xe0o tất cả",cancelText:"Hủy"})]})}},72143:()=>{},84578:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,72143,23)),Promise.resolve().then(n.bind(n,56484)),Promise.resolve().then(n.bind(n,61771)),Promise.resolve().then(n.bind(n,87572))},87572:(e,t,n)=>{"use strict";n.d(t,{default:()=>I});var s=n(95155),r=n(12115),l=n(46442),a=n(98500),o=n.n(a),i=n(35497),d=n(94027),c=n(11059),x=n(9385);let m="https://models-gateway.example.com";function u(e,t=""){return String(e??"").trim()||t}function h(e){let t=String(e??"").trim().replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:t}function p(e){return String(e??"").replace(/`/g,"``").replace(/"/g,'`"')}function b(e){let t=new Map;for(let n of x.pA){let s=(0,x.cL)(e,n);if(!s)continue;let r=t.get(s);r?(r.roles.push(n),r.contextWindow=Math.max(r.contextWindow,(0,x.u1)(e,n))):t.set(s,{model:s,roles:[n],contextWindow:(0,x.u1)(e,n)})}return[...t.values()]}let g={claude:"Claude Code",opencode:"OpenCode",codex:"Codex",qwen:"Qwen Code"},f=new Set(["claude","codex"]);function j(e){let t=String(e||"");return t?t.length<=12?`${t.slice(0,4)}••••`:`${t.slice(0,8)}••••••••${t.slice(-4)}`:""}function y(e,t){return t?String(e||"").split(t).join(j(t)):e}async function v(e,t){if(!e||!t)return null;let n=new URLSearchParams({page:"1",pageSize:"25",q:t}),s=await fetch(`/api/keys?${n.toString()}`,{cache:"no-store"});return s.ok&&((await s.json().catch(()=>({}))).keys||[]).find(t=>t?.key===e)||null}function N({label:e,model:t,detail:n}){return(0,s.jsxs)("div",{className:"min-w-0 rounded-xl border border-border bg-background px-3 py-2.5",children:[(0,s.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wide text-text-muted",children:e}),(0,s.jsx)("div",{className:"mt-1 truncate font-mono text-xs font-medium text-text-main",title:t||"—",children:t||"—"}),(0,s.jsx)("div",{className:"mt-1 truncate text-[11px] text-text-muted",title:n,children:n})]})}function k({enabled:e,coder:t,apiKey:n,missingModels:r}){return e?t?n?r.length>0?(0,s.jsxs)("div",{className:"min-h-[44px] rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:["API key chưa được cấp quyền cho ",(0,s.jsx)("span",{className:"font-mono",children:r.join(", ")}),". Guide kh\xf4ng tự fallback model kh\xe1c."]}):(0,s.jsxs)("div",{className:"flex min-h-[44px] items-center gap-2 rounded-xl border border-emerald-500/20 bg-emerald-500/5 px-3 py-2 text-xs text-text-muted",children:[(0,s.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-emerald-500"}),"Config sẵn s\xe0ng để copy v\xe0 \xe1p dụng."]}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600",children:"Kh\xf4ng đọc được API key từ modal hiện tại."}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Chưa cấu h\xecnh Coder model cho profile n\xe0y."}):(0,s.jsx)("div",{className:"flex min-h-[44px] items-center rounded-xl border border-dashed border-border px-3 py-2 text-xs text-text-muted",children:"Profile đang tắt. Admin c\xf3 thể bật trong CLI Model Settings."})}function w({tool:e,profile:t}){if("claude"!==e&&"codex"!==e)return null;let n=(0,x.u1)(t,"coder"),r=(0,x.u1)(t,"fast"),l=(0,x.u1)(t,"thinking"),a=Number(t?.autoCompactPct||75),o=(0,x.Zn)(t),i=new Set([n,r,l]).size>1;return(0,s.jsx)("div",{className:"mt-3 overflow-hidden rounded-xl border-2 border-amber-400/60 bg-amber-500/10 shadow-sm dark:border-amber-400/40",children:(0,s.jsxs)("div",{className:"flex gap-3 p-3 sm:p-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[22px] text-amber-600 dark:text-amber-300",children:"warning"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-amber-800 dark:text-amber-200",children:"Quan trọng khi đổi model Local"}),"claude"===e?(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-amber-900/90 dark:text-amber-100/90",children:["Config b\xean dưới đang đặt ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["CLAUDE_CODE_AUTO_COMPACT_WINDOW=",n]})," theo ",(0,s.jsx)("strong",{children:"Coder"}),". Nếu bạn đổi model Local đang sử dụng sang Fast, Thinking hoặc model kh\xe1c c\xf3 Max Context kh\xe1c, ",(0,s.jsx)("strong",{children:"kh\xf4ng chỉ đổi t\xean model"})," — h\xe3y sửa ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"CLAUDE_CODE_AUTO_COMPACT_WINDOW"})," theo đ\xfang Max Context của model đ\xf3 trước khi chạy. ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE"})," hiện l\xe0 ",(0,s.jsxs)("strong",{children:[a,"%"]}),"."]}):(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-amber-900/90 dark:text-amber-100/90",children:["Config b\xean dưới đang t\xednh theo ",(0,s.jsx)("strong",{children:"Coder"}),": ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["model_context_window=",n]})," v\xe0 ",(0,s.jsxs)("code",{className:"rounded bg-amber-500/10 px-1 font-mono font-semibold",children:["model_auto_compact_token_limit=",o]}),". Nếu bạn đổi model Local đang sử dụng, ",(0,s.jsx)("strong",{children:"kh\xf4ng chỉ đổi t\xean model"})," — h\xe3y cập nhật ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"model_context_window"})," theo Max Context mới v\xe0 t\xednh lại ",(0,s.jsx)("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"model_auto_compact_token_limit"})," theo mức ",(0,s.jsxs)("strong",{children:[a,"%"]}),"."]}),i?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 rounded-lg border border-amber-400/30 bg-background/70 px-2.5 py-2 font-mono text-[11px] text-amber-900 dark:text-amber-100",children:[(0,s.jsxs)("span",{children:["Coder: ",n.toLocaleString()]}),(0,s.jsxs)("span",{children:["Fast: ",r.toLocaleString()]}),(0,s.jsxs)("span",{children:["Thinking: ",l.toLocaleString()]})]}):null]})]})})}function C({activeView:e,setActiveView:t,configMeta:n,config:r,applyCommands:l}){let a="config"===e;return(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-background",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-surface/60 px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"inline-flex w-fit rounded-lg border border-border bg-background p-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t("config"),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${a?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-main"}`,children:n.label}),(0,s.jsx)("button",{type:"button",onClick:()=>t("powershell"),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${!a?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-main"}`,children:"PowerShell"})]}),(0,s.jsx)("span",{className:"truncate font-mono text-[11px] text-text-muted",children:a?n.path:"Apply config on Windows"})]}),(0,s.jsx)("pre",{className:"h-[340px] overflow-auto p-4 text-[11px] leading-5 text-text-main custom-scrollbar",children:a?r:l})]})}function A({scope:e,profile:t,tool:n,baseUrl:l,apiKey:a,selectedKey:o,copied:d,copy:c}){let[f,j]=(0,r.useState)("config"),v="local"===e,S=t?.enabled===!0,P=(0,x.cL)(t,"coder"),O=(0,x.cL)(t,"fast",P),$=(0,x.cL)(t,"thinking",P),I=function(e){switch(e){case"claude":return{label:"settings.json",path:"%USERPROFILE%\\.claude\\settings.json",command:"claude"};case"opencode":return{label:"opencode.json",path:"%APPDATA%\\opencode\\opencode.json",command:"opencode"};case"codex":return{label:"config.toml",path:"%USERPROFILE%\\.codex\\config.toml",command:"codex"};case"qwen":return{label:"settings.json",path:"%USERPROFILE%\\.qwen\\settings.json",command:"qwen"};default:return{label:"config",path:"",command:""}}}(n),E=S&&!!P&&!!a,L=E?function({tool:e,baseUrl:t,apiKey:n,profile:s,scope:r}){switch(e){case"claude":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=(0,x.cL)(n,"fast",r),a=(0,x.cL)(n,"thinking",r),o={ANTHROPIC_BASE_URL:String(u(e,m)??"").trim().replace(/\/+$/,"").replace(/\/v1$/,""),ANTHROPIC_AUTH_TOKEN:u(t,"sk-xxxxx"),ANTHROPIC_MODEL:r,ANTHROPIC_SMALL_FAST_MODEL:l,ANTHROPIC_DEFAULT_OPUS_MODEL:a,ANTHROPIC_DEFAULT_SONNET_MODEL:r,ANTHROPIC_DEFAULT_HAIKU_MODEL:l};return"local"===s&&(o.CLAUDE_CODE_AUTO_COMPACT_WINDOW=String((0,x.u1)(n,"coder")),o.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=String(n.autoCompactPct||75)),JSON.stringify({env:o,theme:"dark",hasCompletedOnboarding:!0},null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});case"opencode":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=(0,x.cL)(n,"fast",r),a=(0,x.cL)(n,"thinking",r),o={};for(let e of b(n)){let t={name:e.model};"local"===s&&(t.limit={context:e.contextWindow,output:Math.min(3e4,Math.max(4096,Math.floor(e.contextWindow/4)))}),o[e.model]=t}let i={explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`bluerouter/${l}`}};a&&a!==r&&(i.thinking={description:"Thinking/reasoning subagent",mode:"subagent",model:`bluerouter/${a}`});let d={$schema:"https://opencode.ai/config.json",provider:{bluerouter:{npm:"@ai-sdk/openai-compatible",name:"BlueRouter",options:{baseURL:h(u(e,m)),apiKey:u(t,"sk-xxxxx")},models:o}},model:`bluerouter/${r}`,small_model:`bluerouter/${l}`,agent:i};return"local"===s&&(d.compaction={auto:!0,prune:!0,reserved:Math.max(4096,(0,x.u1)(n,"coder")-(0,x.Zn)(n))}),JSON.stringify(d,null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});case"codex":return function({baseUrl:e,profile:t,scope:n}){let s=(0,x.cL)(t,"coder","programmer"),r=(0,x.cL)(t,"fast",s),l=(0,x.cL)(t,"thinking",s),a=[`model = "${s}"`,'model_provider = "bluerouter"'];return"local"===n&&a.push(`model_context_window = ${(0,x.u1)(t,"coder")}`,`model_auto_compact_token_limit = ${(0,x.Zn)(t)}`,'model_auto_compact_token_limit_scope = "total"',"model_catalog_json = 'model_catalog.json'"),a.push("","[model_providers.bluerouter]",'name = "BlueRouter"',`base_url = "${h(u(e,m))}"`,'env_key = "OPENAI_API_KEY"','wire_api = "responses"'),r&&a.push("","[profiles.fast]",`model = "${r}"`,'model_provider = "bluerouter"'),l&&l!==r&&a.push("","[profiles.thinking]",`model = "${l}"`,'model_provider = "bluerouter"'),a.join("\n")}({baseUrl:t,profile:s,scope:r});case"qwen":return function({baseUrl:e,apiKey:t,profile:n,scope:s}){let r=(0,x.cL)(n,"coder","programmer"),l=b(n).map(t=>{let n=new Set(t.roles),r=n.has("fast")&&!n.has("coder")&&!n.has("thinking"),l={timeout:r?6e4:12e4,maxRetries:2,samplingParams:{temperature:.2,...r?{max_tokens:4096}:{}}};return r&&(l.reasoning=!1),"local"===s&&(l.contextWindowSize=t.contextWindow),{id:t.model,name:t.model,envKey:"OPENAI_API_KEY",baseUrl:h(u(e,m)),generationConfig:l}});return JSON.stringify({env:{OPENAI_API_KEY:u(t,"sk-xxxxx")},security:{auth:{selectedType:"openai"}},model:{name:r},modelProviders:{openai:l}},null,2)}({baseUrl:t,apiKey:n,profile:s,scope:r});default:return""}}({tool:n,baseUrl:l,apiKey:a,profile:t,scope:e}):"",T=E?function({tool:e,config:t,apiKey:n,baseUrl:s,profile:r}){let l=(0,x.cL)(r,"coder","programmer"),a=p(n),o=p(h(u(s,m))),i=p(l),d="$utf8NoBom = New-Object System.Text.UTF8Encoding $false";switch(e){case"claude":return["mkdir $env:USERPROFILE\\.claude -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.claude\\settings.json", @\'',t,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nclaude"].join("\n");case"opencode":return["mkdir $env:APPDATA\\opencode -Force",d,'[System.IO.File]::WriteAllText("$env:APPDATA\\opencode\\opencode.json", @\'',t,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nopencode"].join("\n");case"codex":return["mkdir $env:USERPROFILE\\.codex -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',t,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${a}"`,`setx OPENAI_API_KEY "${a}"`,"cd D:\\path\\to\\your-project\ncodex"].join("\n");case"qwen":return["mkdir $env:USERPROFILE\\.qwen -Force",d,'[System.IO.File]::WriteAllText("$env:USERPROFILE\\.qwen\\settings.json", @\'',t,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${a}"`,`$env:OPENAI_BASE_URL = "${o}"`,`$env:OPENAI_MODEL = "${i}"`,`setx OPENAI_API_KEY "${a}"`,`setx OPENAI_BASE_URL "${o}"`,`setx OPENAI_MODEL "${i}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n");default:return""}}({tool:n,config:L,apiKey:a,baseUrl:l,profile:t}):"",_=Array.isArray(o?.allowedModels)?o.allowedModels:[],M=_.length>0?(0,x.FY)(t).filter(e=>!_.includes(e)):[],K=`${n}-${e}`,F=v?`${t?.autoCompactPct||75}% \xb7 ${(0,x.Zn)(t).toLocaleString()} tokens`:"Managed by cloud provider";return(0,s.jsxs)("section",{className:"flex min-w-0 flex-col rounded-2xl border border-border bg-surface/40 p-4 shadow-sm sm:p-5",children:[(0,s.jsxs)("div",{className:"flex min-h-[72px] items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-border bg-background px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.12em] text-text-muted",children:v?"Local":"Cloud"}),(0,s.jsx)("h3",{className:"truncate text-base font-semibold text-text-main",children:t?.providerName||(v?"Local AI":"Cloud AI")})]}),(0,s.jsx)("p",{className:"mt-1.5 text-xs leading-5 text-text-muted",children:v?"Local model, context v\xe0 auto-compact do admin quản l\xfd.":`Cloud mapping ri\xeang cho ${g[n]}; kh\xf4ng d\xf9ng chung model với CLI kh\xe1c.`})]}),(0,s.jsx)("span",{className:`shrink-0 rounded-full px-2.5 py-1 text-[11px] font-medium ${S?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-300":"bg-background text-text-muted"}`,children:S?"Enabled":"Disabled"})]}),(0,s.jsxs)("div",{className:"mt-4 grid gap-2 sm:grid-cols-3",children:[(0,s.jsx)(N,{label:"Coder",model:P,detail:v&&P?`${(0,x.u1)(t,"coder").toLocaleString()} tokens`:"Primary model"}),(0,s.jsx)(N,{label:"Fast",model:O,detail:v&&O?`${(0,x.u1)(t,"fast").toLocaleString()} tokens`:"Fast profile"}),(0,s.jsx)(N,{label:"Thinking",model:$,detail:v&&$?`${(0,x.u1)(t,"thinking").toLocaleString()} tokens`:"Reasoning profile"})]}),(0,s.jsxs)("div",{className:"mt-2 flex min-h-[40px] items-center justify-between gap-3 rounded-xl border border-border bg-background px-3 py-2 text-xs",children:[(0,s.jsx)("span",{className:"text-text-muted",children:v?"Auto compact":"Context policy"}),(0,s.jsx)("span",{className:"truncate text-right font-medium text-text-main",children:F})]}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(k,{enabled:S,coder:P,apiKey:a,missingModels:M})}),v&&E&&"claude"===n?(0,s.jsx)(w,{tool:n,profile:t}):null,E?(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)(C,{activeView:f,setActiveView:j,configMeta:I,config:y(L,a),applyCommands:y(T,a)}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-end gap-2",children:[(0,s.jsx)(i.$n,{variant:"outline",size:"sm",onClick:()=>c(T,`${K}-apply`),children:d===`${K}-apply`?"Đ\xe3 copy PowerShell":"Copy PowerShell"}),(0,s.jsx)(i.$n,{size:"sm",onClick:()=>c(L,`${K}-config`),children:d===`${K}-config`?"Đ\xe3 copy config":`Copy ${I.label}`})]})]}):null]})}function S({tool:e,seed:t}){let[n,l]=(0,r.useState)(()=>(0,x.j5)(x.O0)),[a,m]=(0,r.useState)(null),[u,h]=(0,r.useState)(!0),[p,b]=(0,r.useState)(""),{copied:y,copy:N}=(0,c.C)(),{isAdmin:k,canManageApiKeys:w}=(0,d.s)(),C=String(t?.apiKey||""),P=String(t?.baseUrl||""),O=String(t?.keyName||""),$=g[e]||"CLI",I=(0,r.useMemo)(()=>(function(e){switch(e){case"claude":return"# C\xe1ch 1: PowerShell installer\nirm https://claude.ai/install.ps1 | iex\n\n# C\xe1ch 2: CMD installer\ncurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd\n\n# C\xe1ch 3: npm (cần c\xe0i Node.js trước)\nnpm install -g @anthropic-ai/claude-code\nclaude --version";case"opencode":return"npm install -g opencode-ai\nopencode --version";case"codex":return'# C\xe0i Codex kh\xf4ng cần Node/npm (cần sh, v\xed dụ Git Bash hoặc WSL)\ncurl -fsSL https://chatgpt.com/codex/install.sh | sh\ncodex --version\n\n# Lưu API key vĩnh viễn cho Windows user hiện tại\n[Environment]::SetEnvironmentVariable("OPENAI_API_KEY","sk-xxx","User")';case"qwen":return"npm install -g @qwen-code/qwen-code\nqwen --version";default:return""}})(e).replaceAll("sk-xxx",C),[e,C]),E=f.has(e),L=(0,x.Ek)(n,e);return(0,r.useEffect)(()=>{let e=!1;return h(!0),b(""),Promise.allSettled([fetch("/api/cli-model-profiles",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được CLI model profiles");return(0,x.j5)(t.profiles||{})}),v(C,O)]).then(([t,n])=>{e||("fulfilled"===t.status?l(t.value):b(t.reason?.message||"Kh\xf4ng tải được CLI model profiles; đang d\xf9ng local defaults."),"fulfilled"===n.status&&m(n.value),h(!1))}),()=>{e=!0}},[C,O,e]),(0,s.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-surface/35 p-4 sm:p-5",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2.5 py-1 text-[11px] font-semibold text-primary",children:$}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Configuration guide"})]}),(0,s.jsx)("p",{className:"mt-2 max-w-4xl text-sm leading-6 text-text-muted",children:E?`Chọn Local hoặc ${$} Cloud. Hai profile độc lập nhưng d\xf9ng chung API key v\xe0 gateway.`:`${$} chỉ sử dụng Local Model profile; Cloud Provider kh\xf4ng \xe1p dụng cho tool n\xe0y.`}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,s.jsxs)("span",{className:"rounded-lg border border-border bg-background px-2.5 py-1.5",children:["API key ",(0,s.jsx)("span",{className:"ml-1 font-mono text-text-main",children:j(C)||"kh\xf4ng x\xe1c định"})]}),(0,s.jsxs)("span",{className:"max-w-full rounded-lg border border-border bg-background px-2.5 py-1.5",children:["Base URL ",(0,s.jsx)("span",{className:"ml-1 break-all font-mono text-text-main",children:P||"/v1"})]})]})]}),k||w?(0,s.jsxs)(o(),{href:"/dashboard/cli-tools/model-profiles",className:"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-xl border border-border bg-background px-3 py-2 text-sm font-medium text-text-main transition hover:border-primary/50 hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"}),"CLI Model Settings"]}):null]})}),u?(0,s.jsx)("div",{className:"rounded-xl border border-dashed border-border p-4 text-center text-sm text-text-muted",children:"Đang tải CLI model settings..."}):null,p?(0,s.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:p}):null,E?(0,s.jsxs)("div",{className:"grid items-stretch gap-4 xl:grid-cols-2",children:[(0,s.jsx)(A,{scope:"local",profile:n.local,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N}),(0,s.jsx)(A,{scope:"cloud",profile:L,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N})]}):(0,s.jsx)("div",{className:"mx-auto max-w-4xl",children:(0,s.jsx)(A,{scope:"local",profile:n.local,tool:e,baseUrl:P,apiKey:C,selectedKey:a,copied:y,copy:N})}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/35 p-4 sm:p-5",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-semibold text-text-main",children:["C\xe0i ",$," tr\xean Windows"]}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-5 text-text-muted",children:E?"Lệnh c\xe0i d\xf9ng chung cho Local v\xe0 Cloud. Sau khi c\xe0i, chọn tab PowerShell trong profile muốn \xe1p dụng.":"Sau khi c\xe0i, chọn tab PowerShell trong Local profile ph\xeda tr\xean."})]}),(0,s.jsx)(i.$n,{variant:"outline",size:"sm",onClick:()=>N(I,`${e}-install`),children:y===`${e}-install`?"Đ\xe3 copy lệnh c\xe0i":"Copy lệnh c\xe0i"})]}),(0,s.jsx)("pre",{className:"mt-3 max-h-[150px] overflow-auto rounded-xl border border-border bg-background p-3 text-[11px] leading-5 text-text-main custom-scrollbar",children:I})]}),(0,s.jsx)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 px-3 py-2.5 text-xs leading-5 text-text-muted",children:"CLI Model Settings chỉ ảnh hưởng config/hướng dẫn sinh trong Dashboard. Kh\xf4ng chỉnh request pipeline, provider routing, combo, load balancing hoặc model routing runtime."})]})}let P="/api/cli-model-profiles/model-catalog";function O(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return fetch(`${P}?meta=1`,{cache:"no-store"}).then(async n=>{let s=await n.json().catch(()=>({}));!e&&n.ok&&t(s.catalog||null)}).catch(()=>{}),()=>{e=!0}},[]),(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:"Local only"}),(0,s.jsx)("div",{className:"text-sm font-semibold text-text-main",children:"Codex model_catalog.json"})]}),(0,s.jsxs)("p",{className:"mt-1.5 text-xs leading-5 text-text-muted",children:["Local config d\xf9ng ",(0,s.jsx)("code",{className:"rounded bg-surface px-1 font-mono",children:"model_catalog_json = 'model_catalog.json'"}),". Download file v\xe0 đặt cạnh ",(0,s.jsx)("code",{className:"rounded bg-surface px-1 font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),", sau đ\xf3 restart Codex. Cloud Codex kh\xf4ng d\xf9ng file n\xe0y."]}),e?.available?(0,s.jsxs)("a",{href:P,download:"model_catalog.json",className:"mt-2 inline-flex items-center gap-1.5 rounded-lg border border-border px-2.5 py-1.5 text-xs font-medium text-primary transition hover:border-primary/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"download"}),"Download model_catalog.json"]}):(0,s.jsx)("div",{className:"mt-2 text-xs text-amber-700 dark:text-amber-300",children:"Admin chưa upload model_catalog.json."})]})}let $={"Claude Code Settings":"claude","OpenCode Settings":"opencode","Codex Settings":"codex","Qwen Code Settings":"qwen"};function I({children:e}){let t=(0,r.useCallback)(({title:e,children:t})=>{let n=$[String(e||"")];if(!n)return null;let l=function(e){let t=[];!function e(t,n){if(null!=t&&"boolean"!=typeof t){if("string"==typeof t||"number"==typeof t)return void n.push(String(t));if(Array.isArray(t)){for(let s of t)e(s,n);return}(0,r.isValidElement)(t)&&e(t.props?.children,n)}}(e,t);let n=t.join("\n"),s=n.match(/\bsk-[A-Za-z0-9._~-]{8,}\b/)?.[0]||"",l="";for(let e=0;e<t.length-1;e+=1){if("API Key"!==String(t[e]).trim())continue;let n=String(t[e+1]||"").trim();if(n&&!n.startsWith("sk-")){l=n;break}}let a=(n.match(/https?:\/\/[^\s\"'<>]+/g)||[]).map(e=>e.replace(/[),.;]+$/,""));return{apiKey:s,baseUrl:a.find(e=>/\/v1\/?$/i.test(e))||a.find(e=>/\/v1(?:\/|$)/i.test(e))||"",keyName:l}}(t);return{size:"full",className:"!max-w-6xl",footer:null,children:(0,s.jsxs)("div",{className:"space-y-4",children:["codex"===n?(0,s.jsx)(O,{}):null,(0,s.jsx)(S,{tool:n,seed:l},`${n}:${l.apiKey}`)]})}},[]);return(0,s.jsx)(l.j,{resolver:t,children:e})}}},e=>{e.O(0,[646,6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=84578)),_N_E=e.O()}]);
@@ -5,4 +5,4 @@ name = "OpenAI ChatGPT (HTTPS)"
5
5
  base_url = "https://chatgpt.com/backend-api/codex"
6
6
  wire_api = "responses"
7
7
  requires_openai_auth = true
8
- `,u=async(e,t)=>{try{await navigator.clipboard.writeText(t),x(e),setTimeout(()=>x(""),1500)}catch{s?.("Kh\xf4ng truy cập được clipboard của tr\xecnh duyệt.")}};return(0,a.jsxs)("section",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,a.jsx)("h2",{className:"font-semibold text-text-main",children:"Hướng dẫn cấu h\xecnh m\xe1y trạm"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-text-muted",children:"C\xe1c lệnh dưới đ\xe2y chỉ đặt biến m\xf4i trường trong tiến tr\xecnh con — kh\xf4ng d\xf9ng setx, kh\xf4ng đổi proxy của Windows/hệ thống. NO_PROXY giữ cho OAuth callback ở localhost v\xe0 MCP chạy nội bộ kh\xf4ng đi qua proxy."}),(0,a.jsxs)("div",{className:"mt-3 rounded-xl border border-primary/20 bg-primary/5 p-3 text-xs leading-5 text-text-muted",children:[(0,a.jsx)("div",{className:"font-semibold text-primary",children:"L\xe0m một lần trước khi d\xf9ng"}),"Lưu file Root CA vừa tải v\xe0o đ\xfang đường dẫn: ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:d})," tr\xean Windows, hoặc ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:l})," tr\xean Linux/macOS. Nếu CA đ\xe3 được c\xe0i v\xe0o hệ điều h\xe0nh th\xec biến CA trong lệnh vẫn v\xf4 hại, cứ để nguy\xean."]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:"Địa chỉ proxy"}),(0,a.jsx)("button",{type:"button",onClick:()=>u("url",m.proxyUrl),className:"text-xs text-primary",children:"url"===c?"Đ\xe3 copy":"Copy"})]}),(0,a.jsx)("code",{className:"mt-1 block break-all text-xs text-text-muted",children:m.proxyUrl})]}),(0,a.jsx)(o,{title:"Claude Code \xb7 Windows PowerShell",subtitle:"Biến proxy chỉ tồn tại trong tiến tr\xecnh con, đ\xf3ng cửa sổ l\xe0 hết.",command:m.claudePowerShell,copyKey:"claude-ps",copied:c,onCopy:u,recommended:!0}),(0,a.jsxs)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/5 p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:"Codex \xb7 Ghim v\xe0o transport HTTPS"}),(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-semibold text-green-600 dark:text-green-400",children:"Cấu h\xecnh ch\xednh"})]}),(0,a.jsx)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:"Codex ưu ti\xean WebSocket khi khởi động. Audit Proxy kh\xf4ng cho WebSocket upgrade, n\xean h\xe3y cấu h\xecnh Codex d\xf9ng HTTPS để tr\xe1nh khoảng 7 gi\xe2y thử kết nối lại."}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:["Tạo hoặc mở file ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"%USERPROFILE%\\.codex\\config.toml"}),", sau đ\xf3 copy to\xe0n bộ nội dung b\xean dưới v\xe0o file v\xe0 lưu lại."]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(o,{title:"Nội dung file config.toml",subtitle:"Copy to\xe0n bộ nội dung b\xean dưới v\xe0 lưu v\xe0o config.toml.",command:p,copyKey:"codex-https-config",copied:c,onCopy:u,recommended:!0})}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-amber-600 dark:text-amber-400",children:["Nếu config.toml đ\xe3 c\xf3 nội dung, đặt ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:'model_provider = "chatgpt_https"'})," ở cấp cao nhất v\xe0 chỉ th\xeam một khối ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"[model_providers.chatgpt_https]"}),". Kh\xf4ng tạo hai kho\xe1 ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"model_provider"}),"."]}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:["File config.toml chỉ chọn transport HTTPS. Proxy vẫn được truyền qua ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"HTTP_PROXY"}),"/",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"HTTPS_PROXY"}),"/",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"NO_PROXY"}),", n\xean sau khi lưu file h\xe3y chạy Codex bằng lệnh b\xean dưới."]})]}),(0,a.jsx)(o,{title:"Codex \xb7 Windows PowerShell",subtitle:"Kh\xf4ng ghi g\xec v\xe0o biến m\xf4i trường của user hay hệ thống.",command:m.codexPowerShell,copyKey:"codex-ps",copied:c,onCopy:u,recommended:!0}),(0,a.jsxs)("details",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-xs font-semibold text-text-main",children:"Lệnh cho Linux / macOS"}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3",children:[(0,a.jsx)(o,{title:"Claude Code \xb7 Bash/zsh",command:m.claudeBash,copyKey:"claude-bash",copied:c,onCopy:u}),(0,a.jsx)(o,{title:"Codex \xb7 Bash/zsh",command:m.codexBash,copyKey:"codex-bash",copied:c,onCopy:u})]})]})]})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=23371)),_N_E=e.O()}]);
8
+ `,u=async(e,t)=>{try{await navigator.clipboard.writeText(t),x(e),setTimeout(()=>x(""),1500)}catch{s?.("Kh\xf4ng truy cập được clipboard của tr\xecnh duyệt.")}};return(0,a.jsxs)("section",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,a.jsx)("h2",{className:"font-semibold text-text-main",children:"Hướng dẫn cấu h\xecnh m\xe1y trạm"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-text-muted",children:"C\xe1c lệnh dưới đ\xe2y chỉ đặt biến m\xf4i trường trong tiến tr\xecnh con — kh\xf4ng d\xf9ng setx, kh\xf4ng đổi proxy của Windows/hệ thống. NO_PROXY giữ cho OAuth callback ở localhost v\xe0 MCP chạy nội bộ kh\xf4ng đi qua proxy."}),(0,a.jsxs)("div",{className:"mt-3 rounded-xl border border-primary/20 bg-primary/5 p-3 text-xs leading-5 text-text-muted",children:[(0,a.jsx)("div",{className:"font-semibold text-primary",children:"L\xe0m một lần trước khi d\xf9ng"}),"Lưu file Root CA vừa tải v\xe0o đ\xfang đường dẫn: ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:d})," tr\xean Windows, hoặc ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:l})," tr\xean Linux/macOS. Nếu CA đ\xe3 được c\xe0i v\xe0o hệ điều h\xe0nh th\xec biến CA trong lệnh vẫn v\xf4 hại, cứ để nguy\xean."]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:"Địa chỉ proxy"}),(0,a.jsx)("button",{type:"button",onClick:()=>u("url",m.proxyUrl),className:"text-xs text-primary",children:"url"===c?"Đ\xe3 copy":"Copy"})]}),(0,a.jsx)("code",{className:"mt-1 block break-all text-xs text-text-muted",children:m.proxyUrl})]}),(0,a.jsx)(o,{title:"Claude Code \xb7 Windows PowerShell",subtitle:"Biến proxy chỉ tồn tại trong tiến tr\xecnh con, đ\xf3ng cửa sổ l\xe0 hết.",command:m.claudePowerShell,copyKey:"claude-ps",copied:c,onCopy:u,recommended:!0}),(0,a.jsxs)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/5 p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:"Codex \xb7 Ghim v\xe0o transport HTTPS"}),(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-semibold text-green-600 dark:text-green-400",children:"Cấu h\xecnh ch\xednh"})]}),(0,a.jsx)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:"Codex ưu ti\xean WebSocket khi khởi động. Audit Proxy kh\xf4ng cho WebSocket upgrade, n\xean h\xe3y cấu h\xecnh Codex d\xf9ng HTTPS để tr\xe1nh khoảng 7 gi\xe2y thử kết nối lại."}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:["Tạo hoặc mở file ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"%USERPROFILE%\\.codex\\config.toml"}),", sau đ\xf3 copy to\xe0n bộ nội dung b\xean dưới v\xe0o file v\xe0 lưu lại."]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(o,{title:"Nội dung file config.toml",subtitle:"Copy to\xe0n bộ nội dung b\xean dưới v\xe0 lưu v\xe0o config.toml.",command:p,copyKey:"codex-https-config",copied:c,onCopy:u,recommended:!0})}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-amber-600 dark:text-amber-400",children:["Nếu config.toml đ\xe3 c\xf3 nội dung, đặt ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:'model_provider = "chatgpt_https"'})," ở cấp cao nhất v\xe0 chỉ th\xeam một khối ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"[model_providers.chatgpt_https]"}),". Kh\xf4ng tạo hai kho\xe1 ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"model_provider"}),"."]}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-5 text-text-muted",children:["File config.toml chỉ chọn transport HTTPS. Proxy vẫn được truyền qua ",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"HTTP_PROXY"}),"/",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"HTTPS_PROXY"}),"/",(0,a.jsx)("code",{className:"rounded bg-background px-1 py-0.5",children:"NO_PROXY"}),", n\xean sau khi lưu file h\xe3y chạy Codex bằng lệnh b\xean dưới."]})]}),(0,a.jsx)(o,{title:"Codex \xb7 Windows PowerShell",subtitle:"Kh\xf4ng ghi g\xec v\xe0o biến m\xf4i trường của user hay hệ thống.",command:m.codexPowerShell,copyKey:"codex-ps",copied:c,onCopy:u,recommended:!0}),(0,a.jsxs)("details",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-xs font-semibold text-text-main",children:"Lệnh cho Linux / macOS"}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3",children:[(0,a.jsx)(o,{title:"Claude Code \xb7 Bash/zsh",command:m.claudeBash,copyKey:"claude-bash",copied:c,onCopy:u}),(0,a.jsx)(o,{title:"Codex \xb7 Bash/zsh",command:m.codexBash,copyKey:"codex-bash",copied:c,onCopy:u})]})]})]})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=23371)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{35911:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(52679);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=35911)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{35911:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(52679);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=35911)),_N_E=e.O()}]);
@@ -53,4 +53,4 @@ default_model = "${O||"cc/claude-opus-4-7"}"
53
53
  requires_api_key = true
54
54
 
55
55
  [[providers.bluerouter.models]]
56
- id = "${O||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-bluerouter.env",content:`JCODE_9ROUTER_API_KEY="${p}"`}])})]})}let H=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function W({toolId:e,machineId:t}){let s=o.d[e],[a,c]=(0,r.useState)([]),[m,x]=(0,r.useState)(!0),[u,p]=(0,r.useState)({}),[h,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,s,l]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();c(e.connections||[])}if(s.ok){let e=await s.json();g(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();y(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&x(!1)}})(),()=>{e=!1}},[]);let b=()=>a.filter(e=>!1!==e.isActive),j=(0,r.useCallback)((e,t,s)=>{p(l=>l[e]?.[t]===s?l:{...l,[e]:{...l[e],[t]:s}})},[]);return(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(n(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:s.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:s.description})]}),m?(0,l.jsx)(i.Qv,{}):(()=>{let t,r,a,n=(t=b(),r=[],a=new Set,t.forEach(e=>{let t=d.Xg[e.provider]||e.provider;(0,d.KC)(e.provider).forEach(s=>{let l=`${t}/${s.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),r).length>0,i={tool:s,isExpanded:!0,onToggle:()=>{},baseUrl:h&&H?H:window.location.origin,apiKeys:f};switch(e){case"claude":return(0,l.jsx)(v,{...i,activeProviders:b(),modelMappings:u[e]||{},onModelMappingChange:(t,s)=>j(e,t,s),hasActiveProviders:n,cloudEnabled:h});case"codex":return(0,l.jsx)(w,{...i,activeProviders:b(),cloudEnabled:h});case"opencode":return(0,l.jsx)(M,{...i,activeProviders:b(),cloudEnabled:h});case"cowork":return(0,l.jsx)(K,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h,cloudUrl:H});case"droid":return(0,l.jsx)(C,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"openclaw":return(0,l.jsx)(_,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"hermes":return(0,l.jsx)(E,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"copilot":return(0,l.jsx)(L,{...i,activeProviders:b(),cloudEnabled:h});case"cline":return(0,l.jsx)(z,{...i,activeProviders:b(),cloudEnabled:h});case"kilo":return(0,l.jsx)(D,{...i,activeProviders:b(),cloudEnabled:h});case"qwen":return(0,l.jsx)(U,{...i,activeProviders:b(),cloudEnabled:h});case"deepseek-tui":return(0,l.jsx)(B,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"jcode":return(0,l.jsx)(q,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});default:return(0,l.jsx)(O,{toolId:e,...i,activeProviders:b(),cloudEnabled:h})}})()]})}},22843:(e,t,s)=>{Promise.resolve().then(s.bind(s,15838))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,5772,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=22843)),_N_E=e.O()}]);
56
+ id = "${O||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-bluerouter.env",content:`JCODE_9ROUTER_API_KEY="${p}"`}])})]})}let H=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function W({toolId:e,machineId:t}){let s=o.d[e],[a,c]=(0,r.useState)([]),[m,x]=(0,r.useState)(!0),[u,p]=(0,r.useState)({}),[h,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,s,l]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();c(e.connections||[])}if(s.ok){let e=await s.json();g(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();y(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&x(!1)}})(),()=>{e=!1}},[]);let b=()=>a.filter(e=>!1!==e.isActive),j=(0,r.useCallback)((e,t,s)=>{p(l=>l[e]?.[t]===s?l:{...l,[e]:{...l[e],[t]:s}})},[]);return(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(n(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:s.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:s.description})]}),m?(0,l.jsx)(i.Qv,{}):(()=>{let t,r,a,n=(t=b(),r=[],a=new Set,t.forEach(e=>{let t=d.Xg[e.provider]||e.provider;(0,d.KC)(e.provider).forEach(s=>{let l=`${t}/${s.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),r).length>0,i={tool:s,isExpanded:!0,onToggle:()=>{},baseUrl:h&&H?H:window.location.origin,apiKeys:f};switch(e){case"claude":return(0,l.jsx)(v,{...i,activeProviders:b(),modelMappings:u[e]||{},onModelMappingChange:(t,s)=>j(e,t,s),hasActiveProviders:n,cloudEnabled:h});case"codex":return(0,l.jsx)(w,{...i,activeProviders:b(),cloudEnabled:h});case"opencode":return(0,l.jsx)(M,{...i,activeProviders:b(),cloudEnabled:h});case"cowork":return(0,l.jsx)(K,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h,cloudUrl:H});case"droid":return(0,l.jsx)(C,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"openclaw":return(0,l.jsx)(_,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"hermes":return(0,l.jsx)(E,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"copilot":return(0,l.jsx)(L,{...i,activeProviders:b(),cloudEnabled:h});case"cline":return(0,l.jsx)(z,{...i,activeProviders:b(),cloudEnabled:h});case"kilo":return(0,l.jsx)(D,{...i,activeProviders:b(),cloudEnabled:h});case"qwen":return(0,l.jsx)(U,{...i,activeProviders:b(),cloudEnabled:h});case"deepseek-tui":return(0,l.jsx)(B,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});case"jcode":return(0,l.jsx)(q,{...i,activeProviders:b(),hasActiveProviders:n,cloudEnabled:h});default:return(0,l.jsx)(O,{toolId:e,...i,activeProviders:b(),cloudEnabled:h})}})()]})}},22843:(e,t,s)=>{Promise.resolve().then(s.bind(s,15838))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,5772,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=22843)),_N_E=e.O()}]);