@jheavenknows/bluerouter 5.1.19 → 5.1.21

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 (545) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +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.js +4 -4
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/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/combos/page.js.nft.json +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.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +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.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  66. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  69. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  76. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  77. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  78. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  80. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  83. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  86. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/qwen-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/keys/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/suggested-models/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/settings/database/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/version/restart/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  252. package/app/.next-cli-build/server/app/callback.html +1 -1
  253. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  254. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  255. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  257. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  258. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/analytics.rsc +7 -7
  262. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  266. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +7 -7
  267. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +6 -6
  269. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
  270. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +8 -8
  272. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
  273. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  276. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +8 -8
  277. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +6 -6
  279. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
  280. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  282. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  283. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  285. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  286. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  287. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +6 -6
  289. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  290. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
  292. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  293. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  296. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  297. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +6 -6
  299. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  300. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  302. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  303. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  305. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  306. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  307. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +6 -6
  309. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  310. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  312. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  313. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  316. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  317. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +6 -6
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  320. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  322. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  323. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  325. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +6 -6
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  331. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  333. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  334. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  337. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  338. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +6 -6
  340. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  343. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  347. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  348. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +6 -6
  350. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +7 -7
  353. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  357. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +7 -7
  358. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +6 -6
  360. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +7 -7
  363. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  367. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +7 -7
  368. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +6 -6
  370. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
  371. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  373. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  374. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  379. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +6 -6
  381. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  382. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  383. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  384. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  385. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  388. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  389. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +6 -6
  391. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  392. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
  394. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  395. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  398. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
  399. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +6 -6
  401. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  402. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  404. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  405. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  408. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  409. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +6 -6
  411. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  412. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  416. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  417. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  419. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  420. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  426. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  427. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  430. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  431. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +6 -6
  433. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  436. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  440. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  441. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +6 -6
  443. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  446. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  447. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  450. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  451. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +6 -6
  453. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  456. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  457. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  461. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +6 -6
  463. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  466. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  467. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  470. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +6 -6
  472. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/index.html +1 -1
  475. package/app/.next-cli-build/server/app/index.rsc +6 -6
  476. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  478. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  480. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  481. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  482. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  483. package/app/.next-cli-build/server/app/landing.html +1 -1
  484. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  485. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  486. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  488. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  491. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  493. package/app/.next-cli-build/server/app/login.html +1 -1
  494. package/app/.next-cli-build/server/app/login.rsc +7 -7
  495. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  496. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  502. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  503. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  504. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  505. package/app/.next-cli-build/server/chunks/2074.js +9 -0
  506. package/app/.next-cli-build/server/chunks/2338.js +5 -5
  507. package/app/.next-cli-build/server/chunks/2556.js +9 -0
  508. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  509. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  510. package/app/.next-cli-build/server/chunks/402.js +6 -6
  511. package/app/.next-cli-build/server/chunks/4739.js +1 -1
  512. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  513. package/app/.next-cli-build/server/chunks/4778.js +1 -1
  514. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  515. package/app/.next-cli-build/server/chunks/4803.js +1 -1
  516. package/app/.next-cli-build/server/chunks/507.js +1 -1
  517. package/app/.next-cli-build/server/chunks/5258.js +1 -1
  518. package/app/.next-cli-build/server/chunks/6252.js +1 -1
  519. package/app/.next-cli-build/server/chunks/6328.js +1 -1
  520. package/app/.next-cli-build/server/chunks/698.js +1 -1
  521. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  522. package/app/.next-cli-build/server/chunks/8062.js +1 -1
  523. package/app/.next-cli-build/server/chunks/8469.js +1 -1
  524. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  525. package/app/.next-cli-build/server/chunks/8895.js +4 -3
  526. package/app/.next-cli-build/server/chunks/{4684.js → 9432.js} +2 -2
  527. package/app/.next-cli-build/server/chunks/9434.js +1 -1
  528. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  529. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  530. package/app/.next-cli-build/server/middleware.js +3 -3
  531. package/app/.next-cli-build/server/pages/404.html +1 -1
  532. package/app/.next-cli-build/server/pages/500.html +1 -1
  533. package/app/.next-cli-build/static/chunks/{5263-79f7a776783f38a3.js → 5263-eca7d343bf5582d8.js} +1 -1
  534. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/page-eff6ec1bd6be2159.js +19 -0
  535. package/app/.next-cli-build/static/css/{d8559bfc25347903.css → 217e0ab2df3c322f.css} +1 -1
  536. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.1.15-to-5.1.16-5.1.16-20260714-164440 → upgrade-5.1.18-to-5.1.19-5.1.19-20260714-182232}/data.sqlite +0 -0
  537. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.1.16-to-5.1.17-5.1.17-20260714-165506 → upgrade-5.1.19-to-5.1.20-5.1.20-20260715-222235}/data.sqlite +0 -0
  538. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
  539. package/app/package.json +1 -1
  540. package/package.json +1 -1
  541. package/app/.next-cli-build/server/chunks/232.js +0 -9
  542. package/app/.next-cli-build/server/chunks/7324.js +0 -9
  543. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/page-e92b1645212c501d.js +0 -19
  544. /package/app/.next-cli-build/static/{dP4mU6SZHcAtMDatjT1m8 → m__O_R5AnKryP_z_4CAaF}/_buildManifest.js +0 -0
  545. /package/app/.next-cli-build/static/{dP4mU6SZHcAtMDatjT1m8 → m__O_R5AnKryP_z_4CAaF}/_ssgManifest.js +0 -0
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluerouter-app",
3
- "version": "5.1.19",
3
+ "version": "5.1.21",
4
4
  "description": "Router web dashboard",
5
5
  "private": false,
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jheavenknows/bluerouter",
3
- "version": "5.1.19",
3
+ "version": "5.1.21",
4
4
  "description": "Bluerouter CLI - Start and manage Bluerouter server",
