@thangnm.nip/irouter 0.0.2 → 0.0.3

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 (600) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +9 -4
  3. package/app/.next/build-manifest.json +3 -3
  4. package/app/.next/prerender-manifest.json +24 -0
  5. package/app/.next/routes-manifest.json +36 -0
  6. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  13. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js +2 -0
  16. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js.nft.json +1 -0
  17. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page_client-reference-manifest.js +1 -0
  18. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js +2 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js.nft.json +1 -0
  20. package/app/.next/server/app/(dashboard)/dashboard/employees/page_client-reference-manifest.js +1 -0
  21. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +4 -2
  22. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  25. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  28. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  31. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  43. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  46. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  49. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  52. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/_global-error/page.js +3 -3
  55. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/_global-error.html +1 -1
  57. package/app/.next/server/app/_global-error.rsc +1 -1
  58. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  59. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  60. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  61. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  64. package/app/.next/server/app/_not-found/page.js +2 -2
  65. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/_not-found.html +1 -1
  67. package/app/.next/server/app/_not-found.rsc +5 -5
  68. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  69. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  70. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  71. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  72. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  73. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  74. package/app/.next/server/app/api/auth/login/route.js +1 -1
  75. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  76. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  77. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  78. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  79. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  80. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  81. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  82. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  83. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  84. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  85. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  86. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  87. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  88. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  89. package/app/.next/server/app/api/combos/route.js +1 -1
  90. package/app/.next/server/app/api/employees/[keyId]/stats/route.js +1 -0
  91. package/app/.next/server/app/api/employees/[keyId]/stats/route.js.nft.json +1 -0
  92. package/app/.next/server/app/api/employees/[keyId]/stats/route_client-reference-manifest.js +1 -0
  93. package/app/.next/server/app/api/employees/stats/route.js +1 -0
  94. package/app/.next/server/app/api/employees/stats/route.js.nft.json +1 -0
  95. package/app/.next/server/app/api/employees/stats/route_client-reference-manifest.js +1 -0
  96. package/app/.next/server/app/api/init/route.js +1 -1
  97. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  98. package/app/.next/server/app/api/keys/route.js +1 -1
  99. package/app/.next/server/app/api/locale/route.js +1 -1
  100. package/app/.next/server/app/api/models/alias/route.js +1 -1
  101. package/app/.next/server/app/api/models/route.js +1 -1
  102. package/app/.next/server/app/api/models/test/route.js +1 -1
  103. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  104. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  105. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  106. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  107. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  108. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  109. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  110. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  111. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  112. package/app/.next/server/app/api/pricing/route.js +1 -1
  113. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  114. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  115. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  116. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  117. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  118. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  119. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  120. package/app/.next/server/app/api/providers/client/route.js +1 -1
  121. package/app/.next/server/app/api/providers/route.js +1 -1
  122. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  123. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  124. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  125. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  126. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  127. package/app/.next/server/app/api/settings/database/route.js +1 -1
  128. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  129. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  130. package/app/.next/server/app/api/settings/route.js +1 -1
  131. package/app/.next/server/app/api/shutdown/route.js +1 -1
  132. package/app/.next/server/app/api/tags/route.js +1 -1
  133. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  134. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  135. package/app/.next/server/app/api/translator/load/route.js +1 -1
  136. package/app/.next/server/app/api/translator/save/route.js +1 -1
  137. package/app/.next/server/app/api/translator/send/route.js +1 -1
  138. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  139. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  140. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  141. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  142. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  143. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  144. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  145. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  146. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  147. package/app/.next/server/app/api/usage/history/route.js +1 -1
  148. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  149. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  150. package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/usage/request-details/[id]/route.js +1 -0
  152. package/app/.next/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -0
  153. package/app/.next/server/app/api/usage/request-details/[id]/route_client-reference-manifest.js +1 -0
  154. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  155. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  156. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  157. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  158. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  159. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  161. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  163. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  165. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  166. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/v1/models/route.js +1 -1
  168. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  169. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  170. package/app/.next/server/app/api/v1/route.js +1 -1
  171. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  172. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  173. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  174. package/app/.next/server/app/api/v1internal/route.js +1 -1
  175. package/app/.next/server/app/api/v1internal/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/version/route.js +1 -1
  177. package/app/.next/server/app/callback/page.js +2 -2
  178. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/callback.html +1 -1
  180. package/app/.next/server/app/callback.rsc +5 -5
  181. package/app/.next/server/app/callback.segments/_full.segment.rsc +5 -5
  182. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  183. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  184. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  185. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  186. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  187. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  188. package/app/.next/server/app/dashboard/cli-tools.rsc +7 -7
  189. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  190. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  191. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  192. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  193. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  194. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  195. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  196. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  197. package/app/.next/server/app/dashboard/combos.html +1 -1
  198. package/app/.next/server/app/dashboard/combos.rsc +7 -7
  199. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  200. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  201. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  202. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  203. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  204. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  205. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  206. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  207. package/app/.next/server/app/dashboard/employees.html +1 -0
  208. package/app/.next/server/app/dashboard/employees.meta +17 -0
  209. package/app/.next/server/app/dashboard/employees.rsc +26 -0
  210. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees/__PAGE__.segment.rsc +9 -0
  211. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees.segment.rsc +5 -0
  212. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +5 -0
  213. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  214. package/app/.next/server/app/dashboard/employees.segments/_full.segment.rsc +26 -0
  215. package/app/.next/server/app/dashboard/employees.segments/_head.segment.rsc +6 -0
  216. package/app/.next/server/app/dashboard/employees.segments/_index.segment.rsc +8 -0
  217. package/app/.next/server/app/dashboard/employees.segments/_tree.segment.rsc +5 -0
  218. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  219. package/app/.next/server/app/dashboard/endpoint.rsc +7 -7
  220. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  221. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  222. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  223. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  224. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  225. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  226. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  227. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  228. package/app/.next/server/app/dashboard/mitm.html +1 -1
  229. package/app/.next/server/app/dashboard/mitm.rsc +7 -7
  230. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  232. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  233. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  234. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  235. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  236. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  237. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  238. package/app/.next/server/app/dashboard/profile.html +1 -1
  239. package/app/.next/server/app/dashboard/profile.rsc +7 -7
  240. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  241. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  242. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  243. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  244. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  245. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  246. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  247. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  248. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  249. package/app/.next/server/app/dashboard/providers/new.rsc +7 -7
  250. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  251. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  252. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  253. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  254. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  255. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  256. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  257. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  258. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  259. package/app/.next/server/app/dashboard/providers.html +1 -1
  260. package/app/.next/server/app/dashboard/providers.rsc +7 -7
  261. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  263. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  264. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  265. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  266. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  268. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  269. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  270. package/app/.next/server/app/dashboard/proxy-pools.rsc +7 -7
  271. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  273. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  274. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  275. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  276. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  277. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  278. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  279. package/app/.next/server/app/dashboard/quota.html +2 -2
  280. package/app/.next/server/app/dashboard/quota.rsc +6 -6
  281. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +1 -1
  282. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  283. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  284. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  285. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  286. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  287. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  288. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  289. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  290. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  291. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  292. package/app/.next/server/app/dashboard/settings/pricing.rsc +5 -5
  293. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  294. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  295. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  296. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  297. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  298. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  299. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  300. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  301. package/app/.next/server/app/dashboard/translator.html +1 -1
  302. package/app/.next/server/app/dashboard/translator.rsc +7 -7
  303. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  304. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  305. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  306. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  307. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  308. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  309. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  310. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  311. package/app/.next/server/app/dashboard/usage.html +1 -1
  312. package/app/.next/server/app/dashboard/usage.rsc +7 -7
  313. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  314. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  315. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  316. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  317. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  318. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  319. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  320. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  321. package/app/.next/server/app/dashboard.html +1 -1
  322. package/app/.next/server/app/dashboard.meta +2 -0
  323. package/app/.next/server/app/dashboard.rsc +8 -9
  324. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  325. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  326. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  327. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +8 -9
  328. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  329. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  330. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  331. package/app/.next/server/app/favicon.ico/route.js +1 -1
  332. package/app/.next/server/app/index.html +1 -1
  333. package/app/.next/server/app/index.meta +1 -1
  334. package/app/.next/server/app/index.rsc +6 -6
  335. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  336. package/app/.next/server/app/index.segments/_full.segment.rsc +6 -6
  337. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  338. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  339. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  340. package/app/.next/server/app/landing/page.js +2 -2
  341. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  342. package/app/.next/server/app/landing.html +1 -1
  343. package/app/.next/server/app/landing.rsc +5 -5
  344. package/app/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  345. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  346. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  347. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  348. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  349. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  350. package/app/.next/server/app/login/page.js +2 -2
  351. package/app/.next/server/app/login/page.js.nft.json +1 -1
  352. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  353. package/app/.next/server/app/login.html +1 -1
  354. package/app/.next/server/app/login.rsc +6 -6
  355. package/app/.next/server/app/login.segments/_full.segment.rsc +6 -6
  356. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  357. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  358. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  359. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  360. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  361. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  362. package/app/.next/server/app/page.js +2 -2
  363. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  364. package/app/.next/server/app-paths-manifest.json +9 -4
  365. package/app/.next/server/chunks/1424.js +1 -1
  366. package/app/.next/server/chunks/2664.js +1 -1
  367. package/app/.next/server/chunks/{318.js → 3093.js} +3 -3
  368. package/app/.next/server/chunks/336.js +1 -0
  369. package/app/.next/server/chunks/412.js +2 -2
  370. package/app/.next/server/chunks/4989.js +2 -2
  371. package/app/.next/server/chunks/6828.js +1 -0
  372. package/app/.next/server/chunks/8895.js +2 -2
  373. package/app/.next/server/chunks/9718.js +1 -1
  374. package/app/.next/server/middleware-build-manifest.js +1 -1
  375. package/app/.next/server/pages/404.html +1 -1
  376. package/app/.next/server/pages/500.html +1 -1
  377. package/app/.next/static/-QR9sv3cHe_xOpnpUVCHx/_buildManifest.js +1 -0
  378. package/app/.next/static/chunks/{5497-1e3ca6e102213311.js → 5497-cadcb6f90ad9f446.js} +2 -2
  379. package/app/.next/static/chunks/5909-8229484e56dff5af.js +1 -0
  380. package/app/.next/static/chunks/6902-59c9bd4da89daa6c.js +1 -0
  381. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-b8a81c97c0f303e5.js → page-61e6d1dcc53a6f64.js} +1 -1
  382. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-7a2c4bfc2d094dc8.js → page-eaaa0b2e7a9f2432.js} +1 -1
  383. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-9817f7dfd3db200f.js → page-0818a8d1c21dc842.js} +1 -1
  384. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/[keyId]/page-e4b9ed56ef20f3b0.js +1 -0
  385. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/page-f23af3249393719d.js +1 -0
  386. package/app/.next/static/chunks/{8093-1d753947a159f3d6.js → app/(dashboard)/dashboard/endpoint/page-88605a2347dee47b.js} +2 -2
  387. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-ef761ecb487fe564.js → page-4b7378e5137f3fd8.js} +1 -1
  388. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-aed1b231bb49a704.js +1 -0
  389. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-26e2348f80c5fb86.js → page-d9fef809999e6003.js} +1 -1
  390. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d97e0153ce2081b1.js → page-91259a6310563c56.js} +1 -1
  391. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-33a2031d2a33ee5a.js → page-def2087e830977cb.js} +1 -1
  392. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-2fdc1cf4d09ba309.js → page-b5a0564904ed5969.js} +1 -1
  393. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-6213cf39d4b20426.js → page-b62fbf4b69474242.js} +1 -1
  394. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-3057dc573c7b21f0.js → page-e919a2e0bd879140.js} +1 -1
  395. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-a4c18af18bf2985a.js +1 -0
  396. package/app/.next/static/chunks/app/(dashboard)/{layout-3ef047ee09079701.js → layout-ce060c64625acbdc.js} +1 -1
  397. package/app/.next/static/chunks/app/_global-error/page-aed1b231bb49a704.js +1 -0
  398. package/app/.next/static/chunks/app/api/auth/login/route-aed1b231bb49a704.js +1 -0
  399. package/app/.next/static/chunks/app/api/auth/logout/route-aed1b231bb49a704.js +1 -0
  400. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-aed1b231bb49a704.js +1 -0
  401. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-aed1b231bb49a704.js +1 -0
  402. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-aed1b231bb49a704.js +1 -0
  403. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-aed1b231bb49a704.js +1 -0
  404. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-aed1b231bb49a704.js +1 -0
  405. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-aed1b231bb49a704.js +1 -0
  406. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-aed1b231bb49a704.js +1 -0
  407. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-aed1b231bb49a704.js +1 -0
  408. package/app/.next/static/chunks/app/api/cloud/auth/route-aed1b231bb49a704.js +1 -0
  409. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-aed1b231bb49a704.js +1 -0
  410. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-aed1b231bb49a704.js +1 -0
  411. package/app/.next/static/chunks/app/api/cloud/models/alias/route-aed1b231bb49a704.js +1 -0
  412. package/app/.next/static/chunks/app/api/combos/[id]/route-aed1b231bb49a704.js +1 -0
  413. package/app/.next/static/chunks/app/api/combos/route-aed1b231bb49a704.js +1 -0
  414. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-aed1b231bb49a704.js +1 -0
  415. package/app/.next/static/chunks/app/api/employees/stats/route-aed1b231bb49a704.js +1 -0
  416. package/app/.next/static/chunks/app/api/init/route-aed1b231bb49a704.js +1 -0
  417. package/app/.next/static/chunks/app/api/keys/[id]/route-aed1b231bb49a704.js +1 -0
  418. package/app/.next/static/chunks/app/api/keys/route-aed1b231bb49a704.js +1 -0
  419. package/app/.next/static/chunks/app/api/locale/route-aed1b231bb49a704.js +1 -0
  420. package/app/.next/static/chunks/app/api/models/alias/route-aed1b231bb49a704.js +1 -0
  421. package/app/.next/static/chunks/app/api/models/route-aed1b231bb49a704.js +1 -0
  422. package/app/.next/static/chunks/app/api/models/test/route-aed1b231bb49a704.js +1 -0
  423. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-aed1b231bb49a704.js +1 -0
  424. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-aed1b231bb49a704.js +1 -0
  425. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-aed1b231bb49a704.js +1 -0
  426. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-aed1b231bb49a704.js +1 -0
  427. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-aed1b231bb49a704.js +1 -0
  428. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-aed1b231bb49a704.js +1 -0
  429. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-aed1b231bb49a704.js +1 -0
  430. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-aed1b231bb49a704.js +1 -0
  431. package/app/.next/static/chunks/app/api/pricing/route-aed1b231bb49a704.js +1 -0
  432. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-aed1b231bb49a704.js +1 -0
  433. package/app/.next/static/chunks/app/api/provider-nodes/route-aed1b231bb49a704.js +1 -0
  434. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-aed1b231bb49a704.js +1 -0
  435. package/app/.next/static/chunks/app/api/providers/[id]/models/route-aed1b231bb49a704.js +1 -0
  436. package/app/.next/static/chunks/app/api/providers/[id]/route-aed1b231bb49a704.js +1 -0
  437. package/app/.next/static/chunks/app/api/providers/[id]/test/route-aed1b231bb49a704.js +1 -0
  438. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-aed1b231bb49a704.js +1 -0
  439. package/app/.next/static/chunks/app/api/providers/client/route-aed1b231bb49a704.js +1 -0
  440. package/app/.next/static/chunks/app/api/providers/route-aed1b231bb49a704.js +1 -0
  441. package/app/.next/static/chunks/app/api/providers/test-batch/route-aed1b231bb49a704.js +1 -0
  442. package/app/.next/static/chunks/app/api/providers/validate/route-aed1b231bb49a704.js +1 -0
  443. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-aed1b231bb49a704.js +1 -0
  444. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-aed1b231bb49a704.js +1 -0
  445. package/app/.next/static/chunks/app/api/proxy-pools/route-aed1b231bb49a704.js +1 -0
  446. package/app/.next/static/chunks/app/api/settings/database/route-aed1b231bb49a704.js +1 -0
  447. package/app/.next/static/chunks/app/api/settings/proxy-test/route-aed1b231bb49a704.js +1 -0
  448. package/app/.next/static/chunks/app/api/settings/require-login/route-aed1b231bb49a704.js +1 -0
  449. package/app/.next/static/chunks/app/api/settings/route-aed1b231bb49a704.js +1 -0
  450. package/app/.next/static/chunks/app/api/shutdown/route-aed1b231bb49a704.js +1 -0
  451. package/app/.next/static/chunks/app/api/tags/route-aed1b231bb49a704.js +1 -0
  452. package/app/.next/static/chunks/app/api/translator/console-logs/route-aed1b231bb49a704.js +1 -0
  453. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-aed1b231bb49a704.js +1 -0
  454. package/app/.next/static/chunks/app/api/translator/load/route-aed1b231bb49a704.js +1 -0
  455. package/app/.next/static/chunks/app/api/translator/save/route-aed1b231bb49a704.js +1 -0
  456. package/app/.next/static/chunks/app/api/translator/send/route-aed1b231bb49a704.js +1 -0
  457. package/app/.next/static/chunks/app/api/translator/translate/route-aed1b231bb49a704.js +1 -0
  458. package/app/.next/static/chunks/app/api/tunnel/disable/route-aed1b231bb49a704.js +1 -0
  459. package/app/.next/static/chunks/app/api/tunnel/enable/route-aed1b231bb49a704.js +1 -0
  460. package/app/.next/static/chunks/app/api/tunnel/status/route-aed1b231bb49a704.js +1 -0
  461. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-aed1b231bb49a704.js +1 -0
  462. package/app/.next/static/chunks/app/api/usage/chart/route-aed1b231bb49a704.js +1 -0
  463. package/app/.next/static/chunks/app/api/usage/history/route-aed1b231bb49a704.js +1 -0
  464. package/app/.next/static/chunks/app/api/usage/logs/route-aed1b231bb49a704.js +1 -0
  465. package/app/.next/static/chunks/app/api/usage/providers/route-aed1b231bb49a704.js +1 -0
  466. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-aed1b231bb49a704.js +1 -0
  467. package/app/.next/static/chunks/app/api/usage/request-details/route-aed1b231bb49a704.js +1 -0
  468. package/app/.next/static/chunks/app/api/usage/request-logs/route-aed1b231bb49a704.js +1 -0
  469. package/app/.next/static/chunks/app/api/usage/stats/route-aed1b231bb49a704.js +1 -0
  470. package/app/.next/static/chunks/app/api/usage/stream/route-aed1b231bb49a704.js +1 -0
  471. package/app/.next/static/chunks/app/api/v1/api/chat/route-aed1b231bb49a704.js +1 -0
  472. package/app/.next/static/chunks/app/api/v1/chat/completions/route-aed1b231bb49a704.js +1 -0
  473. package/app/.next/static/chunks/app/api/v1/embeddings/route-aed1b231bb49a704.js +1 -0
  474. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-aed1b231bb49a704.js +1 -0
  475. package/app/.next/static/chunks/app/api/v1/messages/route-aed1b231bb49a704.js +1 -0
  476. package/app/.next/static/chunks/app/api/v1/models/route-aed1b231bb49a704.js +1 -0
  477. package/app/.next/static/chunks/app/api/v1/responses/route-aed1b231bb49a704.js +1 -0
  478. package/app/.next/static/chunks/app/api/v1/route-aed1b231bb49a704.js +1 -0
  479. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-aed1b231bb49a704.js +1 -0
  480. package/app/.next/static/chunks/app/api/v1beta/models/route-aed1b231bb49a704.js +1 -0
  481. package/app/.next/static/chunks/app/api/v1internal/route-aed1b231bb49a704.js +1 -0
  482. package/app/.next/static/chunks/app/api/version/route-aed1b231bb49a704.js +1 -0
  483. package/app/.next/static/chunks/app/{layout-7d320cc74dc582e9.js → layout-7d9f16ad6f65ad27.js} +1 -1
  484. package/app/.next/static/chunks/app/login/{page-025e378eb5cdb421.js → page-5e162056267a89f6.js} +1 -1
  485. package/app/.next/static/chunks/app/manifest.webmanifest/route-aed1b231bb49a704.js +1 -0
  486. package/app/.next/static/chunks/app/page-aed1b231bb49a704.js +1 -0
  487. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-aed1b231bb49a704.js +1 -0
  488. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-aed1b231bb49a704.js +1 -0
  489. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-aed1b231bb49a704.js +1 -0
  490. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-aed1b231bb49a704.js +1 -0
  491. package/app/.next/static/chunks/webpack-1094c4a28660424b.js +1 -0
  492. package/app/.next/static/css/e83da33dd60e45a9.css +3 -0
  493. package/app/open-sse/executors/antigravity.js +27 -4
  494. package/app/open-sse/handlers/chatCore/nonStreamingHandler.js +1 -1
  495. package/app/open-sse/handlers/chatCore/requestDetail.js +1 -0
  496. package/app/open-sse/handlers/chatCore/sseToJsonHandler.js +1 -1
  497. package/app/open-sse/handlers/chatCore/streamingHandler.js +5 -5
  498. package/app/open-sse/handlers/chatCore.js +2 -2
  499. package/app/open-sse/handlers/internalChatCore.js +6 -6
  500. package/app/package.json +3 -3
  501. package/package.json +1 -1
  502. package/app/.next/server/chunks/1386.js +0 -3
  503. package/app/.next/server/chunks/4689.js +0 -1
  504. package/app/.next/static/L6G1Bw3njbM3GTWLVjBSx/_buildManifest.js +0 -1
  505. package/app/.next/static/chunks/123-58257c9badaeaf84.js +0 -1
  506. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-4a59bbf5f1889d13.js +0 -1
  507. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-ab4c1f7ada9eefda.js +0 -1
  508. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-4c59e920e2fecc16.js +0 -1
  509. package/app/.next/static/chunks/app/_global-error/page-b30d6a5358c02312.js +0 -1
  510. package/app/.next/static/chunks/app/api/auth/login/route-b30d6a5358c02312.js +0 -1
  511. package/app/.next/static/chunks/app/api/auth/logout/route-b30d6a5358c02312.js +0 -1
  512. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-b30d6a5358c02312.js +0 -1
  513. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-b30d6a5358c02312.js +0 -1
  514. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-b30d6a5358c02312.js +0 -1
  515. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-b30d6a5358c02312.js +0 -1
  516. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-b30d6a5358c02312.js +0 -1
  517. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-b30d6a5358c02312.js +0 -1
  518. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-b30d6a5358c02312.js +0 -1
  519. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-b30d6a5358c02312.js +0 -1
  520. package/app/.next/static/chunks/app/api/cloud/auth/route-b30d6a5358c02312.js +0 -1
  521. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-b30d6a5358c02312.js +0 -1
  522. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-b30d6a5358c02312.js +0 -1
  523. package/app/.next/static/chunks/app/api/cloud/models/alias/route-b30d6a5358c02312.js +0 -1
  524. package/app/.next/static/chunks/app/api/combos/[id]/route-b30d6a5358c02312.js +0 -1
  525. package/app/.next/static/chunks/app/api/combos/route-b30d6a5358c02312.js +0 -1
  526. package/app/.next/static/chunks/app/api/init/route-b30d6a5358c02312.js +0 -1
  527. package/app/.next/static/chunks/app/api/keys/[id]/route-b30d6a5358c02312.js +0 -1
  528. package/app/.next/static/chunks/app/api/keys/route-b30d6a5358c02312.js +0 -1
  529. package/app/.next/static/chunks/app/api/locale/route-b30d6a5358c02312.js +0 -1
  530. package/app/.next/static/chunks/app/api/models/alias/route-b30d6a5358c02312.js +0 -1
  531. package/app/.next/static/chunks/app/api/models/route-b30d6a5358c02312.js +0 -1
  532. package/app/.next/static/chunks/app/api/models/test/route-b30d6a5358c02312.js +0 -1
  533. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-b30d6a5358c02312.js +0 -1
  534. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-b30d6a5358c02312.js +0 -1
  535. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-b30d6a5358c02312.js +0 -1
  536. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-b30d6a5358c02312.js +0 -1
  537. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-b30d6a5358c02312.js +0 -1
  538. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-b30d6a5358c02312.js +0 -1
  539. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-b30d6a5358c02312.js +0 -1
  540. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-b30d6a5358c02312.js +0 -1
  541. package/app/.next/static/chunks/app/api/pricing/route-b30d6a5358c02312.js +0 -1
  542. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-b30d6a5358c02312.js +0 -1
  543. package/app/.next/static/chunks/app/api/provider-nodes/route-b30d6a5358c02312.js +0 -1
  544. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-b30d6a5358c02312.js +0 -1
  545. package/app/.next/static/chunks/app/api/providers/[id]/models/route-b30d6a5358c02312.js +0 -1
  546. package/app/.next/static/chunks/app/api/providers/[id]/route-b30d6a5358c02312.js +0 -1
  547. package/app/.next/static/chunks/app/api/providers/[id]/test/route-b30d6a5358c02312.js +0 -1
  548. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-b30d6a5358c02312.js +0 -1
  549. package/app/.next/static/chunks/app/api/providers/client/route-b30d6a5358c02312.js +0 -1
  550. package/app/.next/static/chunks/app/api/providers/route-b30d6a5358c02312.js +0 -1
  551. package/app/.next/static/chunks/app/api/providers/test-batch/route-b30d6a5358c02312.js +0 -1
  552. package/app/.next/static/chunks/app/api/providers/validate/route-b30d6a5358c02312.js +0 -1
  553. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-b30d6a5358c02312.js +0 -1
  554. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-b30d6a5358c02312.js +0 -1
  555. package/app/.next/static/chunks/app/api/proxy-pools/route-b30d6a5358c02312.js +0 -1
  556. package/app/.next/static/chunks/app/api/settings/database/route-b30d6a5358c02312.js +0 -1
  557. package/app/.next/static/chunks/app/api/settings/proxy-test/route-b30d6a5358c02312.js +0 -1
  558. package/app/.next/static/chunks/app/api/settings/require-login/route-b30d6a5358c02312.js +0 -1
  559. package/app/.next/static/chunks/app/api/settings/route-b30d6a5358c02312.js +0 -1
  560. package/app/.next/static/chunks/app/api/shutdown/route-b30d6a5358c02312.js +0 -1
  561. package/app/.next/static/chunks/app/api/tags/route-b30d6a5358c02312.js +0 -1
  562. package/app/.next/static/chunks/app/api/translator/console-logs/route-b30d6a5358c02312.js +0 -1
  563. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-b30d6a5358c02312.js +0 -1
  564. package/app/.next/static/chunks/app/api/translator/load/route-b30d6a5358c02312.js +0 -1
  565. package/app/.next/static/chunks/app/api/translator/save/route-b30d6a5358c02312.js +0 -1
  566. package/app/.next/static/chunks/app/api/translator/send/route-b30d6a5358c02312.js +0 -1
  567. package/app/.next/static/chunks/app/api/translator/translate/route-b30d6a5358c02312.js +0 -1
  568. package/app/.next/static/chunks/app/api/tunnel/disable/route-b30d6a5358c02312.js +0 -1
  569. package/app/.next/static/chunks/app/api/tunnel/enable/route-b30d6a5358c02312.js +0 -1
  570. package/app/.next/static/chunks/app/api/tunnel/status/route-b30d6a5358c02312.js +0 -1
  571. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-b30d6a5358c02312.js +0 -1
  572. package/app/.next/static/chunks/app/api/usage/chart/route-b30d6a5358c02312.js +0 -1
  573. package/app/.next/static/chunks/app/api/usage/history/route-b30d6a5358c02312.js +0 -1
  574. package/app/.next/static/chunks/app/api/usage/logs/route-b30d6a5358c02312.js +0 -1
  575. package/app/.next/static/chunks/app/api/usage/providers/route-b30d6a5358c02312.js +0 -1
  576. package/app/.next/static/chunks/app/api/usage/request-details/route-b30d6a5358c02312.js +0 -1
  577. package/app/.next/static/chunks/app/api/usage/request-logs/route-b30d6a5358c02312.js +0 -1
  578. package/app/.next/static/chunks/app/api/usage/stats/route-b30d6a5358c02312.js +0 -1
  579. package/app/.next/static/chunks/app/api/usage/stream/route-b30d6a5358c02312.js +0 -1
  580. package/app/.next/static/chunks/app/api/v1/api/chat/route-b30d6a5358c02312.js +0 -1
  581. package/app/.next/static/chunks/app/api/v1/chat/completions/route-b30d6a5358c02312.js +0 -1
  582. package/app/.next/static/chunks/app/api/v1/embeddings/route-b30d6a5358c02312.js +0 -1
  583. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-b30d6a5358c02312.js +0 -1
  584. package/app/.next/static/chunks/app/api/v1/messages/route-b30d6a5358c02312.js +0 -1
  585. package/app/.next/static/chunks/app/api/v1/models/route-b30d6a5358c02312.js +0 -1
  586. package/app/.next/static/chunks/app/api/v1/responses/route-b30d6a5358c02312.js +0 -1
  587. package/app/.next/static/chunks/app/api/v1/route-b30d6a5358c02312.js +0 -1
  588. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-b30d6a5358c02312.js +0 -1
  589. package/app/.next/static/chunks/app/api/v1beta/models/route-b30d6a5358c02312.js +0 -1
  590. package/app/.next/static/chunks/app/api/v1internal/route-b30d6a5358c02312.js +0 -1
  591. package/app/.next/static/chunks/app/api/version/route-b30d6a5358c02312.js +0 -1
  592. package/app/.next/static/chunks/app/manifest.webmanifest/route-b30d6a5358c02312.js +0 -1
  593. package/app/.next/static/chunks/app/page-b30d6a5358c02312.js +0 -1
  594. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-b30d6a5358c02312.js +0 -1
  595. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-b30d6a5358c02312.js +0 -1
  596. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-b30d6a5358c02312.js +0 -1
  597. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b30d6a5358c02312.js +0 -1
  598. package/app/.next/static/chunks/webpack-819d2440cd722d0f.js +0 -1
  599. package/app/.next/static/css/c29219c65952419f.css +0 -3
  600. /package/app/.next/static/{L6G1Bw3njbM3GTWLVjBSx → -QR9sv3cHe_xOpnpUVCHx}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- "use strict";exports.id=412,exports.ids=[412],exports.modules={267:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(51126),h=c(99258);let i=a=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}})[a]||{name:a,flag:"\uD83C\uDF10"};function j({className:a=""}){let[b,c]=(0,e.useState)("en"),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(!1),o=(0,e.useRef)(null),p=async a=>{if(a!==b&&!k){l(!0),n(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:a})}),await (0,h.wn)(),c(a)}catch(a){console.error("Failed to set locale:",a)}finally{l(!1)}}};return(0,d.jsxs)("div",{className:a,children:[(0,d.jsxs)("button",{onClick:()=>n(!m),disabled:k,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,d.jsx)("span",{className:"text-xl",children:i(b).flag}),(0,d.jsx)("span",{className:"text-sm font-medium",children:i(b).name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:m?"expand_less":"expand_more"})]}),m&&(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>n(!1)}),(0,d.jsxs)("div",{ref:o,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,d.jsx)("button",{onClick:()=>n(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,d.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:g.YZ.map(a=>{let c=b===a,e=i(a);return(0,d.jsxs)("button",{onClick:()=>p(a),disabled:k,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${c?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${k?"opacity-70 cursor-wait":""}`,title:e.name,children:[(0,d.jsx)("span",{className:"text-2xl",children:e.flag}),(0,d.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:e.name}),c&&(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},a)})})})]})]}),document.body)]})}},4770:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,options:b=[],value:c,onChange:g,placeholder:h="Select an option",error:i,hint:j,disabled:k=!1,required:l=!1,className:m,selectClassName:n,...o}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",m),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,l&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("select",{value:c,onChange:g,disabled:k,className:(0,e.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",n),...o,children:[(0,d.jsx)("option",{value:"",disabled:!0,children:h}),b.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}),(0,d.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},5291:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(79346),i=c(86209),j=c(56110);function k({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),q=(0,e.useCallback)((a,b)=>{"builder-id"===a?l("builder-id"):"idc"===a?(l("idc"),p(b)):"social"===a?(l("social"),n(b.provider)):"import"===a&&c?.()},[c]),r=()=>{l(null),n(null),p(null)};return g?"builder-id"===g||"idc"===g?(0,d.jsx)(h.default,{isOpen:a,provider:"kiro",providerInfo:b,onSuccess:()=>{l(null),p(null),c?.(),f?.()},onClose:r,idcConfig:o}):"social"===g&&m?(0,d.jsx)(j.default,{isOpen:a,provider:m,onSuccess:()=>{l(null),n(null),c?.(),f?.()},onClose:r}):null:(0,d.jsx)(i.default,{isOpen:a,onMethodSelect:q,onClose:f})}k.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},17660:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,className:k,...l}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",j&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[i],k),...l,children:[(b||h)&&(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:g})}),(0,d.jsxs)("div",{children:[b&&(0,d.jsx)("h3",{className:"text-text-main font-semibold",children:b}),c&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...f,children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:b})]})}},25919:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({src:a,alt:b="Avatar",name:c,size:g="md",className:h}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return a?(0,d.jsx)("div",{className:(0,e.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],h),style:{backgroundImage:`url(${a})`},role:"img","aria-label":b}):(0,d.jsx)("div",{className:(0,e.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],(a=>{if(!a)return"bg-primary";let b=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],c=a.charCodeAt(0)%b.length;return b[c]})(c),h),role:"img","aria-label":b,children:(a=>{if(!a)return"?";let b=a.split(" ");return b.length>=2?`${b[0][0]}${b[1][0]}`.toUpperCase():a.substring(0,2).toUpperCase()})(c)})}},32971:(a,b,c)=>{c.d(b,{default:()=>e});var d=c(48249);function e({text:a,children:b,position:c="top"}){return(0,d.jsxs)("div",{className:"relative inline-flex group",children:[b,(0,d.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[c]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug bg-gray-900 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,children:a})]})}},39645:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(95145),g=c(99070);function h({isOpen:a,onClose:b,title:c="Manual Configuration",configs:i=[]}){let[j,k]=(0,e.useState)(null),l=async(a,b)=>{try{await navigator.clipboard.writeText(a),k(b),setTimeout(()=>k(null),2e3)}catch(a){console.log("Failed to copy:",a)}};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:c,size:"xl",children:(0,d.jsx)("div",{className:"flex flex-col gap-4",children:i.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:a.filename}),(0,d.jsxs)(g.default,{variant:"ghost",size:"sm",onClick:()=>l(a.content,b),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:j===b?"check":"content_copy"}),j===b?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:a.content})]},b))})})}},41371:(a,b,c)=>{c.d(b,{i:()=>f});var d=c(31417);let e=0,f=(0,d.v)((a,b)=>({notifications:[],addNotification:c=>{let d=++e,f={id:d,type:c.type||"info",message:c.message,title:c.title||null,duration:c.duration??5e3,dismissible:c.dismissible??!0,createdAt:Date.now()};return a(a=>({notifications:[...a.notifications,f]})),f.duration>0&&setTimeout(()=>b().removeNotification(d),f.duration),d},removeNotification:b=>{a(a=>({notifications:a.notifications.filter(a=>a.id!==b)}))},clearAll:()=>a({notifications:[]}),success:(a,c)=>b().addNotification({type:"success",message:a,title:c}),error:(a,c)=>b().addNotification({type:"error",message:a,title:c,duration:8e3}),warning:(a,c)=>b().addNotification({type:"warning",message:a,title:c}),info:(a,c)=>b().addNotification({type:"info",message:a,title:c})}))},42118:(a,b,c)=>{c.d(b,{D:()=>i});var d=c(67484),e=c(13033);function f(a){return()=>{}}function g(){return!1}function h(){return!1}function i(){let{theme:a,setTheme:b,toggleTheme:c,initTheme:i}=(0,e.A)(),j=(0,d.useSyncExternalStore)(f,g,h);return{theme:a,setTheme:b,toggleTheme:c,isDark:"dark"===a||"system"===a&&j}}},42196:(a,b,c)=>{c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(19099),k=c(71404),l=c(12020),m=c(99070),n=c(95145);let o=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"MITM",icon:"security"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"}],q=[{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function r({onClose:a}){let b=(0,j.usePathname)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),y=a=>"/dashboard/endpoint"===a?"/dashboard"===b||b.startsWith("/dashboard/endpoint"):b.startsWith(a),z=async()=>{h(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(a){}h(!1),f(!1),t(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("aside",{className:"flex w-72 flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-colors duration-300 min-h-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,d.jsxs)("div",{className:"px-6 py-4 flex flex-col gap-2",children:[(0,d.jsxs)(i(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-9 rounded bg-linear-to-br from-[#f97815] to-[#c2590a]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:l.vQ.name}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["v",l.vQ.version]})]})]}),u&&(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",u.latestVersion]}),(0,d.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all",children:"npm install -g 9router@latest"})]})]}),(0,d.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:[o.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href)),(0,d.jsxs)("div",{className:"pt-4 mt-2",children:[(0,d.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),w&&(0,d.jsxs)(i(),{href:"/dashboard/translator",onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y("/dashboard/translator")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y("/dashboard/translator")?"fill-1":"group-hover:text-primary transition-colors"),children:"translate"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:"Translator"})]}),p.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href))]}),(0,d.jsxs)("div",{className:"pt-4 mt-2",children:[(0,d.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),q.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href))]})]}),(0,d.jsxs)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,d.jsx)("div",{className:"flex flex-col",children:(0,d.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,d.jsx)(m.default,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>f(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"})]})]}),(0,d.jsx)(n.ConfirmModal,{isOpen:c,onClose:()=>f(!1),onConfirm:z,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:g}),s&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"text-center p-8",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,d.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,d.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,d.jsx)(m.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}r.propTypes={onClose:g().func}},48781:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},50377:(a,b,c)=>{c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{navigator.clipboard.writeText(b),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{c.d(b,{Ex:()=>j.default,$n:()=>d.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,G9:()=>t.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,c5:()=>q.default,uR:()=>o.default,aF:()=>h.default,rq:()=>n.default,LF:()=>m.default,gM:()=>r.default,Iz:()=>v.default,l6:()=>f.default,UW:()=>l.default,lM:()=>k.default,m_:()=>w.default,jK:()=>p.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514),l=c(53845);c(19308),c(42196),c(86739),c(48781);var m=c(79346),n=c(83352),o=c(39645),p=c(87226),q=c(267),r=c(91809);c(86209);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(91099),w=c(32971);c(85306),c(53838)},51109:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Run this command in your terminal, then click ",(0,d.jsx)("strong",{children:"Retry"}),":"]}),(0,d.jsx)("pre",{className:"text-xs bg-black/10 dark:bg-white/10 rounded p-2 font-mono select-all",children:"npm i better-sqlite3 -g"}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},53838:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,d.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,d.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{theme:c,toggleTheme:h,isDark:i}=(0,e.D)(),j={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(j[b],a),"aria-label":`Switch to ${i?"light":"dark"} mode`,title:`Switch to ${i?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:i?"light_mode":"dark_mode"})})}},56110:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)(),v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},71404:(a,b,c)=>{c.d(b,{cn:()=>d});function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},74812:(a,b,c)=>{c.d(b,{CardSkeleton:()=>i,PageLoading:()=>g,Skeleton:()=>h,Spinner:()=>f,default:()=>j});var d=c(48249),e=c(71404);function f({size:a="md",className:b}){return(0,d.jsx)("span",{className:(0,e.cn)("material-symbols-outlined animate-spin text-primary",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[a],b),children:"progress_activity"})}function g({message:a="Loading..."}){return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,d.jsx)(f,{size:"xl"}),(0,d.jsx)("p",{className:"mt-4 text-text-muted",children:a})]})}function h({className:a,...b}){return(0,d.jsx)("div",{className:(0,e.cn)("animate-pulse rounded-lg bg-border",a),...b})}function i(){return(0,d.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)(h,{className:"h-4 w-24"}),(0,d.jsx)(h,{className:"size-10 rounded-lg"})]}),(0,d.jsx)(h,{className:"h-8 w-16 mb-2"}),(0,d.jsx)(h,{className:"h-3 w-20"})]})}function j({type:a="spinner",...b}){switch(a){case"page":return(0,d.jsx)(g,{...b});case"skeleton":return(0,d.jsx)(h,{...b});case"card":return(0,d.jsx)(i,{...b});default:return(0,d.jsx)(f,{...b})}}},75171:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={default:"bg-black/5 dark:bg-white/10 text-text-muted",primary:"bg-primary/10 text-primary",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},g={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function h({children:a,variant:b="default",size:c="md",dot:i=!1,icon:j,className:k}){return(0,d.jsxs)("span",{className:(0,e.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",f[b],g[c],k),children:[i&&(0,d.jsx)("span",{className:(0,e.cn)("size-1.5 rounded-full","success"===b&&"bg-green-500","warning"===b&&"bg-yellow-500","error"===b&&"bg-red-500","info"===b&&"bg-blue-500","primary"===b&&"bg-primary","default"===b&&"bg-gray-500")}),j&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:j}),a]})}},79346:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g}){let[k,l]=(0,e.useState)("waiting"),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),y=(0,e.useRef)(null),z=(0,e.useRef)(!1),{copied:A,copy:B}=(0,i.C)(),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let G=(0,e.useCallback)(async(a,c)=>{if(m)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:m.redirectUri,codeVerifier:m.codeVerifier,state:c})}),e=await d.json();if(!d.ok)throw Error(e.error);l("success"),f?.()}catch(a){r(a.message),l("error")}},[m,b,f]),H=(0,e.useCallback)(async(a,c,d,e)=>{z.current=!1,x(!0);for(let g=0;g<60;g++){if(z.current){console.log("[OAuthModal] Polling aborted"),x(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),z.current){console.log("[OAuthModal] Polling aborted after sleep"),x(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){z.current=!0,l("success"),x(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){r(a.message),l("error"),x(!1);return}}r("Authorization timeout"),l("error"),x(!1)},[b,f]),I=(0,e.useCallback)(async()=>{if(b)try{let a;if(r(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(b)){t(!0),l("waiting");let a=await fetch(`/api/oauth/${b}/device-code`),c=await a.json();if(!a.ok)throw Error(c.error);v(c);let d=c.verification_uri_complete||c.verification_uri;d&&window.open(d,"_blank");let e="kiro"===b?{_clientId:c._clientId,_clientSecret:c._clientSecret}:null;H(c.device_code,c.codeVerifier,c.interval||5,e);return}if("codex"===b)a="http://localhost:1455/auth/callback";else{let b=window.location.port||("https:"===window.location.protocol?"443":"80");a=`http://localhost:${b}/callback`}let c=await fetch(`/api/oauth/${b}/authorize?redirect_uri=${encodeURIComponent(a)}`),d=await c.json();if(!c.ok)throw Error(d.error);n({...d,redirectUri:a}),"codex"!==b&&C?(l("waiting"),y.current=window.open(d.authUrl,"oauth_popup","width=600,height=700"),y.current||l("input")):(l("input"),window.open(d.authUrl,"_blank"))}catch(a){r(a.message),l("error")}},[b,C,H]),J=async()=>{try{r(null);let a=new URL(o),b=a.searchParams.get("code"),c=a.searchParams.get("state"),d=a.searchParams.get("error");if(d)throw Error(a.searchParams.get("error_description")||d);if(!b)throw Error("No authorization code found in URL");await G(b,c)}catch(a){r(a.message),l("error")}},K=(0,e.useCallback)(()=>{g()},[g]);return b&&c?(0,d.jsx)(h.aF,{isOpen:a,title:`Connect ${c.name}`,onClose:K,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===k&&!s&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,d.jsx)(h.$n,{variant:"ghost",onClick:()=>l("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===k&&s&&u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:u.verification_uri}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"verify_url"===A?"check":"content_copy",onClick:()=>B(u.verification_uri,"verify_url")})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:u.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===A?"check":"content_copy",onClick:()=>B(u.user_code,"user_code")})]})]})]}),w&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===k&&!s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:m?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===A?"check":"content_copy",onClick:()=>B(m?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:o,onChange:a=>p(a.target.value),placeholder:E,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:J,fullWidth:!0,disabled:!o,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:K,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===k&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:K,fullWidth:!0,children:"Done"})]}),"error"===k&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:I,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:K,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},79488:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),p=async()=>{if(!f.trim())return void m("Please paste your cookie");k(!0),m(null);try{let a=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:f.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Authentication failed");o(!0),setTimeout(()=>{b?.(),q()},1500)}catch(a){m(a.message)}finally{k(!1)}},q=()=>{g(""),m(null),o(!1),c?.()};return(0,d.jsx)(h.aF,{isOpen:a,onClose:q,title:"iFlow Cookie Authentication",children:(0,d.jsx)("div",{className:"space-y-4",children:n?(0,d.jsxs)("div",{className:"text-center py-8",children:[(0,d.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,d.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,d.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,d.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,d.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,d.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,d.jsx)("li",{children:"Login to your account"}),(0,d.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,d.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,d.jsx)("li",{children:"Paste it below"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:j})]}),l&&(0,d.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,d.jsx)("p",{className:"text-sm text-error",children:l})}),(0,d.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:q,disabled:j,fullWidth:!0,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:p,loading:j,fullWidth:!0,children:"Authenticate"})]})]})})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func}},83352:(a,b,c)=>{c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(91431),j=c(96919);let k=[...Object.keys(j.zN),...Object.keys(j.fg)];function l({isOpen:a,onClose:b,onSelect:c,selectedModel:f,activeProviders:g=[],title:m="Select Model",modelAliases:n={}}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)([]),u=(0,e.useMemo)(()=>({...j.zN,...j.fg}),[]),v=(0,e.useMemo)(()=>{let a={};return[...new Set([...g.map(a=>a.provider)])].sort((a,b)=>{let c=k.indexOf(a),d=k.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(b=>{let c=i.Xg[b]||b,d=u[b]||{name:b,color:"#666"},e=(0,j.mq)(b)||(0,j.gb)(b);if(d.passthroughModels){let e=Object.entries(n).filter(([,a])=>a.startsWith(`${c}/`)).map(([a,b])=>({id:b.replace(`${c}/`,""),name:a,value:b}));if(e.length>0){let f=s.find(a=>a.id===b),g=f?.name||d.name;a[b]={name:g,alias:c,color:d.color,models:e}}}else if(e){let c=g.find(a=>a.provider===b),e=s.find(a=>a.id===b),f=c?.name||e?.name||d.name,h=c?.providerSpecificData?.prefix||e?.prefix||b,i=Object.entries(n).filter(([,a])=>a.startsWith(`${b}/`)).map(([a,c])=>({id:c.replace(`${b}/`,""),name:a,value:`${h}/${c.replace(`${b}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${b}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[b]={name:f,alias:h,color:d.color,models:j,isCustom:!0,hasModels:i.length>0}}else{let e=(0,i.KC)(b),f=new Set(e.map(a=>a.id)),g=Object.entries(n).filter(([a,b])=>b.startsWith(`${c}/`)&&a===b.replace(`${c}/`,"")&&!f.has(b.replace(`${c}/`,""))).map(([,a])=>{let b=a.replace(`${c}/`,"");return{id:b,name:b,value:a,isCustom:!0}}),h=[...e.map(a=>({id:a.id,name:a.name,value:`${c}/${a.id}`})),...g];h.length>0&&(a[b]={name:d.name,alias:c,color:d.color,models:h})}}),a},[g,n,u,s]),w=(0,e.useMemo)(()=>{if(!o.trim())return q;let a=o.toLowerCase();return q.filter(b=>b.name.toLowerCase().includes(a))},[q,o]),x=(0,e.useMemo)(()=>{if(!o.trim())return v;let a=o.toLowerCase(),b={};return Object.entries(v).forEach(([c,d])=>{let e=d.models.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a)),f=d.name.toLowerCase().includes(a);(e.length>0||f)&&(b[c]={...d,models:e})}),b},[v,o]),y=a=>{c(a),b(),p("")};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),p("")},title:m,size:"md",className:"p-4!",children:[(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:o,onChange:a=>p(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[w.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",w.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:w.map(a=>{let b=f===a.name;return(0,d.jsx)("button",{onClick:()=>y({id:a.name,name:a.name,value:a.name}),className:`
1
+ "use strict";exports.id=412,exports.ids=[412],exports.modules={267:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(51126),h=c(99258);let i=a=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}})[a]||{name:a,flag:"\uD83C\uDF10"};function j({className:a=""}){let[b,c]=(0,e.useState)("en"),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(!1),o=(0,e.useRef)(null),p=async a=>{if(a!==b&&!k){l(!0),n(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:a})}),await (0,h.wn)(),c(a)}catch(a){console.error("Failed to set locale:",a)}finally{l(!1)}}};return(0,d.jsxs)("div",{className:a,children:[(0,d.jsxs)("button",{onClick:()=>n(!m),disabled:k,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,d.jsx)("span",{className:"text-xl",children:i(b).flag}),(0,d.jsx)("span",{className:"text-sm font-medium",children:i(b).name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:m?"expand_less":"expand_more"})]}),m&&(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>n(!1)}),(0,d.jsxs)("div",{ref:o,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,d.jsx)("button",{onClick:()=>n(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,d.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:g.YZ.map(a=>{let c=b===a,e=i(a);return(0,d.jsxs)("button",{onClick:()=>p(a),disabled:k,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${c?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${k?"opacity-70 cursor-wait":""}`,title:e.name,children:[(0,d.jsx)("span",{className:"text-2xl",children:e.flag}),(0,d.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:e.name}),c&&(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},a)})})})]})]}),document.body)]})}},4770:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,options:b=[],value:c,onChange:g,placeholder:h="Select an option",error:i,hint:j,disabled:k=!1,required:l=!1,className:m,selectClassName:n,...o}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",m),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,l&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("select",{value:c,onChange:g,disabled:k,className:(0,e.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",n),...o,children:[(0,d.jsx)("option",{value:"",disabled:!0,children:h}),b.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}),(0,d.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},5291:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(79346),i=c(86209),j=c(56110);function k({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),q=(0,e.useCallback)((a,b)=>{"builder-id"===a?l("builder-id"):"idc"===a?(l("idc"),p(b)):"social"===a?(l("social"),n(b.provider)):"import"===a&&c?.()},[c]),r=()=>{l(null),n(null),p(null)};return g?"builder-id"===g||"idc"===g?(0,d.jsx)(h.default,{isOpen:a,provider:"kiro",providerInfo:b,onSuccess:()=>{l(null),p(null),c?.(),f?.()},onClose:r,idcConfig:o}):"social"===g&&m?(0,d.jsx)(j.default,{isOpen:a,provider:m,onSuccess:()=>{l(null),n(null),c?.(),f?.()},onClose:r}):null:(0,d.jsx)(i.default,{isOpen:a,onMethodSelect:q,onClose:f})}k.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},17660:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,className:k,...l}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",j&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[i],k),...l,children:[(b||h)&&(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:g})}),(0,d.jsxs)("div",{children:[b&&(0,d.jsx)("h3",{className:"text-text-main font-semibold",children:b}),c&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...f,children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:b})]})}},25919:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({src:a,alt:b="Avatar",name:c,size:g="md",className:h}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return a?(0,d.jsx)("div",{className:(0,e.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],h),style:{backgroundImage:`url(${a})`},role:"img","aria-label":b}):(0,d.jsx)("div",{className:(0,e.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[g],(a=>{if(!a)return"bg-primary";let b=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],c=a.charCodeAt(0)%b.length;return b[c]})(c),h),role:"img","aria-label":b,children:(a=>{if(!a)return"?";let b=a.split(" ");return b.length>=2?`${b[0][0]}${b[1][0]}`.toUpperCase():a.substring(0,2).toUpperCase()})(c)})}},32971:(a,b,c)=>{c.d(b,{default:()=>e});var d=c(48249);function e({text:a,children:b,position:c="top"}){return(0,d.jsxs)("div",{className:"relative inline-flex group",children:[b,(0,d.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[c]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug bg-gray-900 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,children:a})]})}},39645:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(95145),g=c(99070);function h({isOpen:a,onClose:b,title:c="Manual Configuration",configs:i=[]}){let[j,k]=(0,e.useState)(null),l=async(a,b)=>{try{await navigator.clipboard.writeText(a),k(b),setTimeout(()=>k(null),2e3)}catch(a){console.log("Failed to copy:",a)}};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:c,size:"xl",children:(0,d.jsx)("div",{className:"flex flex-col gap-4",children:i.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:a.filename}),(0,d.jsxs)(g.default,{variant:"ghost",size:"sm",onClick:()=>l(a.content,b),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:j===b?"check":"content_copy"}),j===b?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:a.content})]},b))})})}},41371:(a,b,c)=>{c.d(b,{i:()=>f});var d=c(31417);let e=0,f=(0,d.v)((a,b)=>({notifications:[],addNotification:c=>{let d=++e,f={id:d,type:c.type||"info",message:c.message,title:c.title||null,duration:c.duration??5e3,dismissible:c.dismissible??!0,createdAt:Date.now()};return a(a=>({notifications:[...a.notifications,f]})),f.duration>0&&setTimeout(()=>b().removeNotification(d),f.duration),d},removeNotification:b=>{a(a=>({notifications:a.notifications.filter(a=>a.id!==b)}))},clearAll:()=>a({notifications:[]}),success:(a,c)=>b().addNotification({type:"success",message:a,title:c}),error:(a,c)=>b().addNotification({type:"error",message:a,title:c,duration:8e3}),warning:(a,c)=>b().addNotification({type:"warning",message:a,title:c}),info:(a,c)=>b().addNotification({type:"info",message:a,title:c})}))},42118:(a,b,c)=>{c.d(b,{D:()=>i});var d=c(67484),e=c(13033);function f(a){return()=>{}}function g(){return!1}function h(){return!1}function i(){let{theme:a,setTheme:b,toggleTheme:c,initTheme:i}=(0,e.A)(),j=(0,d.useSyncExternalStore)(f,g,h);return{theme:a,setTheme:b,toggleTheme:c,isDark:"dark"===a||"system"===a&&j}}},42196:(a,b,c)=>{c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(19099),k=c(71404),l=c(12020),m=c(99070),n=c(95145);let o=[{href:"/dashboard/employees",label:"E Dashboard",icon:"badge"},{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"MITM",icon:"security"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"}],q=[{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function r({onClose:a}){let b=(0,j.usePathname)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),y=a=>"/dashboard/endpoint"===a?"/dashboard"===b||b.startsWith("/dashboard/endpoint"):b.startsWith(a),z=async()=>{h(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(a){}h(!1),f(!1),t(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("aside",{className:"flex w-72 flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-colors duration-300 min-h-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,d.jsxs)("div",{className:"px-6 py-4 flex flex-col gap-2",children:[(0,d.jsxs)(i(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-9 rounded bg-linear-to-br from-[#f97815] to-[#c2590a]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:l.vQ.name}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["v",l.vQ.version]})]})]}),u&&(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",u.latestVersion]}),(0,d.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all",children:"npm install -g 9router@latest"})]})]}),(0,d.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:[o.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href)),(0,d.jsxs)("div",{className:"pt-4 mt-2",children:[(0,d.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),w&&(0,d.jsxs)(i(),{href:"/dashboard/translator",onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y("/dashboard/translator")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y("/dashboard/translator")?"fill-1":"group-hover:text-primary transition-colors"),children:"translate"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:"Translator"})]}),p.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href))]}),(0,d.jsxs)("div",{className:"pt-4 mt-2",children:[(0,d.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),q.map(b=>(0,d.jsxs)(i(),{href:b.href,onClick:a,className:(0,k.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",y(b.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,d.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[18px]",y(b.href)?"fill-1":"group-hover:text-primary transition-colors"),children:b.icon}),(0,d.jsx)("span",{className:"text-sm font-medium",children:b.label})]},b.href))]})]}),(0,d.jsxs)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,d.jsx)("div",{className:"flex flex-col",children:(0,d.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,d.jsx)(m.default,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>f(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"})]})]}),(0,d.jsx)(n.ConfirmModal,{isOpen:c,onClose:()=>f(!1),onConfirm:z,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:g}),s&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"text-center p-8",children:[(0,d.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,d.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,d.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,d.jsx)(m.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}r.propTypes={onClose:g().func}},48781:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},50377:(a,b,c)=>{c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{navigator.clipboard.writeText(b),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{c.d(b,{Ex:()=>j.default,$n:()=>d.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,G9:()=>t.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,c5:()=>q.default,uR:()=>o.default,aF:()=>h.default,rq:()=>n.default,LF:()=>m.default,gM:()=>r.default,Iz:()=>v.default,l6:()=>f.default,UW:()=>l.default,lM:()=>k.default,m_:()=>w.default,jK:()=>p.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514),l=c(53845);c(19308),c(42196),c(86739),c(48781);var m=c(79346),n=c(83352),o=c(39645),p=c(87226),q=c(267),r=c(91809);c(86209);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(91099),w=c(32971);c(85306),c(53838)},51109:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Run this command in your terminal, then click ",(0,d.jsx)("strong",{children:"Retry"}),":"]}),(0,d.jsx)("pre",{className:"text-xs bg-black/10 dark:bg-white/10 rounded p-2 font-mono select-all",children:"npm i better-sqlite3 -g"}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},53838:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,d.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,d.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{theme:c,toggleTheme:h,isDark:i}=(0,e.D)(),j={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(j[b],a),"aria-label":`Switch to ${i?"light":"dark"} mode`,title:`Switch to ${i?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:i?"light_mode":"dark_mode"})})}},56110:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)(),v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},71404:(a,b,c)=>{c.d(b,{cn:()=>d});function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},74812:(a,b,c)=>{c.d(b,{CardSkeleton:()=>i,PageLoading:()=>g,Skeleton:()=>h,Spinner:()=>f,default:()=>j});var d=c(48249),e=c(71404);function f({size:a="md",className:b}){return(0,d.jsx)("span",{className:(0,e.cn)("material-symbols-outlined animate-spin text-primary",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[a],b),children:"progress_activity"})}function g({message:a="Loading..."}){return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,d.jsx)(f,{size:"xl"}),(0,d.jsx)("p",{className:"mt-4 text-text-muted",children:a})]})}function h({className:a,...b}){return(0,d.jsx)("div",{className:(0,e.cn)("animate-pulse rounded-lg bg-border",a),...b})}function i(){return(0,d.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)(h,{className:"h-4 w-24"}),(0,d.jsx)(h,{className:"size-10 rounded-lg"})]}),(0,d.jsx)(h,{className:"h-8 w-16 mb-2"}),(0,d.jsx)(h,{className:"h-3 w-20"})]})}function j({type:a="spinner",...b}){switch(a){case"page":return(0,d.jsx)(g,{...b});case"skeleton":return(0,d.jsx)(h,{...b});case"card":return(0,d.jsx)(i,{...b});default:return(0,d.jsx)(f,{...b})}}},75171:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={default:"bg-black/5 dark:bg-white/10 text-text-muted",primary:"bg-primary/10 text-primary",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},g={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function h({children:a,variant:b="default",size:c="md",dot:i=!1,icon:j,className:k}){return(0,d.jsxs)("span",{className:(0,e.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",f[b],g[c],k),children:[i&&(0,d.jsx)("span",{className:(0,e.cn)("size-1.5 rounded-full","success"===b&&"bg-green-500","warning"===b&&"bg-yellow-500","error"===b&&"bg-red-500","info"===b&&"bg-blue-500","primary"===b&&"bg-primary","default"===b&&"bg-gray-500")}),j&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:j}),a]})}},79346:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g}){let[k,l]=(0,e.useState)("waiting"),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),y=(0,e.useRef)(null),z=(0,e.useRef)(!1),{copied:A,copy:B}=(0,i.C)(),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let G=(0,e.useCallback)(async(a,c)=>{if(m)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:m.redirectUri,codeVerifier:m.codeVerifier,state:c})}),e=await d.json();if(!d.ok)throw Error(e.error);l("success"),f?.()}catch(a){r(a.message),l("error")}},[m,b,f]),H=(0,e.useCallback)(async(a,c,d,e)=>{z.current=!1,x(!0);for(let g=0;g<60;g++){if(z.current){console.log("[OAuthModal] Polling aborted"),x(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),z.current){console.log("[OAuthModal] Polling aborted after sleep"),x(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){z.current=!0,l("success"),x(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){r(a.message),l("error"),x(!1);return}}r("Authorization timeout"),l("error"),x(!1)},[b,f]),I=(0,e.useCallback)(async()=>{if(b)try{let a;if(r(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(b)){t(!0),l("waiting");let a=await fetch(`/api/oauth/${b}/device-code`),c=await a.json();if(!a.ok)throw Error(c.error);v(c);let d=c.verification_uri_complete||c.verification_uri;d&&window.open(d,"_blank");let e="kiro"===b?{_clientId:c._clientId,_clientSecret:c._clientSecret}:null;H(c.device_code,c.codeVerifier,c.interval||5,e);return}if("codex"===b)a="http://localhost:1455/auth/callback";else{let b=window.location.port||("https:"===window.location.protocol?"443":"80");a=`http://localhost:${b}/callback`}let c=await fetch(`/api/oauth/${b}/authorize?redirect_uri=${encodeURIComponent(a)}`),d=await c.json();if(!c.ok)throw Error(d.error);n({...d,redirectUri:a}),"codex"!==b&&C?(l("waiting"),y.current=window.open(d.authUrl,"oauth_popup","width=600,height=700"),y.current||l("input")):(l("input"),window.open(d.authUrl,"_blank"))}catch(a){r(a.message),l("error")}},[b,C,H]),J=async()=>{try{r(null);let a=new URL(o),b=a.searchParams.get("code"),c=a.searchParams.get("state"),d=a.searchParams.get("error");if(d)throw Error(a.searchParams.get("error_description")||d);if(!b)throw Error("No authorization code found in URL");await G(b,c)}catch(a){r(a.message),l("error")}},K=(0,e.useCallback)(()=>{g()},[g]);return b&&c?(0,d.jsx)(h.aF,{isOpen:a,title:`Connect ${c.name}`,onClose:K,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===k&&!s&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,d.jsx)(h.$n,{variant:"ghost",onClick:()=>l("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===k&&s&&u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:u.verification_uri}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"verify_url"===A?"check":"content_copy",onClick:()=>B(u.verification_uri,"verify_url")})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:u.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===A?"check":"content_copy",onClick:()=>B(u.user_code,"user_code")})]})]})]}),w&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===k&&!s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:m?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===A?"check":"content_copy",onClick:()=>B(m?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:o,onChange:a=>p(a.target.value),placeholder:E,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:J,fullWidth:!0,disabled:!o,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:K,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===k&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:K,fullWidth:!0,children:"Done"})]}),"error"===k&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:I,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:K,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},79488:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),p=async()=>{if(!f.trim())return void m("Please paste your cookie");k(!0),m(null);try{let a=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:f.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Authentication failed");o(!0),setTimeout(()=>{b?.(),q()},1500)}catch(a){m(a.message)}finally{k(!1)}},q=()=>{g(""),m(null),o(!1),c?.()};return(0,d.jsx)(h.aF,{isOpen:a,onClose:q,title:"iFlow Cookie Authentication",children:(0,d.jsx)("div",{className:"space-y-4",children:n?(0,d.jsxs)("div",{className:"text-center py-8",children:[(0,d.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,d.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,d.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,d.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,d.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,d.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,d.jsx)("li",{children:"Login to your account"}),(0,d.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,d.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,d.jsx)("li",{children:"Paste it below"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:j})]}),l&&(0,d.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,d.jsx)("p",{className:"text-sm text-error",children:l})}),(0,d.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:q,disabled:j,fullWidth:!0,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:p,loading:j,fullWidth:!0,children:"Authenticate"})]})]})})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func}},83352:(a,b,c)=>{c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(91431),j=c(96919);let k=[...Object.keys(j.zN),...Object.keys(j.fg)];function l({isOpen:a,onClose:b,onSelect:c,selectedModel:f,activeProviders:g=[],title:m="Select Model",modelAliases:n={}}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)([]),u=(0,e.useMemo)(()=>({...j.zN,...j.fg}),[]),v=(0,e.useMemo)(()=>{let a={};return[...new Set([...g.map(a=>a.provider)])].sort((a,b)=>{let c=k.indexOf(a),d=k.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(b=>{let c=i.Xg[b]||b,d=u[b]||{name:b,color:"#666"},e=(0,j.mq)(b)||(0,j.gb)(b);if(d.passthroughModels){let e=Object.entries(n).filter(([,a])=>a.startsWith(`${c}/`)).map(([a,b])=>({id:b.replace(`${c}/`,""),name:a,value:b}));if(e.length>0){let f=s.find(a=>a.id===b),g=f?.name||d.name;a[b]={name:g,alias:c,color:d.color,models:e}}}else if(e){let c=g.find(a=>a.provider===b),e=s.find(a=>a.id===b),f=c?.name||e?.name||d.name,h=c?.providerSpecificData?.prefix||e?.prefix||b,i=Object.entries(n).filter(([,a])=>a.startsWith(`${b}/`)).map(([a,c])=>({id:c.replace(`${b}/`,""),name:a,value:`${h}/${c.replace(`${b}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${b}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[b]={name:f,alias:h,color:d.color,models:j,isCustom:!0,hasModels:i.length>0}}else{let e=(0,i.KC)(b),f=new Set(e.map(a=>a.id)),g=Object.entries(n).filter(([a,b])=>b.startsWith(`${c}/`)&&a===b.replace(`${c}/`,"")&&!f.has(b.replace(`${c}/`,""))).map(([,a])=>{let b=a.replace(`${c}/`,"");return{id:b,name:b,value:a,isCustom:!0}}),h=[...e.map(a=>({id:a.id,name:a.name,value:`${c}/${a.id}`})),...g];h.length>0&&(a[b]={name:d.name,alias:c,color:d.color,models:h})}}),a},[g,n,u,s]),w=(0,e.useMemo)(()=>{if(!o.trim())return q;let a=o.toLowerCase();return q.filter(b=>b.name.toLowerCase().includes(a))},[q,o]),x=(0,e.useMemo)(()=>{if(!o.trim())return v;let a=o.toLowerCase(),b={};return Object.entries(v).forEach(([c,d])=>{let e=d.models.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a)),f=d.name.toLowerCase().includes(a);(e.length>0||f)&&(b[c]={...d,models:e})}),b},[v,o]),y=a=>{c(a),b(),p("")};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),p("")},title:m,size:"md",className:"p-4!",children:[(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:o,onChange:a=>p(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[w.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",w.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:w.map(a=>{let b=f===a.name;return(0,d.jsx)("button",{onClick:()=>y({id:a.name,name:a.name,value:a.name}),className:`
2
2
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
3
3
  ${b?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
4
  `,children:a.name},a.id)})})]}),Object.entries(x).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=f===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>y(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
5
5
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
6
6
  ${c?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":b?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
7
- `,children:c?(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name},a.id)})})]},a)),0===Object.keys(x).length&&0===w.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object}},83552:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",k&&"pl-10",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},85306:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(42196),i=c(86739);function j({children:a}){let[b,c]=(0,e.useState)(!1),k=(0,f.usePathname)(),l=(0,g.i)(a=>a.notifications),m=(0,g.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:l.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[a.title?(0,d.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:a.title}):null,(0,d.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:a.message})]}),a.dismissible?(0,d.jsx)("button",{type:"button",onClick:()=>m(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),(0,d.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,d.jsx)(i.default,{onMenuClick:()=>c(!0)},k),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,d.jsx)("div",{className:"max-w-7xl mx-auto",children:a})})]})]})}},86209:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{c.d(b,{default:()=>o});var d=c(48249),e=c(19099),f=c(67484),g=c(2116),h=c.n(g),i=c(81220),j=c(49885),k=c.n(j),l=c(50412),m=c(12020),n=c(99258);function o({onMenuClick:a,showMenuButton:b=!0}){let c=(0,e.usePathname)(),g=(0,e.useRouter)(),{title:j,description:k,breadcrumbs:p}=(0,f.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/providers\/([^/]+)$/);if(b){let a=b[1],c=m.zN[a]||m.fg[a];if(c)return{title:c.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:c.name,image:`/providers/${c.id}.png`}]}}return a.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:a.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through 9Router",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),q=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,d.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:b&&(0,d.jsx)("button",{onClick:a,className:"text-text-main hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,d.jsx)("div",{className:"hidden lg:flex flex-col",children:p.length>0?(0,d.jsx)("div",{className:"flex items-center gap-2",children:p.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[b>0&&(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),a.href?(0,d.jsx)(h(),{href:a.href,className:"text-text-muted hover:text-primary transition-colors",children:a.label}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image&&(0,d.jsx)(i.default,{src:a.image,alt:a.label,width:28,height:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",sizes:"28px",onError:a=>{a.currentTarget.style.display="none"}}),(0,d.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,n.Tl)(a.label)})]})]},`${a.label}-${a.href||"current"}`))}):j?(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,n.Tl)(j)}),k&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:(0,n.Tl)(k)})]}):null}),(0,d.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,d.jsx)(l.c5,{}),(0,d.jsx)(l.UW,{}),(0,d.jsx)("button",{onClick:q,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}o.propTypes={onMenuClick:k().func,showMenuButton:k().bool}},87226:(a,b,c)=>{c.d(b,{default:()=>T});var d=c(48249),e=c(67484),f=c(19099),g=c(75171),h=c(17660),i=c(49885),j=c.n(i);let k=a=>new Intl.NumberFormat().format(a||0);function l({stats:a}){let b;return(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"text-2xl font-bold",children:k(a.totalRequests)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"text-2xl font-bold text-primary",children:k(a.totalPromptTokens)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"text-2xl font-bold text-success",children:k(a.totalCompletionTokens)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",(b=a.totalCost,`$${(b||0).toFixed(2)}`)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}l.propTypes={stats:j().object.isRequired};let m=a=>new Intl.NumberFormat().format(a||0),n=a=>`$${(a||0).toFixed(2)}`;function o(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function p({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function q({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":m(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":m(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:m(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":n(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":n(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:n(a.totalCost||a.cost)})]})}function r({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:i,onToggleSort:j,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[s,t]=(0,e.useState)(new Set),u=(0,e.useCallback)(a=>{t(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),v=(0,e.useMemo)(()=>"tokens"===k?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[k]),w=b.length+v.length;return(0,d.jsxs)(h.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(p,{field:a.field,currentSort:g,currentOrder:i})]},a.field)),v.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(p,{field:a.field,currentSort:g,currentOrder:i})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>u(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${s.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(q,{item:a.summary,viewMode:k,isSummary:!0})]}),s.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(q,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:w,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}p.propTypes={field:j().string.isRequired,currentSort:j().string.isRequired,currentOrder:j().string.isRequired},q.propTypes={item:j().object.isRequired,viewMode:j().string.isRequired,isSummary:j().bool},r.propTypes={title:j().string.isRequired,columns:j().arrayOf(j().shape({field:j().string.isRequired,label:j().string.isRequired,align:j().string})).isRequired,groupedData:j().array.isRequired,tableType:j().string.isRequired,sortBy:j().string.isRequired,sortOrder:j().string.isRequired,onToggleSort:j().func.isRequired,viewMode:j().string.isRequired,storageKey:j().string.isRequired,renderDetailCells:j().func.isRequired,renderSummaryCells:j().func.isRequired,emptyMessage:j().string.isRequired};var s=c(96103),t=c(22805);c(71763);var u=c(96919);function v({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(s.h7,{type:"target",position:t.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:i?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g}):(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function w({data:a}){return(0,d.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,d.jsx)(s.h7,{type:"source",position:t.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"9Router",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"9Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}v.propTypes={data:j().object.isRequired},w.propTypes={data:j().object.isRequired};let x={provider:v,router:w};function y({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let g=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),h=c?.toLowerCase()||"",i=f?.toLowerCase()||"",j=(0,e.useMemo)(()=>new Set(g?g.split(","):[]),[g]),k=(0,e.useMemo)(()=>new Set(h?[h]:[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),{nodes:m,edges:n}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),g=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let h=[],i=[];return h.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,j)=>{var k,l;let m,n,o=(k=a.provider,u.Q2[k]||{color:"#6b7280",name:k}),p=b.has(a.provider?.toLowerCase()),q=!p&&c.has(a.provider?.toLowerCase()),r=!p&&d.has(a.provider?.toLowerCase()),s=`provider-${a.provider}`,t={label:(o.name!==a.provider?o.name:null)||a.name||a.provider,color:o.color||"#6b7280",imageUrl:(l=a.provider,`/providers/${l}.png`),textIcon:o.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:p},v=-Math.PI/2+2*Math.PI*j/e,w=f*Math.cos(v),x=g*Math.sin(v);Math.abs(v+Math.PI/2)<Math.PI/4||Math.abs(v-3*Math.PI/2)<Math.PI/4?(m="top",n="bottom"):Math.abs(v-Math.PI/2)<Math.PI/4?(m="bottom",n="top"):w>0?(m="right",n="left"):(m="left",n="right"),h.push({id:s,type:"provider",position:{x:w-90,y:x-15},data:t,draggable:!1}),i.push({id:`e-${s}`,source:"router",sourceHandle:m,target:s,targetHandle:n,animated:p,style:(o.color,r?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:p?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:q?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:h,edges:i}})(a,j,k,l),[a,g,h,i]),o=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),p=(0,e.useRef)(null),q=(0,e.useCallback)(a=>{p.current=a,setTimeout(()=>a.fitView({padding:.3}),50)},[]);return(0,d.jsx)("div",{className:"w-full rounded-lg border border-border bg-bg-subtle/30",style:{height:480},children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(s.Gc,{nodes:m,edges:n,nodeTypes:x,fitView:!0,fitViewOptions:{padding:.3},onInit:q,proOptions:{hideAttribution:!0},panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1},o)})}y.propTypes={providers:j().arrayOf(j().shape({id:j().string,provider:j().string,name:j().string})),activeRequests:j().arrayOf(j().shape({provider:j().string,model:j().string,account:j().string})),lastProvider:j().string,errorProvider:j().string};var z=c(80322),A=c(70452),B=c(28946),C=c(22393),D=c(54206),E=c(83954),F=c(44780);let G=a=>a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a||0),H=a=>`$${(a||0).toFixed(4)}`;function I({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[i,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(h.default,{className:"p-4 flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):k?(0,d.jsx)(z.u,{width:"100%",height:200,children:(0,d.jsxs)(A.Q,{data:b,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(B.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(C.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(D.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===i?G:H,width:50}),(0,d.jsx)(E.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[G(a),"Tokens"]:[H(a),"Cost"]}),"tokens"===i?(0,d.jsx)(F.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(F.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function J({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}function K({requests:a=[]}){return(0,d.jsxs)(h.default,{className:"flex flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsx)("div",{className:"px-1 py-2 border-b border-border shrink-0",children:(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"})}),a.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=!a.status||"ok"===a.status||"success"===a.status;return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${c?"bg-success":"bg-error"}`})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:a.model,children:a.model}),(0,d.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,d.jsxs)("span",{className:"text-primary",children:[m(a.promptTokens),"↑"]})," ",(0,d.jsxs)("span",{className:"text-success",children:[m(a.completionTokens),"↓"]})]}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(J,{timestamp:a.timestamp})})]},b)})})]})}):(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function L(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=d>0?(c.promptTokens||0)*(e/d):0,g=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:f,outputCost:g,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function M(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}I.propTypes={period:j().string};let N=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"accountName",label:"Account"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],P=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],Q=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],R=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],S=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function T(){let a=(0,f.useRouter)(),b=(0,f.useSearchParams)(),c=b.get("sortBy")||"rawModel",h=b.get("sortOrder")||"asc",[i,j]=(0,e.useState)(null),[k,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(!1),[s,t]=(0,e.useState)("model"),[u,v]=(0,e.useState)([]),[w,x]=(0,e.useState)("7d"),z=(0,e.useCallback)((c,d)=>{let e=new URLSearchParams(b.toString());e.get("sortBy")===d?e.set("sortOrder","asc"===e.get("sortOrder")?"desc":"asc"):(e.set("sortBy",d),e.set("sortOrder","asc")),a.replace(`?${e.toString()}`,{scroll:!1})},[b,a]),A=(0,e.useMemo)(()=>{if(!i)return null;switch(s){case"model":{let a=i.pending?.byModel||{};return{columns:N,groupedData:M(L(i.byModel,a,c,h),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}case"account":{let a={};return i?.pending?.byAccount&&Object.entries(i.byAccount||{}).forEach(([b,c])=>{let d=i.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:O,groupedData:M(L(i.byAccount,a,c,h),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}case"apiKey":return{columns:P,groupedData:M(L(i.byApiKey,{},c,h),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})};default:return{columns:Q,groupedData:M(L(i.byEndpoint,{},c,h),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}},[i,s,c,h]);if(!i&&!k)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let B=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 self-end",children:[(0,d.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:S.map(a=>(0,d.jsx)("button",{onClick:()=>x(a.value),disabled:p,className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${w===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:a.label},a.value))}),p&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),k?B:(0,d.jsx)(l,{stats:i}),k?B:(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-2 items-stretch",children:[(0,d.jsx)(y,{providers:u,activeRequests:i.activeRequests||[],lastProvider:i.recentRequests?.[0]?.provider||"",errorProvider:i.errorProvider||""}),(0,d.jsx)(K,{requests:i.recentRequests||[]})]}),k?B:(0,d.jsx)(I,{period:w}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("div",{className:"flex items-center justify-between",children:(0,d.jsx)("select",{value:s,onChange:a=>t(a.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg-subtle text-sm font-medium text-text focus:outline-none focus:ring-2 focus:ring-primary/50",children:R.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))})}),k?B:A&&(0,d.jsx)(r,{title:"",columns:A.columns,groupedData:A.groupedData,tableType:s,sortBy:c,sortOrder:h,onToggleSort:z,storageKey:A.storageKey,renderSummaryCells:A.renderSummaryCells,renderDetailCells:A.renderDetailCells,emptyMessage:A.emptyMessage})]})]})}},91099:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,d.jsx)("div",{className:(0,e.cn)("inline-flex items-center p-1 rounded-lg","bg-black/5 dark:bg-white/5",h),children:a.map(a=>(0,d.jsxs)("button",{onClick:()=>c(a.value),className:(0,e.cn)("px-4 rounded-md font-medium transition-all",i[g],b===a.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are saved to log.txt in the application data directory."})]})}},95145:(a,b,c)=>{c.d(b,{ConfirmModal:()=>h,default:()=>g});var d=c(48249);c(67484);var e=c(71404),f=c(99070);function g({isOpen:a,onClose:b,title:c,children:f,footer:h,size:i="md",closeOnOverlay:j=!0,showCloseButton:k=!0,className:l}){return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:j?b:void 0}),(0,d.jsxs)("div",{className:(0,e.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[i],l),children:[(c||k)&&(0,d.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),c&&(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:c})]}),k&&(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:f}),h&&(0,d.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:h})]})]}):null}function h({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:i,confirmText:j="Confirm",cancelText:k="Cancel",variant:l="danger",loading:m=!1}){return(0,d.jsx)(g,{isOpen:a,onClose:b,title:e,size:"sm",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{variant:"ghost",onClick:b,disabled:m,children:k}),(0,d.jsx)(f.default,{variant:l,onClick:c,loading:m,children:j})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:i})})}},95514:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({checked:a=!1,onChange:b,label:c,description:g,disabled:h=!1,size:i="md",className:j}){let k={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center gap-3",h&&"opacity-50 cursor-not-allowed",j),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:h,onClick:()=>{!h&&b&&b(!a)},className:(0,e.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",a?"bg-primary":"bg-black/10 dark:bg-white/20",k[i].track,h&&"cursor-not-allowed"),children:(0,d.jsx)("span",{className:(0,e.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",a?k[i].translate:"translate-x-0.5",k[i].thumb,"mt-0.5")})}),(c||g)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:c}),g&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:g})]})]})}},99070:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},g={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",f[b],g[c],m&&"w-full",n),disabled:k||l,...o,children:[l?(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,a,j&&!l&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j})]})}}};
7
+ `,children:c?(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name},a.id)})})]},a)),0===Object.keys(x).length&&0===w.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object}},83552:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",k&&"pl-10",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},85306:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(42196),i=c(86739);function j({children:a}){let[b,c]=(0,e.useState)(!1),k=(0,f.usePathname)(),l=(0,g.i)(a=>a.notifications),m=(0,g.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:l.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[a.title?(0,d.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:a.title}):null,(0,d.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:a.message})]}),a.dismissible?(0,d.jsx)("button",{type:"button",onClick:()=>m(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),(0,d.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,d.jsx)(i.default,{onMenuClick:()=>c(!0)},k),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,d.jsx)("div",{className:"max-w-7xl mx-auto",children:a})})]})]})}},86209:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{c.d(b,{default:()=>o});var d=c(48249),e=c(19099),f=c(67484),g=c(2116),h=c.n(g),i=c(81220),j=c(49885),k=c.n(j),l=c(50412),m=c(12020),n=c(99258);function o({onMenuClick:a,showMenuButton:b=!0}){let c=(0,e.usePathname)(),g=(0,e.useRouter)(),{title:j,description:k,breadcrumbs:p}=(0,f.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/providers\/([^/]+)$/);if(b){let a=b[1],c=m.zN[a]||m.fg[a];if(c)return{title:c.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:c.name,image:`/providers/${c.id}.png`}]}}return a.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:a.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through 9Router",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),q=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,d.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:b&&(0,d.jsx)("button",{onClick:a,className:"text-text-main hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,d.jsx)("div",{className:"hidden lg:flex flex-col",children:p.length>0?(0,d.jsx)("div",{className:"flex items-center gap-2",children:p.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[b>0&&(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),a.href?(0,d.jsx)(h(),{href:a.href,className:"text-text-muted hover:text-primary transition-colors",children:a.label}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image&&(0,d.jsx)(i.default,{src:a.image,alt:a.label,width:28,height:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",sizes:"28px",onError:a=>{a.currentTarget.style.display="none"}}),(0,d.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,n.Tl)(a.label)})]})]},`${a.label}-${a.href||"current"}`))}):j?(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,n.Tl)(j)}),k&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:(0,n.Tl)(k)})]}):null}),(0,d.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,d.jsx)(l.c5,{}),(0,d.jsx)(l.UW,{}),(0,d.jsx)("button",{onClick:q,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}o.propTypes={onMenuClick:k().func,showMenuButton:k().bool}},87226:(a,b,c)=>{c.d(b,{default:()=>T});var d=c(48249),e=c(67484),f=c(19099),g=c(75171),h=c(17660),i=c(49885),j=c.n(i);let k=a=>new Intl.NumberFormat().format(a||0);function l({stats:a}){let b;return(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"text-2xl font-bold",children:k(a.totalRequests)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"text-2xl font-bold text-primary",children:k(a.totalPromptTokens)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"text-2xl font-bold text-success",children:k(a.totalCompletionTokens)})]}),(0,d.jsxs)(h.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",(b=a.totalCost,`$${(b||0).toFixed(2)}`)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}l.propTypes={stats:j().object.isRequired};let m=a=>new Intl.NumberFormat().format(a||0),n=a=>`$${(a||0).toFixed(2)}`;function o(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function p({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function q({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":m(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":m(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:m(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":n(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":n(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:n(a.totalCost||a.cost)})]})}function r({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:i,onToggleSort:j,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[s,t]=(0,e.useState)(new Set),u=(0,e.useCallback)(a=>{t(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),v=(0,e.useMemo)(()=>"tokens"===k?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[k]),w=b.length+v.length;return(0,d.jsxs)(h.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(p,{field:a.field,currentSort:g,currentOrder:i})]},a.field)),v.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(p,{field:a.field,currentSort:g,currentOrder:i})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>u(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${s.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(q,{item:a.summary,viewMode:k,isSummary:!0})]}),s.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(q,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:w,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}p.propTypes={field:j().string.isRequired,currentSort:j().string.isRequired,currentOrder:j().string.isRequired},q.propTypes={item:j().object.isRequired,viewMode:j().string.isRequired,isSummary:j().bool},r.propTypes={title:j().string.isRequired,columns:j().arrayOf(j().shape({field:j().string.isRequired,label:j().string.isRequired,align:j().string})).isRequired,groupedData:j().array.isRequired,tableType:j().string.isRequired,sortBy:j().string.isRequired,sortOrder:j().string.isRequired,onToggleSort:j().func.isRequired,viewMode:j().string.isRequired,storageKey:j().string.isRequired,renderDetailCells:j().func.isRequired,renderSummaryCells:j().func.isRequired,emptyMessage:j().string.isRequired};var s=c(96103),t=c(22805);c(71763);var u=c(96919);function v({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(s.h7,{type:"target",position:t.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"target",position:t.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:i?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g}):(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function w({data:a}){return(0,d.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,d.jsx)(s.h7,{type:"source",position:t.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(s.h7,{type:"source",position:t.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"9Router",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"9Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}v.propTypes={data:j().object.isRequired},w.propTypes={data:j().object.isRequired};let x={provider:v,router:w};function y({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let g=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),h=c?.toLowerCase()||"",i=f?.toLowerCase()||"",j=(0,e.useMemo)(()=>new Set(g?g.split(","):[]),[g]),k=(0,e.useMemo)(()=>new Set(h?[h]:[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),{nodes:m,edges:n}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),g=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let h=[],i=[];return h.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,j)=>{var k,l;let m,n,o=(k=a.provider,u.Q2[k]||{color:"#6b7280",name:k}),p=b.has(a.provider?.toLowerCase()),q=!p&&c.has(a.provider?.toLowerCase()),r=!p&&d.has(a.provider?.toLowerCase()),s=`provider-${a.provider}`,t={label:(o.name!==a.provider?o.name:null)||a.name||a.provider,color:o.color||"#6b7280",imageUrl:(l=a.provider,`/providers/${l}.png`),textIcon:o.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:p},v=-Math.PI/2+2*Math.PI*j/e,w=f*Math.cos(v),x=g*Math.sin(v);Math.abs(v+Math.PI/2)<Math.PI/4||Math.abs(v-3*Math.PI/2)<Math.PI/4?(m="top",n="bottom"):Math.abs(v-Math.PI/2)<Math.PI/4?(m="bottom",n="top"):w>0?(m="right",n="left"):(m="left",n="right"),h.push({id:s,type:"provider",position:{x:w-90,y:x-15},data:t,draggable:!1}),i.push({id:`e-${s}`,source:"router",sourceHandle:m,target:s,targetHandle:n,animated:p,style:(o.color,r?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:p?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:q?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:h,edges:i}})(a,j,k,l),[a,g,h,i]),o=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),p=(0,e.useRef)(null),q=(0,e.useCallback)(a=>{p.current=a,setTimeout(()=>a.fitView({padding:.3}),50)},[]);return(0,d.jsx)("div",{className:"w-full rounded-lg border border-border bg-bg-subtle/30",style:{height:480},children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(s.Gc,{nodes:m,edges:n,nodeTypes:x,fitView:!0,fitViewOptions:{padding:.3},onInit:q,proOptions:{hideAttribution:!0},panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1},o)})}y.propTypes={providers:j().arrayOf(j().shape({id:j().string,provider:j().string,name:j().string})),activeRequests:j().arrayOf(j().shape({provider:j().string,model:j().string,account:j().string})),lastProvider:j().string,errorProvider:j().string};var z=c(80322),A=c(21621),B=c(28946),C=c(22393),D=c(54206),E=c(40369),F=c(83385);let G=a=>a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a||0),H=a=>`$${(a||0).toFixed(4)}`;function I({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[i,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(h.default,{className:"p-4 flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):k?(0,d.jsx)(z.u,{width:"100%",height:200,children:(0,d.jsxs)(A.Q,{data:b,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(B.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(C.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(D.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===i?G:H,width:50}),(0,d.jsx)(E.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[G(a),"Tokens"]:[H(a),"Cost"]}),"tokens"===i?(0,d.jsx)(F.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(F.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function J({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}function K({requests:a=[]}){return(0,d.jsxs)(h.default,{className:"flex flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsx)("div",{className:"px-1 py-2 border-b border-border shrink-0",children:(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"})}),a.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=!a.status||"ok"===a.status||"success"===a.status;return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${c?"bg-success":"bg-error"}`})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:a.model,children:a.model}),(0,d.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,d.jsxs)("span",{className:"text-primary",children:[m(a.promptTokens),"↑"]})," ",(0,d.jsxs)("span",{className:"text-success",children:[m(a.completionTokens),"↓"]})]}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(J,{timestamp:a.timestamp})})]},b)})})]})}):(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function L(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=d>0?(c.promptTokens||0)*(e/d):0,g=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:f,outputCost:g,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function M(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}I.propTypes={period:j().string};let N=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"accountName",label:"Account"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],P=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],Q=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],R=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],S=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function T(){let a=(0,f.useRouter)(),b=(0,f.useSearchParams)(),c=b.get("sortBy")||"rawModel",h=b.get("sortOrder")||"asc",[i,j]=(0,e.useState)(null),[k,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(!1),[s,t]=(0,e.useState)("model"),[u,v]=(0,e.useState)([]),[w,x]=(0,e.useState)("7d"),z=(0,e.useCallback)((c,d)=>{let e=new URLSearchParams(b.toString());e.get("sortBy")===d?e.set("sortOrder","asc"===e.get("sortOrder")?"desc":"asc"):(e.set("sortBy",d),e.set("sortOrder","asc")),a.replace(`?${e.toString()}`,{scroll:!1})},[b,a]),A=(0,e.useMemo)(()=>{if(!i)return null;switch(s){case"model":{let a=i.pending?.byModel||{};return{columns:N,groupedData:M(L(i.byModel,a,c,h),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}case"account":{let a={};return i?.pending?.byAccount&&Object.entries(i.byAccount||{}).forEach(([b,c])=>{let d=i.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:O,groupedData:M(L(i.byAccount,a,c,h),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}case"apiKey":return{columns:P,groupedData:M(L(i.byApiKey,{},c,h),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})};default:return{columns:Q,groupedData:M(L(i.byEndpoint,{},c,h),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(g.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:m(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:o(a.lastUsed)})]})}}},[i,s,c,h]);if(!i&&!k)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let B=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 self-end",children:[(0,d.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:S.map(a=>(0,d.jsx)("button",{onClick:()=>x(a.value),disabled:p,className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${w===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:a.label},a.value))}),p&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),k?B:(0,d.jsx)(l,{stats:i}),k?B:(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-2 items-stretch",children:[(0,d.jsx)(y,{providers:u,activeRequests:i.activeRequests||[],lastProvider:i.recentRequests?.[0]?.provider||"",errorProvider:i.errorProvider||""}),(0,d.jsx)(K,{requests:i.recentRequests||[]})]}),k?B:(0,d.jsx)(I,{period:w}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("div",{className:"flex items-center justify-between",children:(0,d.jsx)("select",{value:s,onChange:a=>t(a.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg-subtle text-sm font-medium text-text focus:outline-none focus:ring-2 focus:ring-primary/50",children:R.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))})}),k?B:A&&(0,d.jsx)(r,{title:"",columns:A.columns,groupedData:A.groupedData,tableType:s,sortBy:c,sortOrder:h,onToggleSort:z,storageKey:A.storageKey,renderSummaryCells:A.renderSummaryCells,renderDetailCells:A.renderDetailCells,emptyMessage:A.emptyMessage})]})]})}},91099:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,d.jsx)("div",{className:(0,e.cn)("inline-flex items-center p-1 rounded-lg","bg-black/5 dark:bg-white/5",h),children:a.map(a=>(0,d.jsxs)("button",{onClick:()=>c(a.value),className:(0,e.cn)("px-4 rounded-md font-medium transition-all",i[g],b===a.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are saved to log.txt in the application data directory."})]})}},95145:(a,b,c)=>{c.d(b,{ConfirmModal:()=>h,default:()=>g});var d=c(48249);c(67484);var e=c(71404),f=c(99070);function g({isOpen:a,onClose:b,title:c,children:f,footer:h,size:i="md",closeOnOverlay:j=!0,showCloseButton:k=!0,className:l}){return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:j?b:void 0}),(0,d.jsxs)("div",{className:(0,e.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[i],l),children:[(c||k)&&(0,d.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,d.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),c&&(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:c})]}),k&&(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:f}),h&&(0,d.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:h})]})]}):null}function h({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:i,confirmText:j="Confirm",cancelText:k="Cancel",variant:l="danger",loading:m=!1}){return(0,d.jsx)(g,{isOpen:a,onClose:b,title:e,size:"sm",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{variant:"ghost",onClick:b,disabled:m,children:k}),(0,d.jsx)(f.default,{variant:l,onClick:c,loading:m,children:j})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:i})})}},95514:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({checked:a=!1,onChange:b,label:c,description:g,disabled:h=!1,size:i="md",className:j}){let k={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center gap-3",h&&"opacity-50 cursor-not-allowed",j),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:h,onClick:()=>{!h&&b&&b(!a)},className:(0,e.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",a?"bg-primary":"bg-black/10 dark:bg-white/20",k[i].track,h&&"cursor-not-allowed"),children:(0,d.jsx)("span",{className:(0,e.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",a?k[i].translate:"translate-x-0.5",k[i].thumb,"mt-0.5")})}),(c||g)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:c}),g&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:g})]})]})}},99070:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},g={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",f[b],g[c],m&&"w-full",n),disabled:k||l,...o,children:[l?(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,a,j&&!l&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j})]})}}};