@rabbi696/ezrouter 0.6.10 → 0.6.11

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 (354) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +2 -2
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  42. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  43. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  44. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  48. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  49. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  50. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  51. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  52. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  53. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  54. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  55. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  56. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  57. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  58. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  59. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  60. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  61. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  62. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/callback.html +1 -1
  64. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  65. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  66. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  68. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  69. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  72. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  73. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  74. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  77. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  78. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  80. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  82. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  83. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  84. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  87. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  88. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  90. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  92. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  93. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  94. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  97. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  98. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  100. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  102. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
  103. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  104. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  107. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
  108. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  109. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
  110. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  112. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  113. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  114. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  115. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  116. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  117. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  118. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  119. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  120. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  121. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
  122. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +5 -5
  123. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
  124. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
  125. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  126. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  128. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +5 -5
  129. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
  130. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +3 -3
  131. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +1 -1
  132. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +5 -5
  134. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
  135. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
  136. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  137. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  139. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +5 -5
  140. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
  141. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +3 -3
  142. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +1 -1
  143. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
  144. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +5 -5
  145. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
  146. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  147. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  149. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +5 -5
  150. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
  151. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +3 -3
  152. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +1 -1
  153. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  154. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  155. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  156. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  157. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  158. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  160. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  161. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  162. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  163. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  164. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  166. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  167. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  168. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  169. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  170. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  171. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  172. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  173. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  174. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  175. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  176. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  177. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  178. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  180. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  181. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  182. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  183. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  186. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  187. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  188. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  191. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  192. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  193. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  194. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  198. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  201. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  202. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  203. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  204. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  207. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  208. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  209. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  211. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  212. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  213. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  214. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  217. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  218. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  219. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  221. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  222. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  223. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  224. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  226. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  227. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  228. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  229. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  231. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  232. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  233. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  234. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
  237. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  238. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  239. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  240. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  241. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
  242. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  243. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
  244. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  248. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  249. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  251. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  254. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  258. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  259. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  262. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  263. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  265. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  268. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  269. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  272. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  273. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  275. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  278. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  279. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  283. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  285. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  288. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  293. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  295. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  298. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  299. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  301. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  302. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  304. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  305. package/app/.next-cli-build/server/app/index.html +1 -1
  306. package/app/.next-cli-build/server/app/index.rsc +3 -3
  307. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  309. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  311. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  313. package/app/.next-cli-build/server/app/landing.html +1 -1
  314. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  315. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  316. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  318. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  322. package/app/.next-cli-build/server/app/login.html +1 -1
  323. package/app/.next-cli-build/server/app/login.rsc +4 -4
  324. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  325. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  327. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  329. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  331. package/app/.next-cli-build/server/app-paths-manifest.json +2 -2
  332. package/app/.next-cli-build/server/chunks/2021.js +1 -1
  333. package/app/.next-cli-build/server/chunks/3886.js +1 -1
  334. package/app/.next-cli-build/server/chunks/3977.js +1 -1
  335. package/app/.next-cli-build/server/chunks/4208.js +1 -1
  336. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  337. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  338. package/app/.next-cli-build/server/chunks/8306.js +1 -1
  339. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  340. package/app/.next-cli-build/server/pages/404.html +1 -1
  341. package/app/.next-cli-build/server/pages/500.html +1 -1
  342. package/app/.next-cli-build/static/chunks/{1321-3959048b066ab2a8.js → 1321-28c50cf30d629b3c.js} +1 -1
  343. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-69c121887e473261.js → page-490c54665b2cfe56.js} +1 -1
  344. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-173efeab4037cc9a.js → page-254fb1375ad58196.js} +4 -4
  345. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-7ec974bc6ee445f1.js → page-ac9b5a7d5710870d.js} +1 -1
  346. package/app/CHANGELOG.md +9 -0
  347. package/app/package.json +1 -1
  348. package/app/public/CHANGELOG.md +8 -0
  349. package/hooks/packageManager.js +4 -1
  350. package/hooks/trayRuntime.js +31 -1
  351. package/package.json +1 -1
  352. package/src/cli/tray/tray.js +9 -2
  353. /package/app/.next-cli-build/static/{ZZzFJY8XwYUO3V74IjHEa → 5WoZ9O2i6m7EB5bVhSiW3}/_buildManifest.js +0 -0
  354. /package/app/.next-cli-build/static/{ZZzFJY8XwYUO3V74IjHEa → 5WoZ9O2i6m7EB5bVhSiW3}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{62022:(e,t,r)=>{Promise.resolve().then(r.bind(r,76436)),Promise.resolve().then(r.bind(r,25086))},76436:(e,t,r)=>{"use strict";r.d(t,{default:()=>L});var a=r(95155),i=r(12115),s=r(57250),n=r(15564);let l="quotaCacheData",o="quotaAutoRefresh",d="quotaTrackerPreferences",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],m=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function h(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function p(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function b(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function g(e,t){return await e(t)}function f(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function y(e,t){try{let r=f();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function v(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function k(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function w(e,t){let r=t?.[e]?.hidden;return new Set(Array.isArray(r)?r.map(String):[])}let j={green:{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"},yellow:{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"},red:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"}};function N({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):v(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let m=c.slice((l-1)*10,10*l),x=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",y="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:m.map(e=>{var r;let i=!0===e.unlimited,s=!0===e.isCreditBalance,l=s?{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500",bgLight:"bg-blue-500/10",emoji:"\uD83D\uDCB0"}:j[(r=e.remaining)>70?"green":r>=30?"yellow":"red"],o=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),d=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),c=!1!==e.recurring?`in ${o}`:`expires in ${o}`;return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${p} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:l.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name}),e.runtimeLimited&&(e.runtimeActionUrl?(0,a.jsx)("a",{href:e.runtimeActionUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 underline decoration-dotted underline-offset-2 dark:text-amber-400",title:e.runtimeLimitReason||"Verify this Google account, then retry the model.",children:e.runtimeLimitLabel||"account blocked"}):(0,a.jsx)("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400",title:e.runtimeLimitReason||"The provider runtime rejected this model even though the quota endpoint still reports capacity.",children:e.runtimeLimitLabel||"runtime limit"}))]})}),(0,a.jsx)("td",{className:`${p} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[!i&&!s&&(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${l.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${l.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted",children:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:s?`Credit: ${e.total.toFixed(2)} ${e.name.split(" ")[2]||""}`:e.percentageOnly?(0,a.jsx)("span",{title:e.quotaNote||"The provider does not expose an absolute request count.",children:"count unavailable"}):(0,a.jsxs)(a.Fragment,{children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]})}),(0,a.jsx)("span",{className:`font-medium ${i?"text-green-600 dark:text-green-400":s?"text-blue-600 dark:text-blue-400":l.text}`,children:i?"Unlimited":s?"":`${e.remaining}%`})]})]})}),(0,a.jsx)("td",{className:`${p} ${y?"w-[20%]":"w-[25%]"}`,children:"-"!==o||d?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:d||"",children:"-"!==o?c:d}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==o&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium`,children:c}),d&&(0,a.jsx)("div",{className:`${f} text-text-muted`,children:d})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),y&&(0,a.jsx)("td",{className:`${p} w-[5%] text-right`,children:(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})})]},`${e.name}-${e.index}`)})})})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var S=r(98542),C=r(97677),A=r(84588),P=r(35497),q=r(88105),$=r(11059),E=r(78177);let _={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},T={claude:"claudeAutoPing",codex:"codexAutoPing"},M={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. Consumes a small amount of quota."};function D(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function O(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function F(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function L(){let{copied:e,copy:t}=(0,$.C)(),[r,j]=(0,i.useState)([]),[L,z]=(0,i.useState)({}),[I,U]=(0,i.useState)({}),[R,W]=(0,i.useState)({}),[J,K]=(0,i.useState)(!0),[H,G]=(0,i.useState)({claude:{},codex:{}}),[V,B]=(0,i.useState)(null),[Q,X]=(0,i.useState)(!1),[Y,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[er,ea]=(0,i.useState)(60),[ei,es]=(0,i.useState)(!0),[en,el]=(0,i.useState)(null),[eo,ed]=(0,i.useState)(null),[ec,eu]=(0,i.useState)(null),[em,ex]=(0,i.useState)(null),[eh,ep]=(0,i.useState)(null),[eb,eg]=(0,i.useState)(null),[ef,ey]=(0,i.useState)(!1),[ev,ek]=(0,i.useState)(null),[ew,ej]=(0,i.useState)([]),[eN,eS]=(0,i.useState)("all"),[eC,eA]=(0,i.useState)([]),[eP,eq]=(0,i.useState)("all"),[e$,eE]=(0,i.useState)("default"),[e_,eT]=(0,i.useState)({}),[eM,eD]=(0,i.useState)(!1),[eO,eF]=(0,i.useState)(!1),[eL,ez]=(0,i.useState)(!1),[eI,eU]=(0,i.useState)(1),[eR,eW]=(0,i.useState)(20),[eJ,eK]=(0,i.useState)(String(20)),[eH,eG]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eV,eB]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eQ=(0,i.useRef)(0),eX=(0,i.useCallback)(async(e=eI)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eR),accountStatus:eP,sort:"priority"});"all"!==eN&&a.set("provider",eN);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eR,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return j(n),eA(s.providerOptions||[]),eG(l),eB(o),eU((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),j([]),eA([]),eG({page:1,pageSize:eR,total:0,totalPages:1}),eB({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eP,eM,eI,eR,eN]),eY=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{U(t=>({...t,[e]:!0})),W(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};z(t=>({...t,[e]:a})),y(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":if(t.quotas){let e=Object.entries(t.quotas),a=new Set(["gemini_weekly","claude_gpt_weekly"]),i=new Set(["gemini_session","claude_gpt_session"]),s=new Set([...a,...i]),n=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),l=e.filter(([e])=>e.startsWith("claude-")),o=e.filter(([e])=>e.includes("image")),d=e.filter(([e])=>s.has(e)),c=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.includes("image")&&!s.has(e)),u=!!t.quotas.gemini_weekly,m=!!t.quotas.gemini_session,x=!!t.quotas.claude_gpt_weekly,h=!!t.quotas.claude_gpt_session;if(m)d.filter(([e])=>"gemini_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(n.length>0){let e=n.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.gemini_weekly?.resetAt;u&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}if(u&&d.filter(([e])=>"gemini_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),h)d.filter(([e])=>"claude_gpt_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(l.length>0){let e=l.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.claude_gpt_weekly?.resetAt;x&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Claude (Sonnet / Opus)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}x&&d.filter(([e])=>"claude_gpt_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),o.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),x||h||c.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let a=e;"spark_session"===e?a="Spark (5h)":"spark_weekly"===e?a="Spark (Weekly)":"session"===e?a="5h":"weekly"===e?a="Weekly":"review_session"===e?a="Review (5h)":"review_weekly"===e&&(a="Review (Weekly)"),r.push({name:a,quotaType:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{"organization"===e&&(!t||[t.total,t.used,t.remaining].every(e=>0===(Number(e)||0)))||r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:Math.max(0,Number(t.total)||0)||(Number(t.used)||0)+(Number(t.remaining)||0),unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||100)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:v(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"groq":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"zed":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:t.unlimited})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return("gemini"===a||"gemini_session"===a)&&(a="gemini-3.8-flash-high"),("claude"===a||"claude_gpt_session"===a)&&(a="claude-sonnet-4-6"),("gemini"===i||"gemini_session"===i)&&(i="gemini-3.8-flash-high"),("claude"===i||"claude_gpt_session"===i)&&(i="claude-sonnet-4-6"),(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};z(t=>({...t,[e]:l})),y(e,l)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),W(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{U(t=>({...t,[e]:!1}))}},[]),eZ=(0,i.useCallback)(async(e,t)=>{await eY(e,t,{force:!0}),B(new Date)},[eY]),e0=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!em){ex(e),W(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eY(e,t),B(new Date)}catch(t){W(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{ex(null)}}},[eY,em]),e1=(0,i.useCallback)(async e=>{eg({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eg({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eg({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),e5=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){el(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){z(t=>{let r={...t};return delete r[e],r}),U(t=>{let r={...t};return delete r[e],r}),W(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eX,eI)}}catch(e){console.error("Error deleting connection:",e)}finally{el(null)}}},[eX,eI]),e2=(0,i.useCallback)(async(e,t)=>{ed(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(z(e=>({...e})),await g(eX,eI))}catch(e){console.error("Error updating connection status:",e)}finally{ed(null)}},[eX,eI]),e3=(0,i.useCallback)(async(e,t)=>{if(!ec){eu(e.id);try{let r=await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.error||"Failed to save fast mode");j(r=>r.map(r=>r.id===e.id?{...r,providerSpecificData:{...r.providerSpecificData,fastMode:t}}:r))}catch(e){alert(e.message||"Failed to save fast mode")}finally{eu(null)}}},[ec]),e4=(0,i.useCallback)(async e=>{if(!ev?.id)return;let t=ev.id,r=ev.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eX(),ey(!1),ek(null),q.wb.includes(r)&&await eY(t,r))}catch(e){console.error("Error saving connection:",e)}},[ev,eX,eY]),e8=(0,i.useCallback)(async(e,t,a)=>{let i=r.find(t=>t.id===e);if(!i)return;let s={...i.quotaPauseThresholds&&"object"==typeof i.quotaPauseThresholds?i.quotaPauseThresholds:{}},n=Number(a);Number.isFinite(n)&&n>0&&n<=100?s[t]=n:delete s[t];try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaPauseThresholds:s})})).ok&&j(t=>t.map(t=>t.id===e?{...t,quotaPauseThresholds:s}:t))}catch(e){console.error("Error updating quota threshold:",e)}},[r]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ej(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e6=(0,i.useCallback)(async(e=!1)=>{if(ee)return;et(!0),ea(60);let t=eQ.current+=1,r=Math.round(10);try{let a=await eX(eI);U(p(a)),W(e=>b(e,a)),z(e=>b(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eY(e.id,e.provider))),B(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{et(!1)}},[ee,eX,eY,eI]);(0,i.useEffect)(()=>{(async()=>{es(!0);let e=await eX(eI);es(!1),U(p(e)),W(t=>b(t,e)),z(t=>b(t,e)),await Promise.all(e.map(e=>eY(e.id,e.provider))),B(new Date)})()},[eX,eY,eI]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);K(null===e||"true"===e),X(!0)},[]),(0,i.useEffect)(()=>{Q&&window.localStorage.setItem(o,String(J))},[J,Q]),(0,i.useEffect)(()=>{try{let e=window.localStorage.getItem(d);if(e){let t=JSON.parse(e);if(t?.accountFilter&&["all","active","inactive"].includes(t.accountFilter)&&eq(t.accountFilter),t?.pageSize){let e=Number(t.pageSize);Number.isFinite(e)&&e>0&&(eW(e),eK(String(e)))}}}catch{}Z(!0)},[]),(0,i.useEffect)(()=>{if(Y)try{window.localStorage.setItem(d,JSON.stringify({accountFilter:eP,pageSize:eR}))}catch{}},[eP,eR,Y]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{G({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),eT(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e7=(0,i.useCallback)(async(e,t,r)=>{let a=T[t];if(!a)return;let i={...H[t]||{},[e]:r};G({...H,[t]:i});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:i};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{G(H)}},[H]),e9=(0,i.useCallback)(async(e,t)=>{eT(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eT(t)}},[]),te=(0,i.useCallback)((e,t)=>{let r=k(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.add(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}e9({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,e9]),tt=(0,i.useCallback)((e,t)=>{let r=k(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.delete(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}e9({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,e9]),tr=(0,i.useRef)(e6);(0,i.useEffect)(()=>{tr.current=e6},[e6]);let ta=(0,i.useMemo)(()=>(function({onRefresh:e,onTick:t,refreshIntervalMs:r,tickMs:a=1e3}){let i=null,s=null,n=()=>{null!==i&&(clearInterval(i),i=null),null!==s&&(clearInterval(s),s=null)};return{start:()=>{n(),i=setInterval(()=>e(),r),s=setInterval(()=>t(),a)},stop:n,isRunning:()=>null!==i||null!==s}})({onRefresh:()=>tr.current(),onTick:()=>ea(e=>e<=1?60:e-1),refreshIntervalMs:6e4}),[]);(0,i.useEffect)(()=>!Q||!J||"u">typeof document&&document.hidden?void ta.stop():(ta.start(),()=>ta.stop()),[J,Q,ta]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?ta.stop():J&&Q&&ta.start()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e),ta.stop()}},[J,Q,ta]);let ti=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=h(e,t),s=h(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(x(e)||"").localeCompare(x(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,L,eM,eN,e$),[r,L,eM,eN,e$]),ts=e=>{let t=L[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},tn=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eL){ez(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await g(eX,eI)}catch(e){console.error("Error bulk toggling connections:",e)}finally{ez(!1)}}},[eL,eX,eI]),tl="all"===eN?"All providers":eN,to=eV.eligibleConnections>0,td=ti.length>0,tc=eV.eligibleConnections?eV.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===eN?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eP?"turned off":"active"===eP?"active":"matching"} accounts found for ${eN}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},tu=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eH),tm=!c.includes(eR);return ei||to?ei||td?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eF(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eO,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eN?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${eN}.png`,alt:eN,size:18,className:"size-[18px] rounded object-contain",fallbackText:eN.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:tl})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eO&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eF(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eN&&eU(1),eS("all"),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===eN?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eN&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:eC.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eN!==e&&eU(1),eS(e),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${eN===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eN===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:eP,onChange:e=>{let t=e.target.value;eP!==t&&eU(1),eq(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===eN&&(0,a.jsx)("select",{value:e$,onChange:e=>eE(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:m.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eD(e=>!e),"aria-pressed":eM,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eM?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tn(ti.filter(e=>(e.isActive??!0)&&ts(e)).map(e=>e.id),!1)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tn(ti.filter(e=>!(e.isActive??!0)&&!ts(e)).map(e=>e.id),!0)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>K(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:J?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${J?"text-primary":"text-text-muted"}`,children:J?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),J&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",er,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e6(!0),disabled:ee,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${ee?"animate-spin":""}`,children:"refresh"})})]})}),eM&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:ti.map(r=>{let i,n,l,o,d=L[r.id],c=I[r.id],u=R[r.id],m=!1===r.isActive,h="codex"===r.provider,p=h?(i=d?.plan?.trim())&&"unknown"!==i.toLowerCase()?i:r?.providerSpecificData?.chatgptPlanType?.trim()||null:null,b=Number.isFinite(l="number"==typeof(n=d?.raw?.resetCredits?.availableCount)?n:Number(n))?Math.max(0,l):0,g=em===r.id,f=en===r.id||eo===r.id||g,y=d?.quotas||[],v=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=w(e,r);return 0===a.size?t:t.filter(e=>!a.has(k(e)))}(r.provider,y,e_),j=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=w(e,r);return 0===a.size?[]:t.filter(e=>a.has(k(e)))}(r.provider,y,e_),$=(0,E.XD)(r);return(0,a.jsxs)(A.default,{padding:"none",className:`min-w-0 ${m?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,p?(0,a.jsx)("span",{className:"mt-1 inline-flex rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:p}):null,$.enabled&&(0,a.jsx)("p",{className:"mt-0.5",children:(0,a.jsx)(P.Ex,{variant:$.paused?"warning":"default",size:"sm",children:$.paused?`Paused (quota${$.triggered?`: ${$.triggered.key}`:""})`:"Buffers set"})}),"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(o=r.providerSpecificData?.authMethod)&&_[o]?_[o]:"api_key"===r.authType?"API Key":"OAuth"}),O(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:O(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${m?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:m?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.default,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ep({connection:r,resetCreditCount:b}),disabled:b<=0||c||f,"aria-label":b>0?`Use one Codex reset credit. ${b} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${g?"animate-spin":""}`,children:g?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(C.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r),disabled:c||f,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})}),q.Q2[r.provider]?.fastMode&&(0,a.jsx)(C.default,{text:`Fast mode is ${r.providerSpecificData?.fastMode===!0?"on":"off"}. Uses the provider's faster processing mode at a higher token cost.`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>e3(r,r.providerSpecificData?.fastMode!==!0),disabled:c||f,role:"switch","aria-label":"Toggle fast mode","aria-checked":r.providerSpecificData?.fastMode===!0,className:`flex h-8 min-w-14 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${r.providerSpecificData?.fastMode===!0?"border-primary/30 bg-primary/10 text-primary":"border-black/10 text-text-muted hover:bg-black/5 hover:text-primary dark:border-white/10 dark:hover:bg-white/5"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${isUpdatingFastMode?"animate-spin":""}`,children:isUpdatingFastMode?"progress_activity":"speed"}),(0,a.jsx)("span",{children:"Fast"})]})})]}),T[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(C.default,{text:M[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e7(r.id,r.provider,H[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${H[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(C.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eZ(r.id,r.provider),disabled:c||f,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${c?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(C.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ek(r),ey(!0)},disabled:f,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(C.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>e5(r.id),disabled:f,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${en===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(S.default,{size:"sm",checked:r.isActive??!0,disabled:f,onChange:e=>e2(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[c?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):u?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:u})]}):d?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:d.message})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N,{quotas:v,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==e$,onHideQuota:e=>te(r.provider,e)}),r.lastQuotaSnapshot?.windows?.length>0&&(0,a.jsxs)("div",{className:"mt-2 border-t border-black/5 pt-2 dark:border-white/5",children:[(0,a.jsx)("p",{className:"mb-1 text-[10px] text-text-muted",children:"Pause buffer — pause this account when a window's remaining % ≤"}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:r.lastQuotaSnapshot.windows.map(e=>{let t=Number(r.quotaPauseThresholds?.[e.key])||0;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11px] text-text-muted",title:e.key,children:e.key}),(0,a.jsx)("span",{className:"w-10 text-right text-[10px] tabular-nums text-text-muted",children:"number"==typeof e.remainingPercentage?`${e.remainingPercentage}%`:"—"}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"≤"}),(0,a.jsx)("input",{type:"number",min:0,max:100,value:t,onChange:t=>e8(r.id,e.key,Number.parseInt(t.target.value,10)||0),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px] focus:border-primary focus:outline-none","aria-label":`Pause buffer for ${e.key}`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]},e.key)})})]})]}),d?.message&&!u&&!c&&(0,a.jsx)("p",{className:"mt-2 px-1 text-[10px] leading-relaxed text-text-muted",children:d.message}),j.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:j.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>tt(r.provider,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},k(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:tu}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tm?"custom":String(eR),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eU(1),eW(r),eK(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[c.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eJ,onChange:e=>eK(e.target.value),onBlur:()=>{let e=Number.parseInt(eJ,10);if(!Number.isFinite(e))return void eK(String(eR));let t=Math.min(500,Math.max(1,e));eU(1),eW(t),eK(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eJ,10);if(!Number.isFinite(t))return void eK(String(eR));let r=Math.min(500,Math.max(1,t));eU(1),eW(r),eK(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eH.page," / ",eH.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eU(1),disabled:eH.page<=1||ei||ee,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eU(e=>Math.max(1,e-1)),disabled:eH.page<=1||ei||ee,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eU(e=>Math.min(eH.totalPages,e+1)),disabled:eH.page>=eH.totalPages||ei||ee,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eU(eH.totalPages),disabled:eH.page>=eH.totalPages||ei||ee,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(P.uo,{isOpen:!!eh,onClose:()=>{em||ep(null)},onConfirm:async()=>{let e=eh?.connection;e&&(await e0(e.id,e.provider),ep(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(eh?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eh?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!em}),eb&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:x(eb.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eg(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:eb.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):eb.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:eb.error}):eb.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[eb.data.credits.length," reset credit",1===eb.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[eb.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:eb.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:F(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:F(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(P.wI,{isOpen:ef,connection:ev,proxyPools:ew,onSave:e4,onClose:()=>{ey(!1),ek(null)}})]}):(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:tc.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:tc.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:tc.description})]})}):(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[8010,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=62022)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{62022:(e,t,r)=>{Promise.resolve().then(r.bind(r,76436)),Promise.resolve().then(r.bind(r,25086))},76436:(e,t,r)=>{"use strict";r.d(t,{default:()=>L});var a=r(95155),i=r(12115),s=r(57250),n=r(15564);let l="quotaCacheData",o="quotaAutoRefresh",d="quotaTrackerPreferences",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],m=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function h(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function p(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function b(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function g(e,t){return await e(t)}function f(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function y(e,t){try{let r=f();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function v(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function k(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function w(e,t){let r=t?.[e]?.hidden;return new Set(Array.isArray(r)?r.map(String):[])}let j={green:{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"},yellow:{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"},red:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"}};function N({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):v(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let m=c.slice((l-1)*10,10*l),x=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",y="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:m.map(e=>{var r;let i=!0===e.unlimited,s=!0===e.isCreditBalance,l=s?{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500",bgLight:"bg-blue-500/10",emoji:"\uD83D\uDCB0"}:j[(r=e.remaining)>70?"green":r>=30?"yellow":"red"],o=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),d=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),c=!1!==e.recurring?`in ${o}`:`expires in ${o}`;return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${p} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:l.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name}),e.runtimeLimited&&(e.runtimeActionUrl?(0,a.jsx)("a",{href:e.runtimeActionUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 underline decoration-dotted underline-offset-2 dark:text-amber-400",title:e.runtimeLimitReason||"Verify this Google account, then retry the model.",children:e.runtimeLimitLabel||"account blocked"}):(0,a.jsx)("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400",title:e.runtimeLimitReason||"The provider runtime rejected this model even though the quota endpoint still reports capacity.",children:e.runtimeLimitLabel||"runtime limit"}))]})}),(0,a.jsx)("td",{className:`${p} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[!i&&!s&&(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${l.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${l.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted",children:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:s?`Credit: ${e.total.toFixed(2)} ${e.name.split(" ")[2]||""}`:e.percentageOnly?(0,a.jsx)("span",{title:e.quotaNote||"The provider does not expose an absolute request count.",children:"count unavailable"}):(0,a.jsxs)(a.Fragment,{children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]})}),(0,a.jsx)("span",{className:`font-medium ${i?"text-green-600 dark:text-green-400":s?"text-blue-600 dark:text-blue-400":l.text}`,children:i?"Unlimited":s?"":`${e.remaining}%`})]})]})}),(0,a.jsx)("td",{className:`${p} ${y?"w-[20%]":"w-[25%]"}`,children:"-"!==o||d?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:d||"",children:"-"!==o?c:d}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==o&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium`,children:c}),d&&(0,a.jsx)("div",{className:`${f} text-text-muted`,children:d})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),y&&(0,a.jsx)("td",{className:`${p} w-[5%] text-right`,children:(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})})]},`${e.name}-${e.index}`)})})})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var S=r(98542),C=r(97677),A=r(84588),P=r(35497),q=r(88105),$=r(11059),E=r(78177);let _={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},T={claude:"claudeAutoPing",codex:"codexAutoPing"},D={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. Consumes a small amount of quota."};function M(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function O(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function F(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function L(){let{copied:e,copy:t}=(0,$.C)(),[r,j]=(0,i.useState)([]),[L,z]=(0,i.useState)({}),[I,R]=(0,i.useState)({}),[U,W]=(0,i.useState)({}),[J,K]=(0,i.useState)(!0),[H,G]=(0,i.useState)({claude:{},codex:{}}),[V,B]=(0,i.useState)(null),[Q,X]=(0,i.useState)(!1),[Y,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[er,ea]=(0,i.useState)(60),[ei,es]=(0,i.useState)(!0),[en,el]=(0,i.useState)(null),[eo,ed]=(0,i.useState)(null),[ec,eu]=(0,i.useState)(null),[em,ex]=(0,i.useState)(null),[eh,ep]=(0,i.useState)(null),[eb,eg]=(0,i.useState)(null),[ef,ey]=(0,i.useState)(!1),[ev,ek]=(0,i.useState)(null),[ew,ej]=(0,i.useState)([]),[eN,eS]=(0,i.useState)("all"),[eC,eA]=(0,i.useState)([]),[eP,eq]=(0,i.useState)("all"),[e$,eE]=(0,i.useState)("default"),[e_,eT]=(0,i.useState)({}),[eD,eM]=(0,i.useState)(!1),[eO,eF]=(0,i.useState)(!1),[eL,ez]=(0,i.useState)(!1),[eI,eR]=(0,i.useState)(1),[eU,eW]=(0,i.useState)(20),[eJ,eK]=(0,i.useState)(String(20)),[eH,eG]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eV,eB]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eQ=(0,i.useRef)(0),eX=(0,i.useCallback)(async(e=eI)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eU),accountStatus:eP,sort:"priority"});"all"!==eN&&a.set("provider",eN);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eU,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return j(n),eA(s.providerOptions||[]),eG(l),eB(o),eR((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),j([]),eA([]),eG({page:1,pageSize:eU,total:0,totalPages:1}),eB({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eP,eD,eI,eU,eN]),eY=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{R(t=>({...t,[e]:!0})),W(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};z(t=>({...t,[e]:a})),y(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":if(t.quotas){let e=Object.entries(t.quotas),a=new Set(["gemini_weekly","claude_gpt_weekly"]),i=new Set(["gemini_session","claude_gpt_session"]),s=new Set([...a,...i]),n=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),l=e.filter(([e])=>e.startsWith("claude-")),o=e.filter(([e])=>e.includes("image")),d=e.filter(([e])=>s.has(e)),c=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.includes("image")&&!s.has(e)),u=!!t.quotas.gemini_weekly,m=!!t.quotas.gemini_session,x=!!t.quotas.claude_gpt_weekly,h=!!t.quotas.claude_gpt_session;if(m)d.filter(([e])=>"gemini_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(n.length>0){let e=n.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.gemini_weekly?.resetAt;u&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}if(u&&d.filter(([e])=>"gemini_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),h)d.filter(([e])=>"claude_gpt_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(l.length>0){let e=l.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.claude_gpt_weekly?.resetAt;x&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Claude (Sonnet / Opus)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}x&&d.filter(([e])=>"claude_gpt_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),o.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),x||h||c.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let a=e;"spark_session"===e?a="Spark (5h)":"spark_weekly"===e?a="Spark (Weekly)":"session"===e?a="5h":"weekly"===e?a="Weekly":"review_session"===e?a="Review (5h)":"review_weekly"===e&&(a="Review (Weekly)"),r.push({name:a,quotaType:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{"organization"===e&&(!t||[t.total,t.used,t.remaining].every(e=>0===(Number(e)||0)))||r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:Math.max(0,Number(t.total)||0)||(Number(t.used)||0)+(Number(t.remaining)||0),unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||100)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:v(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"groq":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"zed":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:t.unlimited})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return("gemini"===a||"gemini_session"===a)&&(a="gemini-3.8-flash-high"),("claude"===a||"claude_gpt_session"===a)&&(a="claude-sonnet-4-6"),("gemini"===i||"gemini_session"===i)&&(i="gemini-3.8-flash-high"),("claude"===i||"claude_gpt_session"===i)&&(i="claude-sonnet-4-6"),(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};z(t=>({...t,[e]:l})),y(e,l)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),W(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{R(t=>({...t,[e]:!1}))}},[]),eZ=(0,i.useCallback)(async(e,t)=>{await eY(e,t,{force:!0}),B(new Date)},[eY]),e0=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!em){ex(e),W(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eY(e,t),B(new Date)}catch(t){W(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{ex(null)}}},[eY,em]),e1=(0,i.useCallback)(async e=>{eg({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eg({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eg({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),e5=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){el(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){z(t=>{let r={...t};return delete r[e],r}),R(t=>{let r={...t};return delete r[e],r}),W(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eX,eI)}}catch(e){console.error("Error deleting connection:",e)}finally{el(null)}}},[eX,eI]),e2=(0,i.useCallback)(async(e,t)=>{ed(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(z(e=>({...e})),await g(eX,eI))}catch(e){console.error("Error updating connection status:",e)}finally{ed(null)}},[eX,eI]),e3=(0,i.useCallback)(async(e,t)=>{if(!ec){eu(e.id);try{let r=await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{fastMode:t}})}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.error||"Failed to save fast mode");j(r=>r.map(r=>r.id===e.id?{...r,providerSpecificData:{...r.providerSpecificData,fastMode:t}}:r))}catch(e){alert(e.message||"Failed to save fast mode")}finally{eu(null)}}},[ec]),e4=(0,i.useCallback)(async e=>{if(!ev?.id)return;let t=ev.id,r=ev.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eX(),ey(!1),ek(null),q.wb.includes(r)&&await eY(t,r))}catch(e){console.error("Error saving connection:",e)}},[ev,eX,eY]),e8=(0,i.useCallback)(async(e,t,a)=>{let i=r.find(t=>t.id===e);if(!i)return;let s={...i.quotaPauseThresholds&&"object"==typeof i.quotaPauseThresholds?i.quotaPauseThresholds:{}},n=Number(a);Number.isFinite(n)&&n>0&&n<=100?s[t]=n:delete s[t];try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaPauseThresholds:s})})).ok&&j(t=>t.map(t=>t.id===e?{...t,quotaPauseThresholds:s}:t))}catch(e){console.error("Error updating quota threshold:",e)}},[r]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ej(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e6=(0,i.useCallback)(async(e=!1)=>{if(ee)return;et(!0),ea(60);let t=eQ.current+=1,r=Math.round(10);try{let a=await eX(eI);R(p(a)),W(e=>b(e,a)),z(e=>b(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eY(e.id,e.provider))),B(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{et(!1)}},[ee,eX,eY,eI]);(0,i.useEffect)(()=>{(async()=>{es(!0);let e=await eX(eI);es(!1),R(p(e)),W(t=>b(t,e)),z(t=>b(t,e)),await Promise.all(e.map(e=>eY(e.id,e.provider))),B(new Date)})()},[eX,eY,eI]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);K(null===e||"true"===e),X(!0)},[]),(0,i.useEffect)(()=>{Q&&window.localStorage.setItem(o,String(J))},[J,Q]),(0,i.useEffect)(()=>{try{let e=window.localStorage.getItem(d);if(e){let t=JSON.parse(e);if(t?.accountFilter&&["all","active","inactive"].includes(t.accountFilter)&&eq(t.accountFilter),t?.pageSize){let e=Number(t.pageSize);Number.isFinite(e)&&e>0&&(eW(e),eK(String(e)))}}}catch{}Z(!0)},[]),(0,i.useEffect)(()=>{if(Y)try{window.localStorage.setItem(d,JSON.stringify({accountFilter:eP,pageSize:eU}))}catch{}},[eP,eU,Y]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{G({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),eT(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e7=(0,i.useCallback)(async(e,t,r)=>{let a=T[t];if(!a)return;let i={...H[t]||{},[e]:r};G({...H,[t]:i});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:i};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{G(H)}},[H]),e9=(0,i.useCallback)(async(e,t)=>{eT(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eT(t)}},[]),te=(0,i.useCallback)((e,t)=>{let r=k(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.add(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}e9({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,e9]),tt=(0,i.useCallback)((e,t)=>{let r=k(t);if(!e||!r)return;let a=e_[e]||{},i=new Set(a.hidden||[]);if(i.delete(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}e9({...e_,[e]:{...a,hidden:[...i]}},e_)},[e_,e9]),tr=(0,i.useRef)(e6);(0,i.useEffect)(()=>{tr.current=e6},[e6]);let ta=(0,i.useMemo)(()=>(function({onRefresh:e,onTick:t,refreshIntervalMs:r,tickMs:a=1e3}){let i=null,s=null,n=()=>{null!==i&&(clearInterval(i),i=null),null!==s&&(clearInterval(s),s=null)};return{start:()=>{n(),i=setInterval(()=>e(),r),s=setInterval(()=>t(),a)},stop:n,isRunning:()=>null!==i||null!==s}})({onRefresh:()=>tr.current(),onTick:()=>ea(e=>e<=1?60:e-1),refreshIntervalMs:6e4}),[]);(0,i.useEffect)(()=>!Q||!J||"u">typeof document&&document.hidden?void ta.stop():(ta.start(),()=>ta.stop()),[J,Q,ta]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?ta.stop():J&&Q&&ta.start()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e),ta.stop()}},[J,Q,ta]);let ti=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=h(e,t),s=h(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(x(e)||"").localeCompare(x(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,L,eD,eN,e$),[r,L,eD,eN,e$]),ts=e=>{let t=L[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},tn=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eL){ez(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await g(eX,eI)}catch(e){console.error("Error bulk toggling connections:",e)}finally{ez(!1)}}},[eL,eX,eI]),tl="all"===eN?"All providers":eN,to=eV.eligibleConnections>0,td=ti.length>0,tc=eV.eligibleConnections?eV.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===eN?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eP?"turned off":"active"===eP?"active":"matching"} accounts found for ${eN}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},tu=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eH),tm=!c.includes(eU);return ei||to?ei||td?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eF(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eO,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eN?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${eN}.png`,alt:eN,size:18,className:"size-[18px] rounded object-contain",fallbackText:eN.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:tl})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eO&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eF(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eN&&eR(1),eS("all"),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===eN?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eN&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:eC.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eN!==e&&eR(1),eS(e),eF(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${eN===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eN===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:eP,onChange:e=>{let t=e.target.value;eP!==t&&eR(1),eq(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===eN&&(0,a.jsx)("select",{value:e$,onChange:e=>eE(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:m.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eM(e=>!e),"aria-pressed":eD,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eD?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tn(ti.filter(e=>(e.isActive??!0)&&ts(e)).map(e=>e.id),!1)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tn(ti.filter(e=>!(e.isActive??!0)&&!ts(e)).map(e=>e.id),!0)},disabled:eL,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>K(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:J?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${J?"text-primary":"text-text-muted"}`,children:J?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),J&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",er,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e6(!0),disabled:ee,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${ee?"animate-spin":""}`,children:"refresh"})})]})}),eD&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:ti.map(r=>{let i,n,l,o,d=L[r.id],c=I[r.id],u=U[r.id],m=!1===r.isActive,h="codex"===r.provider,p=h?(i=d?.plan?.trim())&&"unknown"!==i.toLowerCase()?i:r?.providerSpecificData?.chatgptPlanType?.trim()||null:null,b=Number.isFinite(l="number"==typeof(n=d?.raw?.resetCredits?.availableCount)?n:Number(n))?Math.max(0,l):0,g=em===r.id,f=ec===r.id,y=en===r.id||eo===r.id||g||f,v=d?.quotas||[],j=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=w(e,r);return 0===a.size?t:t.filter(e=>!a.has(k(e)))}(r.provider,v,e_),$=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=w(e,r);return 0===a.size?[]:t.filter(e=>a.has(k(e)))}(r.provider,v,e_),F=(0,E.XD)(r);return(0,a.jsxs)(A.default,{padding:"none",className:`min-w-0 ${m?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,M(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:M(r)}):null,p?(0,a.jsx)("span",{className:"mt-1 inline-flex rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:p}):null,F.enabled&&(0,a.jsx)("p",{className:"mt-0.5",children:(0,a.jsx)(P.Ex,{variant:F.paused?"warning":"default",size:"sm",children:F.paused?`Paused (quota${F.triggered?`: ${F.triggered.key}`:""})`:"Buffers set"})}),"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(o=r.providerSpecificData?.authMethod)&&_[o]?_[o]:"api_key"===r.authType?"API Key":"OAuth"}),O(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:O(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${m?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:m?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.default,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ep({connection:r,resetCreditCount:b}),disabled:b<=0||c||y,"aria-label":b>0?`Use one Codex reset credit. ${b} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${g?"animate-spin":""}`,children:g?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(C.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r),disabled:c||y,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})}),q.Q2[r.provider]?.fastMode&&(0,a.jsx)(C.default,{text:`Fast mode is ${r.providerSpecificData?.fastMode===!0?"on":"off"}. Uses the provider's faster processing mode at a higher token cost.`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>e3(r,r.providerSpecificData?.fastMode!==!0),disabled:c||y,role:"switch","aria-label":"Toggle fast mode","aria-checked":r.providerSpecificData?.fastMode===!0,className:`flex h-8 min-w-14 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${r.providerSpecificData?.fastMode===!0?"border-primary/30 bg-primary/10 text-primary":"border-black/10 text-text-muted hover:bg-black/5 hover:text-primary dark:border-white/10 dark:hover:bg-white/5"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${f?"animate-spin":""}`,children:f?"progress_activity":"speed"}),(0,a.jsx)("span",{children:"Fast"})]})})]}),T[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(C.default,{text:D[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e7(r.id,r.provider,H[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${H[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(C.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eZ(r.id,r.provider),disabled:c||y,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${c?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(C.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ek(r),ey(!0)},disabled:y,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(C.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>e5(r.id),disabled:y,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${en===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(S.default,{size:"sm",checked:r.isActive??!0,disabled:y,onChange:e=>e2(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[c?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):u?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:u})]}):d?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:d.message})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N,{quotas:j,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==e$,onHideQuota:e=>te(r.provider,e)}),r.lastQuotaSnapshot?.windows?.length>0&&(0,a.jsxs)("div",{className:"mt-2 border-t border-black/5 pt-2 dark:border-white/5",children:[(0,a.jsx)("p",{className:"mb-1 text-[10px] text-text-muted",children:"Pause buffer — pause this account when a window's remaining % ≤"}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:r.lastQuotaSnapshot.windows.map(e=>{let t=Number(r.quotaPauseThresholds?.[e.key])||0;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11px] text-text-muted",title:e.key,children:e.key}),(0,a.jsx)("span",{className:"w-10 text-right text-[10px] tabular-nums text-text-muted",children:"number"==typeof e.remainingPercentage?`${e.remainingPercentage}%`:"—"}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"≤"}),(0,a.jsx)("input",{type:"number",min:0,max:100,value:t,onChange:t=>e8(r.id,e.key,Number.parseInt(t.target.value,10)||0),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px] focus:border-primary focus:outline-none","aria-label":`Pause buffer for ${e.key}`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]},e.key)})})]})]}),d?.message&&!u&&!c&&(0,a.jsx)("p",{className:"mt-2 px-1 text-[10px] leading-relaxed text-text-muted",children:d.message}),$.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:$.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>tt(r.provider,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},k(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:tu}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tm?"custom":String(eU),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eR(1),eW(r),eK(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[c.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eJ,onChange:e=>eK(e.target.value),onBlur:()=>{let e=Number.parseInt(eJ,10);if(!Number.isFinite(e))return void eK(String(eU));let t=Math.min(500,Math.max(1,e));eR(1),eW(t),eK(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eJ,10);if(!Number.isFinite(t))return void eK(String(eU));let r=Math.min(500,Math.max(1,t));eR(1),eW(r),eK(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eH.page," / ",eH.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eR(1),disabled:eH.page<=1||ei||ee,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eR(e=>Math.max(1,e-1)),disabled:eH.page<=1||ei||ee,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eR(e=>Math.min(eH.totalPages,e+1)),disabled:eH.page>=eH.totalPages||ei||ee,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eR(eH.totalPages),disabled:eH.page>=eH.totalPages||ei||ee,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(P.uo,{isOpen:!!eh,onClose:()=>{em||ep(null)},onConfirm:async()=>{let e=eh?.connection;e&&(await e0(e.id,e.provider),ep(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(eh?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eh?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!em}),eb&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:x(eb.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eg(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:eb.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):eb.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:eb.error}):eb.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[eb.data.credits.length," reset credit",1===eb.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[eb.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:eb.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:F(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:F(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(P.wI,{isOpen:ef,connection:ev,proxyPools:ew,onSave:e4,onClose:()=>{ey(!1),ek(null)}})]}):(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:tc.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:tc.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:tc.description})]})}):(0,a.jsx)(A.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[8010,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=62022)),_N_E=e.O()}]);