5
5
  "bin": {
6
6
  "bluerouter": "./cli.js"
@@ -1,9 +0,0 @@
1
- "use strict";exports.id=232,exports.ids=[232],exports.modules={63775:(a,b,c)=>{c.d(b,{CG:()=>e,oG:()=>d,zE:()=>f});let d=`
2
- PRAGMA journal_mode = WAL;
3
- PRAGMA synchronous = NORMAL;
4
- PRAGMA temp_store = MEMORY;
5
- PRAGMA mmap_size = 30000000;
6
- PRAGMA cache_size = -64000;
7
- PRAGMA foreign_keys = ON;
8
- PRAGMA busy_timeout = 5000;
9
- `,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",scope:"TEXT DEFAULT 'system'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",visibility:"TEXT DEFAULT 'system'",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)","CREATE INDEX IF NOT EXISTS idx_pc_scope_owner ON providerConnections(scope, ownerUser)","CREATE INDEX IF NOT EXISTS idx_pc_provider_scope ON providerConnections(provider, scope)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",adminDisabled:"INTEGER DEFAULT 0",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)","CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},70232:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>x});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(95658),i=c(63775);let j=[{version:1,name:"initial",up(a){for(let[b,c]of Object.entries(i.CG))for(let d of(a.exec((0,i.zE)(b,c)),c.indexes||[]))a.exec(d)}},{version:2,name:"usage-history-analytics-indexes",up(){}},{version:3,name:"request-observability-rollups",up(a){var b="apiKeys";let c=function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}}(a,b);for(let[d,e]of Object.entries({ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",allowedModels:"TEXT DEFAULT '[]'"}))c.has(d)||a.exec(`ALTER TABLE ${b} ADD COLUMN ${d} ${e}`);a.exec("CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)")}},{version:4,name:"api-key-admin-disabled",up(a){(function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}})(a,"apiKeys").has("adminDisabled")||a.exec("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)")}}].sort((a,b)=>a.version-b.version);function k(a,b,c=null){let d=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return d?d.value:c}function l(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c(36366);let m=null;function n(){if(m)return m;try{let a=g().join(process.cwd(),"package.json");m=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{m="0.0.0"}return m}function o(a){(0,h.Jh)();let b=n(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function p(a,b,c=null){if(!e().existsSync(a))return null;let d=c||g().basename(a),f=g().join(b,d);return e().copyFileSync(a,f),f}function q(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(5))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var r=c(644);let s=g().join(h.HG,".migrated-from-json"),t=new WeakSet;class u extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function v(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new u(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function w(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function x(a){if(t.has(a))return;t.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch{return!0}}(a),c=function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt(k(a,"schemaVersion","0"),10)||0;if(b>=(j.length?j[j.length-1].version:0))return{applied:0,from:b,to:b};let c=j.filter(a=>a.version>b),d=b;for(let b of c)a.transaction(()=>{b.up(a),l(a,"schemaVersion",b.version)}),d=b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);return{applied:c.length,from:b,to:d}}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}let d=e().existsSync(s),f=w(h.Or.main),g=w(h.Or.usage),m=w(h.Or.disabled),x=w(h.Or.details);if(b&&(f||g||m||x)&&!d){let b=Date.now(),c=o("migrate-from-json");for(let a of Object.values(h.Or))p(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,r.s)(f.settings)]),v(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,r.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),v(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,r.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),v(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,r.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),v(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),v(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,r.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,r.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,r.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,r.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,r.s)(c||{})])}if(m&&"object"==typeof m.disabled)for(let[b,c]of Object.entries(m.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,r.s)(c||[])]);l(a,"appVersion",n()),l(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof u)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(s,new Date().toISOString())}catch{}q(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}if(b)return void l(a,"appVersion",n());let y=k(a,"appVersion",null),z=n();if(y&&y!==z){let b=o(`upgrade-${y}-to-${z}`);try{p(h.AL,b)}catch{}l(a,"appVersion",z),q(),console.log(`[DB][migrate] App ${y} → ${z} | schema ${c.from} → ${c.to} | backup: ${b}`)}else if(c.applied>0){let a=o(`schema-${c.from}-to-${c.to}`);try{p(h.AL,a)}catch{}q()}}}};
@@ -1,9 +0,0 @@
1
- "use strict";exports.id=7324,exports.ids=[7324],exports.modules={76040:(a,b,c)=>{c.d(b,{CG:()=>e,oG:()=>d,zE:()=>f});let d=`
2
- PRAGMA journal_mode = WAL;
3
- PRAGMA synchronous = NORMAL;
4
- PRAGMA temp_store = MEMORY;
5
- PRAGMA mmap_size = 30000000;
6
- PRAGMA cache_size = -64000;
7
- PRAGMA foreign_keys = ON;
8
- PRAGMA busy_timeout = 5000;
9
- `,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",scope:"TEXT DEFAULT 'system'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",visibility:"TEXT DEFAULT 'system'",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)","CREATE INDEX IF NOT EXISTS idx_pc_scope_owner ON providerConnections(scope, ownerUser)","CREATE INDEX IF NOT EXISTS idx_pc_provider_scope ON providerConnections(provider, scope)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",adminDisabled:"INTEGER DEFAULT 0",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)","CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},87324:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>x});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(7841),i=c(76040);let j=[{version:1,name:"initial",up(a){for(let[b,c]of Object.entries(i.CG))for(let d of(a.exec((0,i.zE)(b,c)),c.indexes||[]))a.exec(d)}},{version:2,name:"usage-history-analytics-indexes",up(){}},{version:3,name:"request-observability-rollups",up(a){var b="apiKeys";let c=function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}}(a,b);for(let[d,e]of Object.entries({ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",allowedModels:"TEXT DEFAULT '[]'"}))c.has(d)||a.exec(`ALTER TABLE ${b} ADD COLUMN ${d} ${e}`);a.exec("CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)")}},{version:4,name:"api-key-admin-disabled",up(a){(function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}})(a,"apiKeys").has("adminDisabled")||a.exec("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)")}}].sort((a,b)=>a.version-b.version);function k(a,b,c=null){let d=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return d?d.value:c}function l(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c(59339);let m=null;function n(){if(m)return m;try{let a=g().join(process.cwd(),"package.json");m=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{m="0.0.0"}return m}function o(a){(0,h.Jh)();let b=n(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function p(a,b,c=null){if(!e().existsSync(a))return null;let d=c||g().basename(a),f=g().join(b,d);return e().copyFileSync(a,f),f}function q(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(5))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var r=c(33323);let s=g().join(h.HG,".migrated-from-json"),t=new WeakSet;class u extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function v(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new u(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function w(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function x(a){if(t.has(a))return;t.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch{return!0}}(a),c=function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt(k(a,"schemaVersion","0"),10)||0;if(b>=(j.length?j[j.length-1].version:0))return{applied:0,from:b,to:b};let c=j.filter(a=>a.version>b),d=b;for(let b of c)a.transaction(()=>{b.up(a),l(a,"schemaVersion",b.version)}),d=b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);return{applied:c.length,from:b,to:d}}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}let d=e().existsSync(s),f=w(h.Or.main),g=w(h.Or.usage),m=w(h.Or.disabled),x=w(h.Or.details);if(b&&(f||g||m||x)&&!d){let b=Date.now(),c=o("migrate-from-json");for(let a of Object.values(h.Or))p(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,r.s)(f.settings)]),v(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,r.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),v(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,r.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),v(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,r.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),v(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),v(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,r.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,r.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,r.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,r.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,r.s)(c||{})])}if(m&&"object"==typeof m.disabled)for(let[b,c]of Object.entries(m.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,r.s)(c||[])]);l(a,"appVersion",n()),l(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof u)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(s,new Date().toISOString())}catch{}q(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}if(b)return void l(a,"appVersion",n());let y=k(a,"appVersion",null),z=n();if(y&&y!==z){let b=o(`upgrade-${y}-to-${z}`);try{p(h.AL,b)}catch{}l(a,"appVersion",z),q(),console.log(`[DB][migrate] App ${y} → ${z} | schema ${c.from} → ${c.to} | backup: ${b}`)}else if(c.applied>0){let a=o(`schema-${c.from}-to-${c.to}`);try{p(h.AL,a)}catch{}q()}}}};
@@ -1,19 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7593],{56484:(e,t,s)=>{"use strict";s.d(t,{default:()=>O});var n=s(95155),r=s(12115),l=s(35497),a=s(94027),o=s(11059);let i=Object.freeze({enabled:!0,requestsPerMinute:20,promptCharsMax:12e4,maxOutputTokens:0,forceThinkingOff:!0,allowedIpCidrs:[],expiresAt:""});function d(e){return String(e||"").trim().toLowerCase()}function c(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function x(e,t){let s=c(e?.allowedModels),n=s[0]||String(t||"programmer").trim()||"programmer",r=s.find(e=>/fast|small|haiku/i.test(e))||s.find(e=>e!==n)||n;return{codingModel:n,fastModel:r}}function m({icon:e,materialIcon:t,image:s,children:r,className:l=""}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${l}`,children:[s?(0,n.jsx)("img",{src:s,alt:"","aria-hidden":"true",className:"size-4 rounded-sm object-contain"}):t?(0,n.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] leading-none",children:t}):e?(0,n.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:e}):null,(0,n.jsx)("span",{children:r})]})}function u(e,t=0){let s=Number(e);return Number.isFinite(s)?Math.max(0,Math.floor(s)):t}function h(e,t=!0){return null==e||""===e?t:!0===e||"true"===e||1===e||"1"===e}function p(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function g(e){return e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0}function b(e={},t={}){let s={...t},n=e&&"object"==typeof e&&!Array.isArray(e)?e:{};return{enabled:h(n.enabled??s.enabled,!0),requestsPerMinute:u(n.requestsPerMinute??s.requestsPerMinute,0),promptCharsMax:u(n.promptCharsMax??s.promptCharsMax,0),maxOutputTokens:u(n.maxOutputTokens??n.outputTokensMax??n.maxTokens??n.max_tokens??n.max_completion_tokens??s.maxOutputTokens,0),forceThinkingOff:h(n.forceThinkingOff??s.forceThinkingOff,!0),allowedIpCidrs:p(n.allowedIpCidrs??s.allowedIpCidrs),expiresAt:String(n.expiresAt??s.expiresAt??"").trim()}}function f({models:e,emptyLabel:t="Chưa g\xe1n model"}){let s=c(e);return 0===s.length?(0,n.jsx)("span",{className:"text-xs text-text-muted",children:t}):(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[s.slice(0,8).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),s.length>8?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",s.length-8," model kh\xe1c"]}):null]})}function y({limits:e,showThinking:t=!1,showOutputLimit:s=!1}){if(!g(e))return(0,n.jsx)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"policy: chưa set, kh\xf4ng giới hạn"})});let r=b(e);return(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["policy: ",r.enabled?"bật":"tắt"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.requestsPerMinute||"∞"," req/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.promptCharsMax||"∞"," chars prompt"]}),s?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.maxOutputTokens||"∞"," output tokens"]}):null,t?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["thinking: ",r.forceThinkingOff?"force off":"client tự quyết"]}):null,r.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]})}function j({label:e,value:t,onChange:s,hint:r}){return(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:e}),(0,n.jsx)("input",{type:"number",min:"0",value:t,onChange:e=>s(u(e.target.value,0)),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"}),r?(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:r}):null]})}function v({isOpen:e,keyName:t,policy:s,setPolicy:r,onClose:a,onSave:o,onClear:d,saving:c,clearLabel:x="X\xf3a policy / kh\xf4ng limit"}){let m=b(s,i),u=(e,t)=>r(s=>b({...s,[e]:t},i));return(0,n.jsx)(l.aF,{isOpen:e,onClose:a,title:`Policy API key: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface/60 p-3 text-sm text-text-muted",children:["Key mới tự c\xf3 ",(0,n.jsx)("b",{children:"default policy"}),". Chỉ admin được sửa policy. Request/ph\xfat = 0 nghĩa l\xe0 kh\xf4ng giới hạn tần suất. Max output tokens = 0 nghĩa l\xe0 kh\xf4ng \xe9p giới hạn output."]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Bật policy"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Tắt mục n\xe0y th\xec policy được lưu nhưng kh\xf4ng \xe1p limit."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.enabled,onChange:e=>u("enabled",e.target.checked)})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsx)(j,{label:"Request / ph\xfat",value:m.requestsPerMinute,onChange:e=>u("requestsPerMinute",e),hint:"0 = kh\xf4ng giới hạn tần suất. Khuyến nghị user thường: 10–20 req/ph\xfat."}),(0,n.jsx)(j,{label:"Max output tokens",value:m.maxOutputTokens,onChange:e=>u("maxOutputTokens",e),hint:"0 = kh\xf4ng giới hạn. VS Code khuyến nghị 2048–3072; chat d\xe0i 4096–8192."})]}),(0,n.jsx)(j,{label:"Prompt chars tối đa",value:m.promptCharsMax,onChange:e=>u("promptCharsMax",e),hint:"0 = kh\xf4ng giới hạn input/prompt."}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Force Thinking Off"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Khi bật, gateway \xe9p request c\xf3 chat_template_kwargs.enable_thinking=false theo chuẩn llama.cpp."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.forceThinkingOff,onChange:e=>u("forceThinkingOff",e.target.checked)})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"IP/CIDR được ph\xe9p"}),(0,n.jsx)("textarea",{value:p(m.allowedIpCidrs).join("\n"),onChange:e=>u("allowedIpCidrs",[...new Set(String(e.target.value||"").split(/[\n,]+/).map(e=>e.trim()).filter(Boolean))]),rows:3,className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"10.0.0.0/8\n192.168.0.0/16"}),(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:"Để trống = mọi IP. Hỗ trợ IPv4 exact hoặc CIDR."})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Hết hạn l\xfac"}),(0,n.jsx)("input",{value:m.expiresAt,onChange:e=>u("expiresAt",e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"2026-12-31T23:59:59+07:00 hoặc để trống"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:a,children:"Hủy"}),d?(0,n.jsx)(l.$n,{variant:"outline",onClick:d,disabled:c,children:x}):null,(0,n.jsx)(l.$n,{onClick:()=>o(m),disabled:c,children:c?"Đang lưu...":"Lưu policy"})]})]})})}function N({open:e,keyName:t,models:s,setModels:a,activeProviders:o,modelAliases:i,onClose:d,onSave:x,saving:m,personalOnly:u,extraModels:h}){let[p,g]=(0,r.useState)(!1),b=c(s),f=e=>{let t=e?.value||e?.name||e;a(e=>c(e).filter(e=>e!==t))};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.aF,{isOpen:e,onClose:d,title:`Model access: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Chọn một hoặc nhiều model m\xe0 API key n\xe0y được ph\xe9p sử dụng. Trang n\xe0y kh\xf4ng cho lưu danh s\xe1ch model rỗng."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:"Model được ph\xe9p d\xf9ng"}),(0,n.jsx)(l.$n,{size:"sm",variant:"outline",onClick:()=>g(!0),children:"Th\xeam model"})]}),0===b.length?(0,n.jsx)("div",{className:"rounded-xl border border-dashed border-border p-4 text-sm text-text-muted",children:"Chưa chọn model n\xe0o. H\xe3y th\xeam \xedt nhất một model trước khi lưu."}):(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>f(e),className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-1 font-mono text-xs text-primary transition hover:bg-red-500/10 hover:text-red-600",title:"Bấm để gỡ model n\xe0y",children:[e," \xd7"]},e))}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:d,children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:x,disabled:m||0===b.length,children:m?"Đang lưu...":"Lưu danh s\xe1ch model"})]})]})}),(0,n.jsx)(l.rq,{isOpen:p,onClose:()=>g(!1),onSelect:e=>{let t=e?.value||e?.name||e;t&&a(e=>c([...e,t]))},onDeselect:f,activeProviders:o,modelAliases:i,title:"Chọn model được ph\xe9p d\xf9ng",addedModelValues:b,closeOnSelect:!1,personalOnly:u,extraModels:h})]})}function k({label:e,value:t,hint:s}){return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/70 p-4",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-semibold text-text-main",children:t}),s?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:s}):null]})}function C({pagination:e,pageSize:t,onPageChange:s,onPageSizeChange:r,loading:a}){let o=Number(e?.page||1),i=Number(e?.totalPages||1),d=Number(e?.total||0),c=0===d?0:(o-1)*t+1,x=Math.min(d,o*t);return(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-3 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["Hiển thị ",(0,n.jsx)("b",{children:c}),"–",(0,n.jsx)("b",{children:x})," / ",(0,n.jsx)("b",{children:d})," API keys"]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("select",{value:t,onChange:e=>r(Number(e.target.value)),className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",disabled:a,children:[(0,n.jsx)("option",{value:25,children:"25 / trang"}),(0,n.jsx)("option",{value:50,children:"50 / trang"}),(0,n.jsx)("option",{value:100,children:"100 / trang"})]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:a||o<=1,children:"Đầu"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.max(1,o-1)),disabled:a||o<=1,children:"Trước"}),(0,n.jsxs)("span",{className:"rounded-xl border border-border bg-surface px-3 py-2 text-sm",children:["Trang ",o,"/",i]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.min(i,o+1)),disabled:a||o>=i,children:"Sau"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(i),disabled:a||o>=i,children:"Cuối"})]})]})}function w({image:e,label:t,onClick:s}){return(0,n.jsx)("button",{type:"button",onClick:s,title:t,"aria-label":t,className:"flex h-9 w-9 items-center justify-center rounded-xl border border-border bg-background transition hover:border-primary/50 hover:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20",children:(0,n.jsx)("img",{src:e,alt:"","aria-hidden":"true",className:"size-5 rounded-sm object-contain"})})}function P({apiKey:e,onClaudeSettings:t,onOpenCodeSettings:s,onCodexSettings:r,onQwenSettings:l}){return(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(w,{image:"/providers/claude.png",label:"Claude Code Settings",onClick:()=>t(e)}),(0,n.jsx)(w,{image:"/providers/opencode.png",label:"OpenCode Settings",onClick:()=>s(e)}),(0,n.jsx)(w,{image:"/providers/codex.png",label:"Codex Settings",onClick:()=>r(e)}),(0,n.jsx)(w,{image:"/providers/qwen.png",label:"Qwen Code Settings",onClick:()=>l(e)})]})}function A({apiKey:e,owner:t,isAdmin:s,onRename:l,onRotate:a,onEditModels:o,onEditPolicy:i,onAssignOwner:d,onDelete:c}){let[x,u]=(0,r.useState)(!1),h=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!x)return;let e=e=>{!h.current||h.current.contains(e.target)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",t)}},[h,x,u]);let p=e=>{u(!1),e()};return(0,n.jsxs)("details",{ref:h,className:"group",open:x,onToggle:e=>u(e.currentTarget.open),children:[(0,n.jsx)("summary",{title:"Thao t\xe1c kh\xe1c",className:"flex h-9 cursor-pointer list-none items-center rounded-xl border border-border bg-background px-3 text-sm font-medium text-text-main transition hover:border-primary/50 hover:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 [&::-webkit-details-marker]:hidden",children:(0,n.jsx)("span",{"aria-hidden":"true",className:"text-lg leading-none",children:"⋯"})}),(0,n.jsxs)("div",{className:"ml-auto mt-2 w-48 overflow-hidden rounded-xl border border-border bg-background py-1 text-left shadow-xl shadow-black/10",children:[(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>l(e.id,e.name)),children:(0,n.jsx)(m,{icon:"✏️",children:"Đổi t\xean"})}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>a(e)),children:(0,n.jsx)(m,{materialIcon:"key",children:"Đổi key"})}),(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>o(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDCE6",children:"Models"})}),s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>i(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDEE1️",children:"Policy"})}):null,s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>d(e.id,t)),children:(0,n.jsx)(m,{icon:"\uD83D\uDC64",children:"Owner"})}):null,(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm font-medium text-red-600 transition hover:bg-red-500/10",onClick:()=>p(()=>c(e.id)),children:(0,n.jsx)(m,{icon:"\uD83D\uDDD1️",children:"X\xf3a"})})]})]})}function S({keys:e,copied:t,copy:s,isAdmin:r,onToggleActive:a,onApiTest:o,onClaudeSettings:i,onOpenCodeSettings:d,onCodexSettings:x,onQwenSettings:m,onRename:u,onRotate:h,onEditModels:p,onEditPolicy:f,onAssignOwner:y,onDelete:j}){return(0,n.jsx)("div",{className:"overflow-hidden rounded-2xl border border-border",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"T\xean / Key"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Owner"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Ng\xe0y tạo"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 text-right font-medium",children:"Thao t\xe1c"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:e.map(e=>{var v;let N=e.ownerUser||e.createdByUser||"chưa g\xe1n",k=c(e.allowedModels),C=g(e.limits),w=b(e.limits||{});return(0,n.jsxs)("tr",{className:"align-top transition hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"min-w-[280px] px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||"API Key"}),(0,n.jsxs)("div",{className:"group/key mt-2 flex max-w-[380px] items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2 font-mono text-xs text-text-main",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(v=e.key)?v.length>12?`${v.slice(0,8)}...${v.slice(-4)}`:v:""}),(0,n.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,n.jsx)("button",{type:"button",onClick:()=>s(e.key,e.id),className:"rounded p-0.5 text-text-muted transition hover:bg-sidebar hover:text-primary","aria-label":t===e.id?"Đ\xe3 copy":"Copy API key",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-sm",children:t===e.id?"check":"content_copy"})}),(0,n.jsx)("span",{className:"pointer-events-none absolute left-1/2 top-5 mt-1 -translate-x-1/2 whitespace-nowrap text-[10px] text-text-muted opacity-0 transition-opacity group-hover/btn:opacity-100",children:t===e.id?"Copied!":"Copy"})]}),(0,n.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,n.jsx)("button",{type:"button",onClick:()=>o(e),className:"rounded p-0.5 text-text-muted transition hover:bg-sidebar hover:text-primary","aria-label":"Test API key bằng curl",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-sm",children:"science"})}),(0,n.jsx)("span",{className:"pointer-events-none absolute left-1/2 top-5 mt-1 -translate-x-1/2 whitespace-nowrap text-[10px] text-text-muted opacity-0 transition-opacity group-hover/btn:opacity-100",children:"Test"})]})]}),e.createdByUser?(0,n.jsxs)("div",{className:"mt-2 text-xs text-text-muted",children:["Tạo bởi: ",e.createdByUser]}):null]}),(0,n.jsx)("td",{className:"whitespace-nowrap px-4 py-4",children:(0,n.jsx)(l.lM,{checked:!!e.isActive,onChange:t=>a(e.id,t)})}),(0,n.jsx)("td",{className:"min-w-[160px] px-4 py-4",children:(0,n.jsx)("div",{className:"break-all text-sm text-text-main",children:N})}),(0,n.jsx)("td",{className:"px-4 py-4 align-top",children:k.length>0?(0,n.jsxs)("div",{className:"flex flex-col items-start gap-1",children:[k.slice(0,3).map(e=>(0,n.jsx)("span",{className:"max-w-full truncate rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),k.length>3?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",k.length-3]}):null]}):(0,n.jsx)("span",{className:"inline-block rounded-full border border-amber-500/30 bg-amber-500/10 px-2 py-1 text-xs text-amber-700 dark:text-amber-300",children:"Legacy full access"})}),(0,n.jsx)("td",{className:"px-4 py-4 align-top",children:C?(0,n.jsxs)("div",{className:"flex flex-col items-start gap-1 text-xs",children:[(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:w.enabled?"bật":"tắt"}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[w.requestsPerMinute||"∞","/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[w.promptCharsMax||"∞"," chars"]}),r&&w.maxOutputTokens>0?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[w.maxOutputTokens," out"]}):null,r&&w.forceThinkingOff?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"thinking off"}):null,w.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]}):(0,n.jsx)("span",{className:"inline-block rounded-full border border-border bg-surface px-2 py-1 text-xs text-text-muted",children:"chưa set"})}),(0,n.jsx)("td",{className:"min-w-[150px] px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"kh\xf4ng r\xf5";try{return new Date(e).toLocaleString()}catch{return String(e)}}(e.createdAt)}),(0,n.jsx)("td",{className:"min-w-[200px] px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,n.jsx)(A,{apiKey:e,owner:N,isAdmin:r,onRename:u,onRotate:h,onEditModels:p,onEditPolicy:f,onAssignOwner:y,onDelete:j}),(0,n.jsx)(P,{apiKey:e,onClaudeSettings:i,onOpenCodeSettings:d,onCodexSettings:x,onQwenSettings:m})]})})]},e.id)})})]})})})}function O(){let e,t,s,m,[h,p]=(0,r.useState)([]),[j,w]=(0,r.useState)(!0),[P,A]=(0,r.useState)(""),[O,I]=(0,r.useState)(!1),[M,$]=(0,r.useState)(""),[T,E]=(0,r.useState)(""),[_,K]=(0,r.useState)(""),[L,D]=(0,r.useState)(""),[R,U]=(0,r.useState)(null),[F,B]=(0,r.useState)([]),[q,z]=(0,r.useState)(""),[H,W]=(0,r.useState)(!1),[Y,J]=(0,r.useState)(!1),[Q,V]=(0,r.useState)([]),[X,Z]=(0,r.useState)([]),[G,ee]=(0,r.useState)(!1),[et,es]=(0,r.useState)(i),[en,er]=(0,r.useState)(i),[el,ea]=(0,r.useState)(!1),[eo,ei]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[ex,em]=(0,r.useState)([]),[eu,eh]=(0,r.useState)({}),[ep,eg]=(0,r.useState)(!1),[eb,ef]=(0,r.useState)(!1),[ey,ej]=(0,r.useState)(null),[ev,eN]=(0,r.useState)([]),[ek,eC]=(0,r.useState)(!1),[ew,eP]=(0,r.useState)(null),[eA,eS]=(0,r.useState)(i),[eO,eI]=(0,r.useState)(!1),[eM,e$]=(0,r.useState)(2),[eT,eE]=(0,r.useState)(0),[e_,eK]=(0,r.useState)(0),[eL,eD]=(0,r.useState)(""),[eR,eU]=(0,r.useState)(null),[eF,eB]=(0,r.useState)(null),[eq,ez]=(0,r.useState)(null),[eH,eW]=(0,r.useState)(null),[eY,eJ]=(0,r.useState)(null),[eQ,eV]=(0,r.useState)(""),[eX,eZ]=(0,r.useState)(""),[eG,e0]=(0,r.useState)("all"),[e1,e3]=(0,r.useState)(1),[e2,e4]=(0,r.useState)(25),[e5,e8]=(0,r.useState)({page:1,pageSize:25,total:0,totalAll:0,totalPages:1,status:"all",search:""}),{copied:e6,copy:e9}=(0,o.C)(),{isAdmin:e7,isMonitorAdmin:te,canManageApiKeys:tt,userId:ts}=(0,a.s)(),tn=e7||te||tt,tr=Number.isFinite(Number(eM))?Number(eM):2,tl=Number.isFinite(Number(eT))?Number(eT):h.length,ta=Number.isFinite(Number(e_))?Number(e_):Number(e5.totalAll||e5.total||0),to=Number(e5.total||0),ti=!tn&&tl>=tr,td=eL?`${eL}/v1`:"/v1",tc=eL?`${eL}/v1/chat/completions`:"/v1/chat/completions",tx=c(Q)[0]||"",tm=(e=c(eR?.allowedModels)[0],t=String(tx||"").trim(),e||t||"YOUR_MODEL"),tu=eR?b(eR.limits||{}):i,th=tu.maxOutputTokens>0?tu.maxOutputTokens:0,tp=eR?function({endpoint:e,apiKey:t,model:s,maxOutputTokens:n=0}){let r=String(e||"/v1/chat/completions").replace(/"/g,""),l=String(t||"YOUR_API_KEY").replace(/"/g,""),a=u(n,0),o={model:String(s||"YOUR_MODEL"),messages:[{role:"user",content:"Say hi.\nReply in one short sentence."}],temperature:.2,stream:!1};a>0&&(o.max_tokens=a);let i=JSON.stringify(o).replace(/"/g,'\\"');return`curl.exe -X POST "${r}" ^
2
- -H "Authorization: Bearer ${l}" ^
3
- -H "Content-Type: application/json" ^
4
- -d "${i}"`}({endpoint:tc,apiKey:eR.key,model:tm,maxOutputTokens:th}):"",tg=eF?x(eF,tx):{codingModel:"programmer",fastModel:"programmer-fast"},tb=eF?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){return JSON.stringify({env:{ANTHROPIC_BASE_URL:e||"https://models-gateway.example.com/v1",ANTHROPIC_AUTH_TOKEN:t||"sk-xxxxx",ANTHROPIC_MODEL:s||"programmer",ANTHROPIC_SMALL_FAST_MODEL:n||s||"programmer-fast",ANTHROPIC_DEFAULT_OPUS_MODEL:s||"programmer",ANTHROPIC_DEFAULT_SONNET_MODEL:s||"programmer",ANTHROPIC_DEFAULT_HAIKU_MODEL:n||s||"programmer-fast",CLAUDE_CODE_AUTO_COMPACT_WINDOW:"120000",CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:"75"},theme:"dark",hasCompletedOnboarding:!0},null,2)}({baseUrl:td,apiKey:eF.key,codingModel:tg.codingModel,fastModel:tg.fastModel}):"",tf=eF?['# 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", @\'',tb,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nclaude"].join("\n"):"",ty=eq?x(eq,tx):{codingModel:"programmer",fastModel:"programmer-fast"},tj=eq?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){let r=s||"programmer",l=n||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:td,apiKey:eq.key,codingModel:ty.codingModel,fastModel:ty.fastModel}):"",tv=eq?['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", @\'',tj,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nopencode"].join("\n"):"",tN=eH?x(eH,tx):{codingModel:"programmer",fastModel:"programmer-fast"},tk=eH?function({baseUrl:e,codingModel:t,fastModel:s}){let n=t||"programmer";return`model = "${n}"
5
- model_provider = "bluerouter"
6
- model_context_window = 120000
7
- model_auto_compact_token_limit = 90000
8
- model_auto_compact_token_limit_scope = "total"
9
-
10
- [model_providers.bluerouter]
11
- name = "BlueRouter"
12
- base_url = "${e||"https://models-gateway.example.com/v1"}"
13
- env_key = "OPENAI_API_KEY"
14
- wire_api = "responses"
15
-
16
- [profiles.fast]
17
- model = "${s||n||"programmer-fast"}"
18
- model_provider = "bluerouter"`}({baseUrl:td,codingModel:tN.codingModel,fastModel:tN.fastModel}):"",tC=eH?['npm install -g @openai/codex\ncodex --version\nmkdir $env:USERPROFILE\\.codex -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',tk,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eH.key}"`,`setx OPENAI_API_KEY "${eH.key}"`,"cd D:\\path\\to\\your-project\ncodex"].join("\n"):"",tw=eY?x(eY,tx):{codingModel:tx||"YOUR_MODEL",fastModel:tx||"YOUR_MODEL"},tP=eY?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){let r=s||"programmer",l=n||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:td,apiKey:eY.key,codingModel:tw.codingModel,fastModel:tw.fastModel}):"",tA=eY?['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", @\'',tP,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eY.key}"`,`$env:OPENAI_BASE_URL = "${td}"`,`$env:OPENAI_MODEL = "${tw.codingModel}"`,`setx OPENAI_API_KEY "${eY.key}"`,`setx OPENAI_BASE_URL "${td}"`,`setx OPENAI_MODEL "${tw.codingModel}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n"):"",tS=(0,r.useMemo)(()=>{let e=new Map;for(let t of F){let s=d(t.username||t.email||t.userPrincipalName||t.sAMAccountName);s&&e.set(s,{id:s,label:`${t.displayName||t.username||s}${t.email?` \xb7 ${t.email}`:""}`})}for(let t of h){let s=d(t.ownerUser||t.createdByUser);s&&!e.has(s)&&e.set(s,{id:s,label:s})}return ts&&!e.has(ts)&&e.set(ts,{id:ts,label:`${ts} (t\xf4i)`}),[...e.values()].sort((e,t)=>e.label.localeCompare(t.label))},[F,h,ts]),tO=(s=c(X),m=c(Q),!(s.length===m.length&&s.every((e,t)=>e===m[t]))),tI=Y||!M.trim()||0===Q.length||ti,tM=!!eX||"all"!==eG,t$=async()=>{w(!0),A("");try{let e=new URLSearchParams;e.set("page",String(e1)),e.set("pageSize",String(e2)),eX&&e.set("q",eX),"all"!==eG&&e.set("status",eG);let t=await fetch(`/api/keys?${e.toString()}`,{cache:"no-store"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng tải được danh s\xe1ch API keys");let n=s.keys||[],r=s.pagination||{page:e1,pageSize:e2,total:n.length,totalAll:n.length,totalPages:1,search:eX,status:eG};if(0===n.length&&Number(r.total||0)>0&&e1>1)return void e3(Math.max(1,Number(r.totalPages||1)));let l=c(s.apiKeyDefaultModels||(s.apiKeyDefaultModel?[s.apiKeyDefaultModel]:[]));p(n),e8(r),eK(s.apiKeyTotal??r.totalAll??r.total??n.length);let a=b(s.apiKeyDefaultPolicy||i,i);V(l),Z(l),es(a),er(a),e$(s.apiKeyLimit??2),eE(s.apiKeyCount??r.totalAll??n.length)}catch(e){A(e.message||"Kh\xf4ng tải được danh s\xe1ch API keys")}finally{w(!1)}};(0,r.useEffect)(()=>{eD(window.location.origin)},[]),(0,r.useEffect)(()=>{let e=setTimeout(()=>{e3(1),eZ(eQ.trim())},350);return()=>clearTimeout(e)},[eQ]),(0,r.useEffect)(()=>{t$()},[e1,e2,eX,eG]),(0,r.useEffect)(()=>{!T&&ts&&E(ts)},[ts,T]);let tT=async()=>{if(!ep&&!eb){ef(!0);try{let[e,t,s]=await Promise.allSettled([tn?fetch("/api/providers",{cache:"no-store"}):Promise.resolve(null),fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]),n=[],r=[];if("fulfilled"===e.status&&e.value?.ok){let t=await e.value.json().catch(()=>({}));n.push(...t.connections||[])}if("fulfilled"===t.status&&t.value.ok){let e=await t.value.json().catch(()=>({}));r.push(...e.connections||[])}if(em(tn?[...n,...r]:r),"fulfilled"===s.status&&s.value.ok){let e=await s.value.json().catch(()=>({}));eh(e.aliases||{})}eg(!0)}catch{}finally{ef(!1)}}},tE=async(e=q)=>{if(tn){W(!0);try{let t=await fetch(`/api/auth/ldap/users?q=${encodeURIComponent(e||"")}`,{cache:"no-store"}),s=await t.json().catch(()=>({}));t.ok&&B(s.users||[])}catch{}finally{W(!1)}}},t_=async()=>{if(tn&&0!==X.length){ee(!0),A("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultModels:X})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng lưu được default models");let s=c(t.apiKeyDefaultModels||(t.apiKeyDefaultModel?[t.apiKeyDefaultModel]:[])),n=b(t.apiKeyDefaultPolicy||i,i);V(s),Z(s),es(n),er(n)}catch(e){A(e.message||"Kh\xf4ng lưu được default models")}finally{ee(!1)}}},tK=async e=>{if(!tn)return;let t=b(e,i);ea(!0),A("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultPolicy:t})}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng lưu được default policy");let n=b(s.apiKeyDefaultPolicy||t,i);es(n),er(n),ei(!1)}catch(e){A(e.message||"Kh\xf4ng lưu được default policy")}finally{ea(!1)}},tL=async()=>{if(M.trim()){if(0===Q.length)return void A("Admin cần cấu h\xecnh default models trước khi tạo API key.");if(ti)return void A(`Mỗi user chỉ được tạo tối đa ${tr} API keys.
19
- 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.`);J(!0),A("");try{let e=tn?d(_||T||ts):void 0,t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:M.trim(),ownerUser:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng tạo được API key");D(s.key),$(""),K(""),I(!1),e3(1),await t$()}catch(e){A(e.message||"Kh\xf4ng tạo được API key")}finally{J(!1)}}},tD=async(e,t)=>{let s=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));return s.ok?(await t$(),!0):(A(n.error||"Kh\xf4ng cập nhật được API key"),!1)},tR=async()=>{if(!ey)return;let e=c(ev);if(0===e.length)return void A("H\xe3y chọn \xedt nhất một model trước khi lưu quyền truy cập API key.");eC(!0),A("");try{await tD(ey.id,{allowedModels:e})&&(ej(null),eN([]))}finally{eC(!1)}},tU=async e=>{if(ew){eI(!0),A("");try{await tD(ew.id,{limits:b(e)})&&(eP(null),eS(i))}finally{eI(!1)}}},tF=async()=>{if(ew){eI(!0),A("");try{await tD(ew.id,{limits:{}})&&(eP(null),eS(i))}finally{eI(!1)}}};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Quản l\xfd API Keys"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:tn?"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,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",onClick:t$,disabled:j,children:j?"Đang tải...":"Refresh"}),(0,n.jsx)(l.$n,{onClick:()=>{I(!0),!T&&ts&&E(ts)},disabled:ti,children:"Tạo API Key"})]})]}),P?(0,n.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:P}):null,(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsx)(k,{label:"Tổng API keys",value:ta,hint:tn?"To\xe0n hệ thống":`${tl}/${tr} key của bạn`}),(0,n.jsx)(k,{label:"Đang hiển thị",value:to,hint:tM?"Theo bộ lọc hiện tại":"Kh\xf4ng filter"}),(0,n.jsx)(k,{label:"Page size",value:e2,hint:"Chỉ tải số d\xf2ng của trang hiện tại"})]}),tn?null:(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Giới hạn API key theo user"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["T\xe0i khoản của bạn đang c\xf3 ",tl,"/",tr," API keys. Key bị disabled vẫn được t\xednh v\xe0o giới hạn."]})]}),(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-3 py-1 text-sm",children:ti?"Đ\xe3 đạt giới hạn":"C\xf2n c\xf3 thể tạo th\xeam"})]})}),(0,n.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default models cho API key mới"}),(0,n.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,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[Q.length>0?(0,n.jsx)(f,{models:Q,emptyLabel:"Chưa cấu h\xecnh default models"}):(0,n.jsx)("span",{className:"text-sm text-red-600",children:"Chưa cấu h\xecnh default models"}),tn?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{ec(!0),tT()},children:X.length>0?`Đ\xe3 chọn ${X.length} model`:"Chọn default models..."}),(0,n.jsx)(l.$n,{size:"sm",onClick:t_,disabled:!tO||G||0===X.length,children:G?"Đang lưu...":"Lưu"})]}):null]}),tn?(0,n.jsx)("p",{className:"text-xs text-text-muted",children:eb?"Đ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,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default policy cho API key mới"}),(0,n.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."})]}),tn?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{er(b(et||i,i)),ei(!0)},children:"Chỉnh default policy"}):null]}),(0,n.jsx)(y,{limits:et,showThinking:tn,showOutputLimit:tn})]})})]}),(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Th\xf4ng tin API endpoint"}),(0,n.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,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:td})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Chat Completions"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tc})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>e9(td,"api-base-url"),children:"api-base-url"===e6?"Đ\xe3 copy Base URL":"Copy Base URL"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>e9(tc,"api-chat-endpoint"),children:"api-chat-endpoint"===e6?"Đ\xe3 copy Endpoint":"Copy Endpoint"})]})]})}),L?(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h3",{className:"font-medium",children:"Đ\xe3 tạo API key"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-sm",children:L}),(0,n.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,n.jsx)(f,{models:Q,emptyLabel:"default models"})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(l.$n,{size:"sm",onClick:()=>e9(L,"created"),children:"created"===e6?"Đ\xe3 copy":"Copy"}),(0,n.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>D(""),children:"Đ\xf3ng"})]})]})}):null,(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-end xl:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Danh s\xe1ch API keys"}),(0,n.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,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,n.jsx)("input",{value:eQ,onChange:e=>eV(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,n.jsxs)("select",{value:eG,onChange:e=>{e0(e.target.value),e3(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,n.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,n.jsx)("option",{value:"active",children:"Chỉ key đang bật"}),(0,n.jsx)("option",{value:"inactive",children:"Chỉ key đ\xe3 tắt"})]}),tM?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eV(""),eZ(""),e0("all"),e3(1)},children:"X\xf3a lọc"}):null]})]}),j?(0,n.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===h.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:tM?"Kh\xf4ng t\xecm thấy API key ph\xf9 hợp bộ lọc.":"Chưa c\xf3 API key n\xe0o."}):(0,n.jsx)(S,{keys:h,copied:e6,copy:e9,isAdmin:tn,onToggleActive:(e,t)=>tD(e,{isActive:t}),onApiTest:eU,onClaudeSettings:eB,onOpenCodeSettings:ez,onCodexSettings:eW,onQwenSettings:eJ,onRename:(e,t)=>{let s=prompt("T\xean API key mới",t||"");s?.trim()&&tD(e,{name:s.trim()})},onRotate:e=>{e?.id&&U({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()=>{U(null),A("");let t=await fetch(`/api/keys/${e.id}/rotate`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)return void A(s.error||"Kh\xf4ng đổi được API key");let n=s.rotatedKey||s.key?.key||"";n&&D(n),await t$()}})},onEditModels:e=>{ej(e),eN(c(e.allowedModels)),tT()},onEditPolicy:e=>{tn&&(eP(e),eS(g(e.limits)?b(e.limits):i))},onAssignOwner:(e,t)=>{if(!tn)return;let s=prompt("G\xe1n owner username/email",t||ts||"");null!==s&&tD(e,{ownerUser:d(s)})},onDelete:e=>{U({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()=>{U(null),(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&await t$()}})}}),(0,n.jsx)(C,{pagination:e5,pageSize:e2,onPageChange:e3,onPageSizeChange:e=>{e4(e),e3(1)},loading:j})]})}),(0,n.jsx)(l.aF,{isOpen:O,onClose:()=>I(!1),title:"Tạo API Key",size:"lg",children:(0,n.jsxs)("div",{className:"space-y-4",children:[0===Q.length?(0,n.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."}):ti?(0,n.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,n.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,n.jsx)(f,{models:Q})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean API key"}),(0,n.jsx)("input",{value:M,onChange:e=>$(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"})]}),tn?(0,n.jsxs)("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Owner user"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{value:q,onChange:e=>z(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,n.jsx)(l.$n,{variant:"outline",onClick:()=>tE(q),disabled:H,children:H?"Đang tải":"Tải LDAP"})]}),(0,n.jsxs)("select",{value:T,onChange:e=>E(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,n.jsxs)("option",{value:ts||"",children:["G\xe1n cho t\xf4i (",ts||"local",")"]}),tS.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,n.jsx)("input",{value:_,onChange:e=>K(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,n.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,n.jsxs)("p",{className:"rounded-xl border border-border bg-surface p-3 text-sm text-text-muted",children:["Owner: ",ts||"user hiện tại"]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>I(!1),children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:tL,disabled:tI,children:Y?"Đang tạo...":"Tạo"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eR,onClose:()=>eU(null),title:"API Test bằng curl Windows",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.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,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eR?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Endpoint"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tc})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model test"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tm})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Lệnh curl cho Windows CMD"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tp})]}),(0,n.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,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eU(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{onClick:()=>e9(tp,`api-test-curl-${eR?.id||"current"}`),children:e6===`api-test-curl-${eR?.id||"current"}`?"Đ\xe3 copy":"Copy lệnh curl"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eF,onClose:()=>eB(null),title:"Claude Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy nội dung JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.claude\\settings.json"})," để Claude Code gọi qua gateway n\xe0y. Model coding d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tg.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tg.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eF?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:td})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tg.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tb})]}),(0,n.jsxs)("div",{children:[(0,n.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,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tf})]}),(0,n.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: 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,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eB(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>e9(tf,`claude-code-help-${eF?.id||"current"}`),children:e6===`claude-code-help-${eF?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>e9(tb,`claude-code-settings-${eF?.id||"current"}`),children:e6===`claude-code-settings-${eF?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eq,onClose:()=>ez(null),title:"OpenCode Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%APPDATA%\\opencode\\opencode.json"})," hoặc ",(0,n.jsx)("span",{className:"font-mono",children:"opencode.json"})," trong project. Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:ty.codingModel}),"; explorer/fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:ty.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eq?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:td})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model ch\xednh"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:ty.codingModel})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model fast"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:ty.fastModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"opencode.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tj})]}),(0,n.jsxs)("div",{children:[(0,n.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,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tv})]}),(0,n.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ả ",ty.codingModel," v\xe0 ",ty.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,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>ez(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>e9(tv,`opencode-help-${eq?.id||"current"}`),children:e6===`opencode-help-${eq?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>e9(tj,`opencode-settings-${eq?.id||"current"}`),children:e6===`opencode-settings-${eq?.id||"current"}`?"Đ\xe3 copy settings":"Copy opencode.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eH,onClose:()=>eW(null),title:"Codex Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy TOML dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),". API key được set bằng biến m\xf4i trường ",(0,n.jsx)("span",{className:"font-mono",children:"OPENAI_API_KEY"}),". Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tN.codingModel}),"; profile fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tN.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eH?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:td})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tN.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"config.toml"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tk})]}),(0,n.jsxs)("div",{children:[(0,n.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,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tC})]}),(0,n.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: config.toml đặt context window 120000 v\xe0 auto-compact ở 90000 token (75%). Nếu c\xe0i bằng npm th\xec m\xe1y cần c\xe0i Node.js trước. Hướng dẫn đ\xe3 tự tạo config.toml 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. Codex d\xf9ng OpenAI-compatible endpoint của BlueRouter."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eW(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>e9(tC,`codex-help-${eH?.id||"current"}`),children:e6===`codex-help-${eH?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>e9(tk,`codex-settings-${eH?.id||"current"}`),children:e6===`codex-settings-${eH?.id||"current"}`?"Đ\xe3 copy settings":"Copy config.toml"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eY,onClose:()=>eJ(null),title:"Qwen Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.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,n.jsx)("span",{className:"font-mono",children:tw.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tw.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eY?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:td})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tw.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tP})]}),(0,n.jsxs)("div",{children:[(0,n.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,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tA})]}),(0,n.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,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eJ(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>e9(tA,`qwen-code-help-${eY?.id||"current"}`),children:e6===`qwen-code-help-${eY?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>e9(tP,`qwen-code-settings-${eY?.id||"current"}`),children:e6===`qwen-code-settings-${eY?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(N,{open:!!ey,keyName:ey?.name,models:ev,setModels:eN,activeProviders:ex,modelAliases:eu,onClose:()=>{ej(null),eN([])},onSave:tR,saving:ek,personalOnly:!tn,extraModels:Q}),(0,n.jsx)(v,{isOpen:eo,keyName:"Default cho API key mới",policy:en,setPolicy:er,onClose:()=>{ei(!1),er(et||i)},onSave:tK,saving:el}),(0,n.jsx)(v,{isOpen:!!ew,keyName:ew?.name,policy:eA,setPolicy:eS,onClose:()=>{eP(null),eS(i)},onSave:tU,onClear:tF,saving:eO}),(0,n.jsx)(l.rq,{isOpen:ed,onClose:()=>ec(!1),onSelect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&Z(e=>c([...e,t]))},onDeselect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&Z(e=>c(e).filter(e=>e!==t))},activeProviders:ex,modelAliases:eu,title:"Chọn default models cho API key",addedModelValues:X,closeOnSelect:!1}),R?(0,n.jsx)(l.uo,{isOpen:!!R,onClose:()=>U(null),onConfirm:R.onConfirm,title:R.title,message:R.message,confirmText:"X\xf3a",cancelText:"Hủy",variant:"danger"}):null]})}},84223:(e,t,s)=>{Promise.resolve().then(s.bind(s,56484))}},e=>{e.O(0,[2574,3862,246,4546,5564,5263,5497,8441,3794,7358],()=>e(e.s=84223)),_N_E=e.O()}]);