package/app/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v0.6.11 (2026-09-21)
2
+
3
+ ## Bug Fixes & Stability
4
+ - **macOS Apple Silicon System Tray**: Fixed tray icon failing to appear on Apple Silicon Macs (M1/M2/M3/M4) by automatically detecting missing Rosetta 2 runtime, providing auto-warmup (`softwareupdate --install-rosetta`), adding cached binary permissions fallback, and surfacing actionable error guidance.
5
+ - **Provider Details Page Crash**: Fixed `ReferenceError: fastMode is not defined` in `ConnectionRow` by properly destructuring the `fastMode` prop, adding `updatingFastMode` state, and implementing `handleToggleFastMode`.
6
+ - **Quota Tracker & Provider Limits Crash**: Fixed `ReferenceError: isUpdatingFastMode is not defined` in `ProviderLimits` by declaring `isUpdatingFastMode = fastModeUpdatingId === conn.id` and incorporating it into `rowBusy`.
7
+ - **Combo Modal Test Run Crash**: Fixed `ReferenceError: models is not defined` in `ComboFormModal` on the Combos page by elevating `models = members.map((m) => m.id)` to component scope.
8
+ - **OAuth Action Route Missing Imports**: Added missing `ZED_HOSTED_CONFIG` and `detectIdeInstalled` imports in `api/oauth/[provider]/[action]/route.js`.
9
+
1
10
  # v0.6.10 (2026-09-20)
2
11
 
3
12
  ## Upstream Synchronization & Core Enhancements (decolua/9router #4176 - #4210)
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezrouter-app",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "EzRouter web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
@@ -1,3 +1,11 @@
1
+ # v0.6.11 (2026-09-21)
2
+
3
+ ## Bug Fixes & Stability
4
+ - **Provider Details Page Crash**: Fixed `ReferenceError: fastMode is not defined` in `ConnectionRow` by properly destructuring the `fastMode` prop, adding `updatingFastMode` state, and implementing `handleToggleFastMode`.
5
+ - **Quota Tracker & Provider Limits Crash**: Fixed `ReferenceError: isUpdatingFastMode is not defined` in `ProviderLimits` by declaring `isUpdatingFastMode = fastModeUpdatingId === conn.id` and incorporating it into `rowBusy`.
6
+ - **Combo Modal Test Run Crash**: Fixed `ReferenceError: models is not defined` in `ComboFormModal` on the Combos page by elevating `models = members.map((m) => m.id)` to component scope.
7
+ - **OAuth Action Route Missing Imports**: Added missing `ZED_HOSTED_CONFIG` and `detectIdeInstalled` imports in `api/oauth/[provider]/[action]/route.js`.
8
+
1
9
  # v0.6.10 (2026-09-20)
2
10
 
3
11
  ## Upstream Synchronization & Core Enhancements (decolua/9router #4176 - #4210)
@@ -1,7 +1,10 @@
1
1
  const HOMEBREW_PACKAGE_MANAGER = "homebrew";
2
2
 
3
3
  function isHomebrewManaged(env = process.env) {
4
- return env.NINEROUTER_PACKAGE_MANAGER === HOMEBREW_PACKAGE_MANAGER;
4
+ return (
5
+ env.EZROUTER_PACKAGE_MANAGER === HOMEBREW_PACKAGE_MANAGER ||
6
+ env.NINEROUTER_PACKAGE_MANAGER === HOMEBREW_PACKAGE_MANAGER
7
+ );
5
8
  }
6
9
 
7
10
  function getUpdateCommand(packageName, env = process.env) {
@@ -85,6 +85,30 @@ function npmInstall(pkgs, { silent = false } = {}) {
85
85
  return res.ok;
86
86
  }
87
87
 
88
+ function isRosettaAvailable() {
89
+ if (process.platform !== "darwin" || process.arch !== "arm64") return true;
90
+ try {
91
+ const res = spawnSync("arch", ["-x86_64", "true"], { stdio: "ignore" });
92
+ return res.status === 0;
93
+ } catch {
94
+ return false;
95
+ }
96
+ }
97
+
98
+ function ensureRosetta({ silent = false } = {}) {
99
+ if (isRosettaAvailable()) return true;
100
+ if (!silent) console.log("⏳ Installing Rosetta 2 for macOS system tray...");
101
+ try {
102
+ const res = spawnSync("softwareupdate", ["--install-rosetta", "--agree-to-license"], {
103
+ stdio: silent ? "ignore" : "inherit"
104
+ });
105
+ return res.status === 0 && isRosettaAvailable();
106
+ } catch (e) {
107
+ if (!silent) console.warn(`[ezrouter] Failed to install Rosetta 2: ${e.message}`);
108
+ return false;
109
+ }
110
+ }
111
+
88
112
  // Public: ensure systray2 is installed on macOS/Linux only.
89
113
  // Windows skips entirely (uses PowerShell tray).
90
114
  function ensureTrayRuntime({ silent = false } = {}) {
@@ -99,6 +123,12 @@ function ensureTrayRuntime({ silent = false } = {}) {
99
123
  if (process.platform === "win32") {
100
124
  return { systray: false, skipped: true };
101
125
  }
126
+
127
+ // On Apple Silicon Macs, Rosetta 2 is required by systray2's x86_64 binary.
128
+ if (process.platform === "darwin" && process.arch === "arm64" && !isRosettaAvailable()) {
129
+ ensureRosetta({ silent });
130
+ }
131
+
102
132
  if (hasSystray()) {
103
133
  chmodSystrayBin({ silent });
104
134
  if (!silent) console.log("✅ System tray ready");
@@ -109,4 +139,4 @@ function ensureTrayRuntime({ silent = false } = {}) {
109
139
  return { systray: ok && hasSystray() };
110
140
  }
111
141
 
112
- module.exports = { ensureTrayRuntime };
142
+ module.exports = { ensureTrayRuntime, isRosettaAvailable, ensureRosetta };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbi696/ezrouter",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "EzRouter CLI - Start and manage EzRouter server (default port 20126)",
5
5
  "bin": {
6
6
  "ezrouter": "./cli.js",
@@ -187,10 +187,12 @@ function chmodTrayBin(pkgName) {
187
187
  // chmod on every init avoids a hard-to-diagnose silent tray failure.
188
188
  try {
189
189
  const { getRuntimeNodeModules } = require("../../../hooks/sqliteRuntime");
190
+ const os = require("os");
190
191
  const binName = process.platform === "darwin" ? "tray_darwin_release" : "tray_linux_release";
191
192
  const candidates = [
192
193
  path.join(getRuntimeNodeModules(), pkgName, "traybin", binName),
193
- path.join(__dirname, "..", "..", "..", "node_modules", pkgName, "traybin", binName)
194
+ path.join(__dirname, "..", "..", "..", "node_modules", pkgName, "traybin", binName),
195
+ path.join(os.homedir(), ".cache", "node-systray", "2.1.4", binName)
194
196
  ];
195
197
  for (const p of candidates) {
196
198
  if (fs.existsSync(p)) fs.chmodSync(p, 0o755);
@@ -243,7 +245,12 @@ function initUnixTray(options) {
243
245
  // failures (binary crash, EACCES, etc.) so users can see why the icon
244
246
  // didn't appear instead of getting a misleading "running in tray" log.
245
247
  trayInstance.ready().catch((err) => {
246
- process.stderr.write(`[ezrouter] tray failed to start: ${err && err.message ? err.message : err}\n`);
248
+ const msg = err && err.message ? err.message : String(err);
249
+ if (msg.includes("-86") || msg.includes("EBADARCH") || msg.includes("bad CPU type")) {
250
+ process.stderr.write(`[ezrouter] System tray requires Rosetta 2 on Apple Silicon. Please run:\n softwareupdate --install-rosetta --agree-to-license\n`);
251
+ } else {
252
+ process.stderr.write(`[ezrouter] tray failed to start: ${msg}\n`);
253
+ }
247
254
  });
248
255
  } else {
249
256
  trayInstance.onReady(() => {});