vansrouter 0.9.96 → 0.9.97

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 (556) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/react-loadable-manifest.json +4 -4
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  68. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  69. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  74. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  78. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  79. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  80. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  82. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  94. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  96. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  99. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  101. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  113. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  117. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  121. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  123. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  125. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/fitness/clear/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/proxy-pools/fitness/clear-all/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/proxy-pools/fitness/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  230. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  279. package/app/.next-cli-build/server/app/callback.html +1 -1
  280. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  281. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  282. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  283. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  284. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  285. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  289. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  290. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  293. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  294. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  296. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  299. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  300. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  303. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  304. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  305. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  306. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  309. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  310. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  313. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  314. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  316. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  325. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  326. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  334. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  335. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  337. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  340. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  344. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  345. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  347. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  350. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  355. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  357. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  360. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  365. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  366. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  368. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  371. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  372. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  374. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  375. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  376. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  378. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.html +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.rsc +5 -5
  381. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness/__PAGE__.segment.rsc +2 -2
  382. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness.segment.rsc +1 -1
  383. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  385. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_full.segment.rsc +5 -5
  386. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_head.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_index.segment.rsc +3 -3
  388. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_tree.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  391. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  392. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  394. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  395. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  396. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  398. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  401. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  402. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  405. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  406. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  408. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  410. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  411. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  412. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  415. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  416. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  418. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  423. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  424. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  426. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  433. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  437. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  438. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  440. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  443. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  447. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  448. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  450. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  453. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  457. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  458. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  460. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  463. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  466. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  467. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  468. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  470. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  472. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  473. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  477. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  479. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  480. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  481. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  482. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  483. package/app/.next-cli-build/server/app/landing.html +1 -1
  484. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  485. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  486. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  488. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  489. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  491. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  493. package/app/.next-cli-build/server/app/login.html +1 -1
  494. package/app/.next-cli-build/server/app/login.rsc +4 -4
  495. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  496. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  498. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  502. package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
  503. package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
  504. package/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  505. package/app/.next-cli-build/server/chunks/1253.js +1 -0
  506. package/app/.next-cli-build/server/chunks/1632.js +1 -1
  507. package/app/.next-cli-build/server/chunks/1685.js +1 -1
  508. package/app/.next-cli-build/server/chunks/2445.js +1 -1
  509. package/app/.next-cli-build/server/chunks/2764.js +1 -1
  510. package/app/.next-cli-build/server/chunks/3736.js +1 -1
  511. package/app/.next-cli-build/server/chunks/3750.js +1 -1
  512. package/app/.next-cli-build/server/chunks/4029.js +1 -1
  513. package/app/.next-cli-build/server/chunks/4836.js +1 -1
  514. package/app/.next-cli-build/server/chunks/5006.js +2 -2
  515. package/app/.next-cli-build/server/chunks/5050.js +1 -1
  516. package/app/.next-cli-build/server/chunks/5302.js +1 -1
  517. package/app/.next-cli-build/server/chunks/5598.js +1 -1
  518. package/app/.next-cli-build/server/chunks/{5139.js → 6685.js} +1 -1
  519. package/app/.next-cli-build/server/chunks/7104.js +1 -1
  520. package/app/.next-cli-build/server/chunks/7950.js +1 -1
  521. package/app/.next-cli-build/server/chunks/883.js +1 -1
  522. package/app/.next-cli-build/server/chunks/9614.js +1 -1
  523. package/app/.next-cli-build/server/chunks/9764.js +1 -1
  524. package/app/.next-cli-build/server/chunks/9984.js +1 -1
  525. package/app/.next-cli-build/server/instrumentation.js +1 -1
  526. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  527. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  528. package/app/.next-cli-build/server/middleware.js +1 -1
  529. package/app/.next-cli-build/server/pages/404.html +1 -1
  530. package/app/.next-cli-build/server/pages/500.html +1 -1
  531. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  532. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  533. package/app/.next-cli-build/static/chunks/{1049.437f4475b49e9f25.js → 1049.adc9916d5a6b95f8.js} +1 -1
  534. package/app/.next-cli-build/static/chunks/{2940-1a3db93c61b1ba5a.js → 2940-7bddea6bffcea4aa.js} +1 -1
  535. package/app/.next-cli-build/static/chunks/{3657.a211d6af230af940.js → 3657.512c2a8e4d8a3378.js} +1 -1
  536. package/app/.next-cli-build/static/chunks/4385-523f8ad37beda677.js +1 -0
  537. package/app/.next-cli-build/static/chunks/{5331.de5a8e10de095128.js → 5331.049b1512362de1f4.js} +1 -1
  538. package/app/.next-cli-build/static/chunks/{9078.76edc4f70b7b9a52.js → 9078.ea6aeb4af0c25e5d.js} +1 -1
  539. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-8a85cd383cc0f328.js → page-8d2cf057877e520c.js} +1 -1
  540. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-d350378931392d23.js → page-744acc00b5a9fd3f.js} +1 -1
  541. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-f4ac78f60d3f7407.js → page-775d2e9133c07844.js} +1 -1
  542. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-d02cb515b908f899.js → page-7caa1878034401a6.js} +1 -1
  543. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-ccee260e760480d4.js → page-15c5617ad2c27966.js} +1 -1
  544. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-6c7b84221d88e305.js → page-fb0d7d79c84c197c.js} +1 -1
  545. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-a3e9a9887af0b4d9.js → page-f4a6a4b8fa9893ff.js} +1 -1
  546. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-0ea4bebe43c05e15.js → page-4e73c3bf9b393b12.js} +1 -1
  547. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-e48caf3778a78abb.js → page-44af31c220b203a8.js} +1 -1
  548. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-7903babc41ab9f95.js → page-cca5ff9425339efb.js} +1 -1
  549. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-0d6a79be17b5f31e.js → page-40ce04b1b6199f3a.js} +1 -1
  550. package/app/.next-cli-build/static/chunks/{webpack-2a39918b0a080079.js → webpack-ae0d2579e88dabcc.js} +1 -1
  551. package/app/package.json +4 -1
  552. package/package.json +2 -2
  553. package/app/.next-cli-build/server/chunks/3128.js +0 -1
  554. package/app/.next-cli-build/static/chunks/4385-e945694c05a015c1.js +0 -1
  555. /package/app/.next-cli-build/static/{TH7r6rqILM4ArTRdFwAF9 → YuMtvFzXHJJRdiMbSi-hq}/_buildManifest.js +0 -0
  556. /package/app/.next-cli-build/static/{TH7r6rqILM4ArTRdFwAF9 → YuMtvFzXHJJRdiMbSi-hq}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{19327:(e,t,r)=>{Promise.resolve().then(r.bind(r,70665)),Promise.resolve().then(r.bind(r,47056))},70665:(e,t,r)=>{"use strict";r.d(t,{default:()=>O});var a=r(15102),s=r(82030),i=r(31704),l=r(79835);let n=new Set(["antigravity","gemini-cli"]),o="quotaCacheData",d="quotaAutoRefresh",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],x=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(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 b(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(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(o);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(o,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}let k=[];function j({quotas:e=k,compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[l,n]=(0,s.useState)(1),o=(0,s.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]),d=(0,s.useMemo)(()=>"remaining-asc"===r?o.toSorted((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?o.toSorted((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10)),[u,x]=(0,s.useState)(r),[m,h]=(0,s.useState)(e),[b,p]=(0,s.useState)(c);if(r!==u||e!==m?(x(r),h(e),p(c),n(1)):c!==b&&(p(c),n(e=>Math.min(e,c))),!e||0===e.length)return null;let g=d.slice((l-1)*10,10*l),f=0===d.length?0:(l-1)*10+1,y=Math.min(10*l,d.length),w=t?"py-1 px-1.5":"py-2 px-3",N=t?"text-[11px]":"text-sm",C=t?"text-[11px]":"text-sm",S=t?"text-[10px] leading-tight":"text-xs";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:[d.length," quota",d.length>1?"s":""]}),i&&(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:g.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=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 s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),l=s%60;if(i<24)return`${i}h ${l}m`;let n=Math.floor(i/24);return`${n}d ${i%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${l}`}catch{return null}}(e.resetAt);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:`${w} 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:s.emoji}),(0,a.jsx)("span",{className:`${N} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${w} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.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 ${s.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.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${w} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${C} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?`in ${i}`:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsxs)("div",{className:`${C} text-text-primary font-medium`,children:["in ",i]}),l&&(0,a.jsx)("div",{className:`${S} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${C} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),c>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 ",f,"-",y," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(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:()=>n(e=>Math.min(c,e+1)),disabled:l===c,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 w=r(52252),N=r(18419),C=r(62758),S=r(92940),A=r(95293),$=r(21577);let q={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},E={claude:"claudeAutoPing",codex:"codexAutoPing"},P={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 gpt-5.5 request. 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 M(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function T(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 O(){let{copied:e,copy:t}=(0,$.C)(),[r,k]=(0,s.useState)([]),[O,I]=(0,s.useState)({}),[F,_]=(0,s.useState)({}),[L,z]=(0,s.useState)({}),[R,U]=(0,s.useState)(!0),[K,J]=(0,s.useState)({claude:{},codex:{}}),[G,H]=(0,s.useState)(null),[B,V]=(0,s.useState)(!1),[W,Y]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(60),[Z,ee]=(0,s.useState)(!0),[et,er]=(0,s.useState)(null),[ea,es]=(0,s.useState)(null),[ei,el]=(0,s.useState)(null),[en,eo]=(0,s.useState)(null),[ed,ec]=(0,s.useState)(null),[eu,ex]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(null),[eb,ep]=(0,s.useState)([]),[eg,ef]=(0,s.useState)("all"),[ey,ev]=(0,s.useState)([]),[ek,ej]=(0,s.useState)("all"),[ew,eN]=(0,s.useState)("all"),[eC,eS]=(0,s.useState)("default"),[eA,e$]=(0,s.useState)(!1),[eq,eE]=(0,s.useState)(!1),[eP,eD]=(0,s.useState)(!1),[eM,eT]=(0,s.useState)(1),[eO,eI]=(0,s.useState)(20),[eF,e_]=(0,s.useState)(String(20)),[eL,ez]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eR,eU]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eK=(0,s.useRef)(null),eJ=(0,s.useRef)(null),eG=(0,s.useRef)(0),eH=(0,s.useCallback)(async(e=eM)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eO),accountStatus:ew,sort:"priority"});"all"!==eg&&a.set("provider",eg);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),l=i.connections||[],n=(t=i.pagination,t||{page:1,pageSize:eO,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,l.length);return k(l),ev(i.providerOptions||[]),ez(n),eU(o),eT((r=i.pagination,r?.page||e)),l}catch(e){return console.error("Error fetching connections:",e),k([]),ev([]),ez({page:1,pageSize:eO,total:0,totalPages:1}),eU({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ew,eA,eM,eO,eg]),eB=(0,s.useCallback)(async(e,t)=>{_(t=>({...t,[e]:!0})),z(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};I(t=>({...t,[e]:r})),y(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let s={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":t.quotas&&Object.entries(t.quotas).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])=>{r.push({name: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&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||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,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":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"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"kimi":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"freebuff":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,l.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,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};I(t=>({...t,[e]:s})),y(e,s)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),z(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{_(t=>({...t,[e]:!1}))}},[]),eV=(0,s.useCallback)(async(e,t)=>{await eB(e,t),H(new Date)},[eB]),eW=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!ei){el(e),z(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 eB(e,t),H(new Date)}catch(t){z(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{el(null)}}},[eB,ei]),eY=(0,s.useCallback)(async e=>{ec({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}),ec({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){ec({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eQ=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){er(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){I(t=>{let r={...t};return delete r[e],r}),_(t=>{let r={...t};return delete r[e],r}),z(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(o,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eH,eM)}}catch(e){console.error("Error deleting connection:",e)}finally{er(null)}}},[eH,eM]),eX=(0,s.useCallback)(async(e,t)=>{es(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(I(e=>({...e})),await g(eH,eM))}catch(e){console.error("Error updating connection status:",e)}finally{es(null)}},[eH,eM]),eZ=(0,s.useCallback)(async e=>{if(!em?.id)return;let t=em.id,r=em.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eH(),ex(!1),eh(null),A.wb.includes(r)&&await eB(t,r))}catch(e){console.error("Error saving connection:",e)}},[em,eH,eB]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ep(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e0=(0,s.useCallback)(async(e=!1)=>{if(W)return;Y(!0),X(60);let t=eG.current+=1,r=Math.round(3);try{let a=await eH(eM);_(b(a)),z(e=>p(e,a)),I(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eB(e.id,e.provider))),H(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{Y(!1)}},[W,eH,eB,eM]);(0,s.useEffect)(()=>{(async()=>{ee(!0);let e=await eH(eM);ee(!1),_(b(e)),z(t=>p(t,e)),I(t=>p(t,e)),await Promise.all(e.map(e=>eB(e.id,e.provider))),H(new Date)})()},[eH,eB,eM]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(d);U(null===e||"true"===e),V(!0)},[]),(0,s.useEffect)(()=>{B&&window.localStorage.setItem(d,String(R))},[R,B]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>J({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}})).catch(()=>{})},[]);let e1=(0,s.useCallback)(async(e,t,r)=>{let a=E[t];if(!a)return;let s={...K[t]||{},[e]:r};J({...K,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:s};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{J(K)}},[K]);(0,s.useEffect)(()=>{if(!B||!R){eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null);return}return eK.current=setInterval(()=>{e0()},6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3),()=>{eK.current&&clearInterval(eK.current),eJ.current&&clearInterval(eJ.current)}},[R,e0,B]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null)):R&&B&&(eK.current=setInterval(()=>e0(),6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[R,e0,B]),(0,s.useEffect)(()=>{ej("all")},[eg]);let e5=(0,s.useMemo)(()=>eg&&n.has(eg)?(0,l.KC)(eg).map(e=>({id:e.id,name:e.name||e.id})):[],[eg]),e2=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=h(e,t),i=h(r,t),l="remaining-asc"===s?a-i:i-a;return 0!==l?l:(m(e)||"").localeCompare(m(r)||"")});if(!r)return e;let i=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=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,O,eA,eg,eC),[r,O,eA,eg,eC]),e3=e=>{let t=O[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},e8=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eP){eD(!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(eH,eM)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eD(!1)}}},[eP,eH,eM]),e4="all"===eg?"All providers":eg,e6=eR.eligibleConnections>0,e9=e2.length>0,e7=eR.eligibleConnections?eR.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"===eg?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ew?"turned off":"active"===ew?"active":"matching"} accounts found for ${eg}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},te=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}`}(eL),tt=!c.includes(eO);return Z||e6?Z||e9?(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:()=>eE(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":eq,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eg?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${eg}.webp`,alt:eg,size:18,className:"size-[18px] rounded object-contain",fallbackText:eg.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e4})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eq&&(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:()=>eE(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-1.5 w-52 overflow-hidden rounded-xl border border-black/10 bg-surface/95 p-1 shadow-lg shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-60",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eg&&eT(1),ef("all"),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${"all"===eg?"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-[16px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eg&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",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-60 overflow-y-auto pr-0.5",children:ey.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eg!==e&&eT(1),ef(e),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${eg===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.webp`,alt:e,size:18,className:"size-[18px] rounded object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eg===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ew,onChange:e=>{let t=e.target.value;ew!==t&&eT(1),eN(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"===eg&&(0,a.jsx)("select",{value:eC,onChange:e=>eS(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:x.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),n.has(eg)&&e5.length>0&&(0,a.jsxs)("select",{value:ek,onChange:e=>ej(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":"Filter quotas by model",children:[(0,a.jsx)("option",{value:"all",children:"All models"}),e5.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>e$(e=>!e),"aria-pressed":eA,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eA?"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:()=>{e8(e2.filter(e=>(e.isActive??!0)&&e3(e)).map(e=>e.id),!1)},disabled:eP,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:()=>{e8(e2.filter(e=>!(e.isActive??!0)&&!e3(e)).map(e=>e.id),!0)},disabled:eP,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:()=>U(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:R?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${R?"text-primary":"text-text-muted"}`,children:R?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),R&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",Q,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e0(!0),disabled:W,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] ${W?"animate-spin":""}`,children:"refresh"})})]})}),eA&&(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:e2.map(r=>{var s;let l,n,o,d=O[r.id],c=F[r.id],u=L[r.id],x=!1===r.isActive,h="codex"===r.provider,b=Number.isFinite(n="number"==typeof(l=d?.raw?.resetCredits?.availableCount)?l:Number(l))?Math.max(0,n):0,p=ei===r.id,g=et===r.id||ea===r.id||p;return(0,a.jsxs)(C.A,{padding:"none",className:`min-w-0 ${x?"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)(i.A,{src:`/providers/${r.provider}.webp`,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}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,"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)&&q[o]?q[o]:"api_key"===r.authType?"API Key":"OAuth"}),M(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:M(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${x?"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:x?"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)(N.A,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>eo({connection:r,resetCreditCount:b}),disabled:b<=0||c||g,"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] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(N.A,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r),disabled:c||g,"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"})})})]}),E[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(N.A,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r.id,r.provider,K[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 ${K[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)(N.A,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eV(r.id,r.provider),disabled:c||g,"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)(N.A,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eh(r),ex(!0)},disabled:g,"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)(N.A,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eQ(r.id),disabled:g,"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] ${et===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)(w.A,{size:"sm",checked:r.isActive??!0,disabled:g,onChange:e=>eX(r.id,e)})})]})]})}),(0,a.jsx)("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.jsx)(j,{quotas:(s=d?.quotas,Array.isArray(s)&&"all"!==ek&&ek?s.filter(e=>(e&&(e.modelKey||e.name)||"")===ek):s||[]),compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eC})})]},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:te}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tt?"custom":String(eO),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eT(1),eI(r),e_(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:eF,onChange:e=>e_(e.target.value),onBlur:()=>{let e=Number.parseInt(eF,10);if(!Number.isFinite(e))return void e_(String(eO));let t=Math.min(500,Math.max(1,e));eT(1),eI(t),e_(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eF,10);if(!Number.isFinite(t))return void e_(String(eO));let r=Math.min(500,Math.max(1,t));eT(1),eI(r),e_(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 ",eL.page," / ",eL.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eT(1),disabled:eL.page<=1||Z||W,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:()=>eT(e=>Math.max(1,e-1)),disabled:eL.page<=1||Z||W,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:()=>eT(e=>Math.min(eL.totalPages,e+1)),disabled:eL.page>=eL.totalPages||Z||W,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:()=>eT(eL.totalPages),disabled:eL.page>=eL.totalPages||Z||W,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)(S.ConfirmModal,{isOpen:!!en,onClose:()=>{ei||eo(null)},onConfirm:async()=>{let e=en?.connection;e&&(await eW(e.id,e.provider),eo(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(en?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${en?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!ei}),ed&&(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:m(ed.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>ec(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:ed.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..."]}):ed.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:ed.error}):ed.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:[ed.data.credits.length," reset credit",1===ed.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ed.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:ed.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:T(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:T(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),s=r%24;return a>0?`${a}d ${s}h`:`${s}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)(S.EditConnectionModal,{isOpen:eu,connection:em,proxyPools:eb,onSave:eZ,onClose:()=>{ex(!1),eh(null)}})]}):(0,a.jsx)(C.A,{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:e7.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e7.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e7.description})]})}):(0,a.jsx)(C.A,{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,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=19327)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{19327:(e,t,r)=>{Promise.resolve().then(r.bind(r,70665)),Promise.resolve().then(r.bind(r,47056))},70665:(e,t,r)=>{"use strict";r.d(t,{default:()=>O});var a=r(15102),s=r(82030),i=r(31704),l=r(79835);let n=new Set(["antigravity","gemini-cli"]),o="quotaCacheData",d="quotaAutoRefresh",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],x=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(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 b(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(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(o);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(o,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}let k=[];function j({quotas:e=k,compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[l,n]=(0,s.useState)(1),o=(0,s.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]),d=(0,s.useMemo)(()=>"remaining-asc"===r?o.toSorted((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?o.toSorted((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10)),[u,x]=(0,s.useState)(r),[m,h]=(0,s.useState)(e),[b,p]=(0,s.useState)(c);if(r!==u||e!==m?(x(r),h(e),p(c),n(1)):c!==b&&(p(c),n(e=>Math.min(e,c))),!e||0===e.length)return null;let g=d.slice((l-1)*10,10*l),f=0===d.length?0:(l-1)*10+1,y=Math.min(10*l,d.length),w=t?"py-1 px-1.5":"py-2 px-3",N=t?"text-[11px]":"text-sm",C=t?"text-[11px]":"text-sm",S=t?"text-[10px] leading-tight":"text-xs";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:[d.length," quota",d.length>1?"s":""]}),i&&(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:g.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=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 s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),l=s%60;if(i<24)return`${i}h ${l}m`;let n=Math.floor(i/24);return`${n}d ${i%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${l}`}catch{return null}}(e.resetAt);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:`${w} 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:s.emoji}),(0,a.jsx)("span",{className:`${N} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${w} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.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 ${s.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.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${w} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${C} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?`in ${i}`:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsxs)("div",{className:`${C} text-text-primary font-medium`,children:["in ",i]}),l&&(0,a.jsx)("div",{className:`${S} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${C} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),c>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 ",f,"-",y," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(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:()=>n(e=>Math.min(c,e+1)),disabled:l===c,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 w=r(52252),N=r(18419),C=r(62758),S=r(92940),A=r(31038),$=r(21577);let q={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},E={claude:"claudeAutoPing",codex:"codexAutoPing"},P={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 gpt-5.5 request. 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 M(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function T(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 O(){let{copied:e,copy:t}=(0,$.C)(),[r,k]=(0,s.useState)([]),[O,I]=(0,s.useState)({}),[F,_]=(0,s.useState)({}),[L,z]=(0,s.useState)({}),[R,U]=(0,s.useState)(!0),[K,J]=(0,s.useState)({claude:{},codex:{}}),[G,H]=(0,s.useState)(null),[B,V]=(0,s.useState)(!1),[W,Y]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(60),[Z,ee]=(0,s.useState)(!0),[et,er]=(0,s.useState)(null),[ea,es]=(0,s.useState)(null),[ei,el]=(0,s.useState)(null),[en,eo]=(0,s.useState)(null),[ed,ec]=(0,s.useState)(null),[eu,ex]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(null),[eb,ep]=(0,s.useState)([]),[eg,ef]=(0,s.useState)("all"),[ey,ev]=(0,s.useState)([]),[ek,ej]=(0,s.useState)("all"),[ew,eN]=(0,s.useState)("all"),[eC,eS]=(0,s.useState)("default"),[eA,e$]=(0,s.useState)(!1),[eq,eE]=(0,s.useState)(!1),[eP,eD]=(0,s.useState)(!1),[eM,eT]=(0,s.useState)(1),[eO,eI]=(0,s.useState)(20),[eF,e_]=(0,s.useState)(String(20)),[eL,ez]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eR,eU]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eK=(0,s.useRef)(null),eJ=(0,s.useRef)(null),eG=(0,s.useRef)(0),eH=(0,s.useCallback)(async(e=eM)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eO),accountStatus:ew,sort:"priority"});"all"!==eg&&a.set("provider",eg);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),l=i.connections||[],n=(t=i.pagination,t||{page:1,pageSize:eO,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,l.length);return k(l),ev(i.providerOptions||[]),ez(n),eU(o),eT((r=i.pagination,r?.page||e)),l}catch(e){return console.error("Error fetching connections:",e),k([]),ev([]),ez({page:1,pageSize:eO,total:0,totalPages:1}),eU({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ew,eA,eM,eO,eg]),eB=(0,s.useCallback)(async(e,t)=>{_(t=>({...t,[e]:!0})),z(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};I(t=>({...t,[e]:r})),y(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let s={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":t.quotas&&Object.entries(t.quotas).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])=>{r.push({name: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&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||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,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":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"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"kimi":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"freebuff":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,l.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,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};I(t=>({...t,[e]:s})),y(e,s)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),z(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{_(t=>({...t,[e]:!1}))}},[]),eV=(0,s.useCallback)(async(e,t)=>{await eB(e,t),H(new Date)},[eB]),eW=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!ei){el(e),z(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 eB(e,t),H(new Date)}catch(t){z(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{el(null)}}},[eB,ei]),eY=(0,s.useCallback)(async e=>{ec({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}),ec({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){ec({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eQ=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){er(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){I(t=>{let r={...t};return delete r[e],r}),_(t=>{let r={...t};return delete r[e],r}),z(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(o,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eH,eM)}}catch(e){console.error("Error deleting connection:",e)}finally{er(null)}}},[eH,eM]),eX=(0,s.useCallback)(async(e,t)=>{es(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(I(e=>({...e})),await g(eH,eM))}catch(e){console.error("Error updating connection status:",e)}finally{es(null)}},[eH,eM]),eZ=(0,s.useCallback)(async e=>{if(!em?.id)return;let t=em.id,r=em.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eH(),ex(!1),eh(null),A.wb.includes(r)&&await eB(t,r))}catch(e){console.error("Error saving connection:",e)}},[em,eH,eB]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ep(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e0=(0,s.useCallback)(async(e=!1)=>{if(W)return;Y(!0),X(60);let t=eG.current+=1,r=Math.round(3);try{let a=await eH(eM);_(b(a)),z(e=>p(e,a)),I(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eB(e.id,e.provider))),H(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{Y(!1)}},[W,eH,eB,eM]);(0,s.useEffect)(()=>{(async()=>{ee(!0);let e=await eH(eM);ee(!1),_(b(e)),z(t=>p(t,e)),I(t=>p(t,e)),await Promise.all(e.map(e=>eB(e.id,e.provider))),H(new Date)})()},[eH,eB,eM]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(d);U(null===e||"true"===e),V(!0)},[]),(0,s.useEffect)(()=>{B&&window.localStorage.setItem(d,String(R))},[R,B]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>J({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}})).catch(()=>{})},[]);let e1=(0,s.useCallback)(async(e,t,r)=>{let a=E[t];if(!a)return;let s={...K[t]||{},[e]:r};J({...K,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:s};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{J(K)}},[K]);(0,s.useEffect)(()=>{if(!B||!R){eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null);return}return eK.current=setInterval(()=>{e0()},6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3),()=>{eK.current&&clearInterval(eK.current),eJ.current&&clearInterval(eJ.current)}},[R,e0,B]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null)):R&&B&&(eK.current=setInterval(()=>e0(),6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[R,e0,B]),(0,s.useEffect)(()=>{ej("all")},[eg]);let e5=(0,s.useMemo)(()=>eg&&n.has(eg)?(0,l.KC)(eg).map(e=>({id:e.id,name:e.name||e.id})):[],[eg]),e2=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=h(e,t),i=h(r,t),l="remaining-asc"===s?a-i:i-a;return 0!==l?l:(m(e)||"").localeCompare(m(r)||"")});if(!r)return e;let i=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=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,O,eA,eg,eC),[r,O,eA,eg,eC]),e3=e=>{let t=O[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},e8=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eP){eD(!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(eH,eM)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eD(!1)}}},[eP,eH,eM]),e4="all"===eg?"All providers":eg,e6=eR.eligibleConnections>0,e9=e2.length>0,e7=eR.eligibleConnections?eR.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"===eg?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ew?"turned off":"active"===ew?"active":"matching"} accounts found for ${eg}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},te=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}`}(eL),tt=!c.includes(eO);return Z||e6?Z||e9?(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:()=>eE(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":eq,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eg?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${eg}.webp`,alt:eg,size:18,className:"size-[18px] rounded object-contain",fallbackText:eg.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e4})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eq&&(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:()=>eE(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-1.5 w-52 overflow-hidden rounded-xl border border-black/10 bg-surface/95 p-1 shadow-lg shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-60",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eg&&eT(1),ef("all"),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${"all"===eg?"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-[16px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eg&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",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-60 overflow-y-auto pr-0.5",children:ey.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eg!==e&&eT(1),ef(e),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${eg===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.webp`,alt:e,size:18,className:"size-[18px] rounded object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eg===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ew,onChange:e=>{let t=e.target.value;ew!==t&&eT(1),eN(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"===eg&&(0,a.jsx)("select",{value:eC,onChange:e=>eS(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:x.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),n.has(eg)&&e5.length>0&&(0,a.jsxs)("select",{value:ek,onChange:e=>ej(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":"Filter quotas by model",children:[(0,a.jsx)("option",{value:"all",children:"All models"}),e5.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>e$(e=>!e),"aria-pressed":eA,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eA?"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:()=>{e8(e2.filter(e=>(e.isActive??!0)&&e3(e)).map(e=>e.id),!1)},disabled:eP,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:()=>{e8(e2.filter(e=>!(e.isActive??!0)&&!e3(e)).map(e=>e.id),!0)},disabled:eP,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:()=>U(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:R?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${R?"text-primary":"text-text-muted"}`,children:R?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),R&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",Q,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e0(!0),disabled:W,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] ${W?"animate-spin":""}`,children:"refresh"})})]})}),eA&&(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:e2.map(r=>{var s;let l,n,o,d=O[r.id],c=F[r.id],u=L[r.id],x=!1===r.isActive,h="codex"===r.provider,b=Number.isFinite(n="number"==typeof(l=d?.raw?.resetCredits?.availableCount)?l:Number(l))?Math.max(0,n):0,p=ei===r.id,g=et===r.id||ea===r.id||p;return(0,a.jsxs)(C.A,{padding:"none",className:`min-w-0 ${x?"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)(i.A,{src:`/providers/${r.provider}.webp`,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}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,"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)&&q[o]?q[o]:"api_key"===r.authType?"API Key":"OAuth"}),M(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:M(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${x?"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:x?"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)(N.A,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>eo({connection:r,resetCreditCount:b}),disabled:b<=0||c||g,"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] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(N.A,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r),disabled:c||g,"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"})})})]}),E[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(N.A,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r.id,r.provider,K[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 ${K[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)(N.A,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eV(r.id,r.provider),disabled:c||g,"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)(N.A,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eh(r),ex(!0)},disabled:g,"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)(N.A,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eQ(r.id),disabled:g,"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] ${et===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)(w.A,{size:"sm",checked:r.isActive??!0,disabled:g,onChange:e=>eX(r.id,e)})})]})]})}),(0,a.jsx)("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.jsx)(j,{quotas:(s=d?.quotas,Array.isArray(s)&&"all"!==ek&&ek?s.filter(e=>(e&&(e.modelKey||e.name)||"")===ek):s||[]),compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eC})})]},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:te}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tt?"custom":String(eO),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eT(1),eI(r),e_(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:eF,onChange:e=>e_(e.target.value),onBlur:()=>{let e=Number.parseInt(eF,10);if(!Number.isFinite(e))return void e_(String(eO));let t=Math.min(500,Math.max(1,e));eT(1),eI(t),e_(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eF,10);if(!Number.isFinite(t))return void e_(String(eO));let r=Math.min(500,Math.max(1,t));eT(1),eI(r),e_(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 ",eL.page," / ",eL.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eT(1),disabled:eL.page<=1||Z||W,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:()=>eT(e=>Math.max(1,e-1)),disabled:eL.page<=1||Z||W,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:()=>eT(e=>Math.min(eL.totalPages,e+1)),disabled:eL.page>=eL.totalPages||Z||W,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:()=>eT(eL.totalPages),disabled:eL.page>=eL.totalPages||Z||W,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)(S.ConfirmModal,{isOpen:!!en,onClose:()=>{ei||eo(null)},onConfirm:async()=>{let e=en?.connection;e&&(await eW(e.id,e.provider),eo(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(en?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${en?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!ei}),ed&&(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:m(ed.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>ec(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:ed.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..."]}):ed.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:ed.error}):ed.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:[ed.data.credits.length," reset credit",1===ed.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ed.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:ed.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:T(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:T(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),s=r%24;return a>0?`${a}d ${s}h`:`${s}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)(S.EditConnectionModal,{isOpen:eu,connection:em,proxyPools:eb,onSave:eZ,onClose:()=>{ex(!1),eh(null)}})]}):(0,a.jsx)(C.A,{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:e7.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e7.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e7.description})]})}):(0,a.jsx)(C.A,{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,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=19327)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{79153:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(15102),l=s(82030),n=s(93278),r=s(92940),i=s(62758),o=s(88140),d=s(83916);let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};function x({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let o=(0,l.useRef)(t);return((0,l.useEffect)(()=>{o.current=t}),(0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&o.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",c[r]||c.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}var m=s(23812),p=s(95293);let u=null,h=null;async function f(){if(u&&h)return{providerNameCache:u,providerNodesCache:h};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(h={},t))h[e.id]=e.name;return{providerNameCache:u={...p.Q2,...h},providerNodesCache:h}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,p.zt)(e)||p.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function v({filterProvider:e,setFilterProvider:t,filterStart:s,setFilterStart:l,filterEnd:n,setFilterEnd:r,providers:d,cn:c,handleApplyFilters:x,handleClearFilters:m}){return(0,a.jsx)(i.A,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:e,onChange:e=>t(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20 w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:s,onChange:e=>l(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:n,onChange:e=>r(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Actions"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.A,{onClick:x,className:"flex-1",children:"Search"}),(0,a.jsx)(o.A,{variant:"ghost",onClick:m,disabled:!e&&!s&&!n,className:"flex-1",children:"Clear"})]})]})]})})}function N({detail:e,index:t,handleViewDetail:s,providerNameCache:l}){return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,l)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.A,{variant:"outline",size:"sm",onClick:()=>s(e),children:"Detail"})})]},`${e.id}-${t}`)}function w(){var e;let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(0),[o,c]=(0,l.useState)(0),[p,u]=(0,l.useState)(1),[h,w]=(0,l.useState)(20),[k,y]=(0,l.useState)(!1),[S,C]=(0,l.useState)(null),[P,T]=(0,l.useState)(!1),[D,E]=(0,l.useState)([]),[R,A]=(0,l.useState)(null),[_,L]=(0,l.useState)(""),[O,I]=(0,l.useState)(""),[q,F]=(0,l.useState)(""),[$,z]=(0,l.useState)(""),[K,U]=(0,l.useState)(""),[J,M]=(0,l.useState)(""),[Q,B]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>{let e=new Date;e.setDate(e.getDate()-7);let t=e.toISOString().slice(0,16);I(t),U(t),B(!0)},500);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=new AbortController;return fetch("/api/usage/providers",{signal:e.signal}).then(e=>e.json()).then(async t=>{if(e.signal.aborted)return;E(t.providers||[]);let s=await f();e.signal.aborted||A(s.providerNameCache)}).catch(()=>{}),()=>e.abort()},[]),(0,l.useEffect)(()=>{if(!Q||!K)return;let e=new AbortController;y(!0);let t=new URLSearchParams({page:String(p),pageSize:String(h)});return $&&t.append("provider",$),t.append("startDate",K),J&&t.append("endDate",J),fetch(`/api/usage/request-details?${t}`,{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(t=>{e.signal.aborted||(s(Array.isArray(t.details)?t.details:[]),r(t.pagination?.totalItems??0),c(t.pagination?.totalPages??0))}).catch(t=>{e.signal.aborted||console.error("request-details fetch failed:",t)}).finally(()=>{e.signal.aborted||y(!1)}),()=>e.abort()},[Q,p,h,$,K,J]);let H=e=>{C(e),T(!0),fetch(`/api/usage/request-details/${encodeURIComponent(e.id)}`).then(e=>e.ok?e.json():null).then(e=>{e?.detail&&C(e.detail)}).catch(()=>{})};return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(v,{filterProvider:_,setFilterProvider:L,filterStart:O,setFilterStart:I,filterEnd:q,setFilterEnd:F,providers:D,cn:d.cn,handleApplyFilters:()=>{u(1),z(_),U(O),M(q)},handleClearFilters:()=>{let e,t=((e=new Date).setDate(e.getDate()-7),e.toISOString().slice(0,16));L(""),I(t),F(""),u(1),z(""),U(t),M("")}}),(0,a.jsxs)(i.A,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:k||!Q?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):t.map((e,t)=>(0,a.jsx)(N,{detail:e,index:t,handleViewDetail:H,providerNameCache:R},t))})]})}),!k&&t.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(m.A,{currentPage:p,pageSize:h,totalItems:n,onPageChange:e=>u(e),onPageSizeChange:e=>{w(e),u(1)}})})]}),(0,a.jsx)(x,{isOpen:P,onClose:()=>T(!1),title:"Request Details",width:"lg",children:S&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:S.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(S.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(S.provider,R)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key Name:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:S.apiKeyName||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.apiKeyName&&S.apiKey?(e=S.apiKey)?e.length>8?`${e.slice(0,8)}...`:e:"":"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===S.status?"text-green-600":"text-red-600"),children:S.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",S.latency?.ttft||0,"ms / Total ",S.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(S.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.tokens?.completion_tokens?.toLocaleString()||0})]})]}),S.pxpipe&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"image"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"PXPIPE"}),(0,a.jsx)("span",{className:(0,d.cn)("text-xs px-2 py-0.5 rounded",S.pxpipe.applied?"bg-green-500/15 text-green-600":"bg-amber-500/15 text-amber-600"),children:S.pxpipe.applied?"Activated":"Skipped"})]}),S.pxpipe.applied?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm sm:grid-cols-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Original (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensBeforeEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Compressed (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensAfterEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Saved"}),(0,a.jsxs)("span",{className:"font-mono text-green-600",children:[S.pxpipe.savedPct||0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Images"}),(0,a.jsxs)("span",{className:"font-mono",children:[S.pxpipe.imageCount||0," (",S.pxpipe.durationMs||0,"ms)"]})]})]}):(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Reason: ",(0,a.jsx)("span",{className:"font-mono",children:S.pxpipe.reason}),S.pxpipe.detail?` — ${S.pxpipe.detail}`:""]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.request,null,2)})}),S.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.providerRequest,null,2)})}),S.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof S.providerResponse?JSON.stringify(S.providerResponse,null,2):S.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[S.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:S.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:S.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.SegmentedControl,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.SegmentedControl,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(r.UsageStats,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.RequestLogger,{}),"details"===d&&(0,a.jsx)(w,{})]})}},85085:(e,t,s)=>{Promise.resolve().then(s.bind(s,79153))}},e=>{e.O(0,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=85085)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{79153:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(15102),l=s(82030),n=s(93278),r=s(92940),i=s(62758),o=s(88140),d=s(83916);let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};function x({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let o=(0,l.useRef)(t);return((0,l.useEffect)(()=>{o.current=t}),(0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&o.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",c[r]||c.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}var m=s(23812),p=s(31038);let u=null,h=null;async function f(){if(u&&h)return{providerNameCache:u,providerNodesCache:h};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(h={},t))h[e.id]=e.name;return{providerNameCache:u={...p.Q2,...h},providerNodesCache:h}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,p.zt)(e)||p.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function v({filterProvider:e,setFilterProvider:t,filterStart:s,setFilterStart:l,filterEnd:n,setFilterEnd:r,providers:d,cn:c,handleApplyFilters:x,handleClearFilters:m}){return(0,a.jsx)(i.A,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:e,onChange:e=>t(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20 w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:s,onChange:e=>l(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:n,onChange:e=>r(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Actions"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.A,{onClick:x,className:"flex-1",children:"Search"}),(0,a.jsx)(o.A,{variant:"ghost",onClick:m,disabled:!e&&!s&&!n,className:"flex-1",children:"Clear"})]})]})]})})}function N({detail:e,index:t,handleViewDetail:s,providerNameCache:l}){return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,l)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.A,{variant:"outline",size:"sm",onClick:()=>s(e),children:"Detail"})})]},`${e.id}-${t}`)}function w(){var e;let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(0),[o,c]=(0,l.useState)(0),[p,u]=(0,l.useState)(1),[h,w]=(0,l.useState)(20),[k,y]=(0,l.useState)(!1),[S,C]=(0,l.useState)(null),[P,T]=(0,l.useState)(!1),[D,E]=(0,l.useState)([]),[R,A]=(0,l.useState)(null),[_,L]=(0,l.useState)(""),[O,I]=(0,l.useState)(""),[q,F]=(0,l.useState)(""),[$,z]=(0,l.useState)(""),[K,U]=(0,l.useState)(""),[J,M]=(0,l.useState)(""),[Q,B]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>{let e=new Date;e.setDate(e.getDate()-7);let t=e.toISOString().slice(0,16);I(t),U(t),B(!0)},500);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=new AbortController;return fetch("/api/usage/providers",{signal:e.signal}).then(e=>e.json()).then(async t=>{if(e.signal.aborted)return;E(t.providers||[]);let s=await f();e.signal.aborted||A(s.providerNameCache)}).catch(()=>{}),()=>e.abort()},[]),(0,l.useEffect)(()=>{if(!Q||!K)return;let e=new AbortController;y(!0);let t=new URLSearchParams({page:String(p),pageSize:String(h)});return $&&t.append("provider",$),t.append("startDate",K),J&&t.append("endDate",J),fetch(`/api/usage/request-details?${t}`,{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(t=>{e.signal.aborted||(s(Array.isArray(t.details)?t.details:[]),r(t.pagination?.totalItems??0),c(t.pagination?.totalPages??0))}).catch(t=>{e.signal.aborted||console.error("request-details fetch failed:",t)}).finally(()=>{e.signal.aborted||y(!1)}),()=>e.abort()},[Q,p,h,$,K,J]);let H=e=>{C(e),T(!0),fetch(`/api/usage/request-details/${encodeURIComponent(e.id)}`).then(e=>e.ok?e.json():null).then(e=>{e?.detail&&C(e.detail)}).catch(()=>{})};return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(v,{filterProvider:_,setFilterProvider:L,filterStart:O,setFilterStart:I,filterEnd:q,setFilterEnd:F,providers:D,cn:d.cn,handleApplyFilters:()=>{u(1),z(_),U(O),M(q)},handleClearFilters:()=>{let e,t=((e=new Date).setDate(e.getDate()-7),e.toISOString().slice(0,16));L(""),I(t),F(""),u(1),z(""),U(t),M("")}}),(0,a.jsxs)(i.A,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:k||!Q?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):t.map((e,t)=>(0,a.jsx)(N,{detail:e,index:t,handleViewDetail:H,providerNameCache:R},t))})]})}),!k&&t.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(m.A,{currentPage:p,pageSize:h,totalItems:n,onPageChange:e=>u(e),onPageSizeChange:e=>{w(e),u(1)}})})]}),(0,a.jsx)(x,{isOpen:P,onClose:()=>T(!1),title:"Request Details",width:"lg",children:S&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:S.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(S.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(S.provider,R)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key Name:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:S.apiKeyName||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.apiKeyName&&S.apiKey?(e=S.apiKey)?e.length>8?`${e.slice(0,8)}...`:e:"":"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===S.status?"text-green-600":"text-red-600"),children:S.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",S.latency?.ttft||0,"ms / Total ",S.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(S.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.tokens?.completion_tokens?.toLocaleString()||0})]})]}),S.pxpipe&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"image"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"PXPIPE"}),(0,a.jsx)("span",{className:(0,d.cn)("text-xs px-2 py-0.5 rounded",S.pxpipe.applied?"bg-green-500/15 text-green-600":"bg-amber-500/15 text-amber-600"),children:S.pxpipe.applied?"Activated":"Skipped"})]}),S.pxpipe.applied?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm sm:grid-cols-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Original (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensBeforeEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Compressed (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensAfterEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Saved"}),(0,a.jsxs)("span",{className:"font-mono text-green-600",children:[S.pxpipe.savedPct||0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Images"}),(0,a.jsxs)("span",{className:"font-mono",children:[S.pxpipe.imageCount||0," (",S.pxpipe.durationMs||0,"ms)"]})]})]}):(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Reason: ",(0,a.jsx)("span",{className:"font-mono",children:S.pxpipe.reason}),S.pxpipe.detail?` — ${S.pxpipe.detail}`:""]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.request,null,2)})}),S.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.providerRequest,null,2)})}),S.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof S.providerResponse?JSON.stringify(S.providerResponse,null,2):S.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[S.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:S.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:S.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.SegmentedControl,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.SegmentedControl,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(r.UsageStats,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.RequestLogger,{}),"details"===d&&(0,a.jsx)(w,{})]})}},85085:(e,t,s)=>{Promise.resolve().then(s.bind(s,79153))}},e=>{e.O(0,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=85085)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t,r,o,n,a,c,i,d,l={},s={};function f(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},o=!0;try{l[e].call(r.exports,r,r.exports,f),o=!1}finally{o&&delete s[e]}return r.exports}f.m=l,e=[],f.O=(t,r,o,n)=>{if(r){n=n||0;for(var a=e.length;a>0&&e[a-1][2]>n;a--)e[a]=e[a-1];e[a]=[r,o,n];return}for(var c=1/0,a=0;a<e.length;a++){for(var[r,o,n]=e[a],i=!0,d=0;d<r.length;d++)(!1&n||c>=n)&&Object.keys(f.O).every(e=>f.O[e](r[d]))?r.splice(d--,1):(i=!1,n<c&&(c=n));if(i){e.splice(a--,1);var l=o();void 0!==l&&(t=l)}}return t},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var n=Object.create(null);f.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var c=2&o&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach(t=>a[t]=()=>e[t]);return a.default=()=>e,f.d(n,a),n},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>7236===e?"static/chunks/7236-f1e0a36eb81c5151.js":5479===e?"static/chunks/5479-4214d11ddca13cd7.js":5334===e?"static/chunks/5334-4a80ee40870b70ae.js":1399===e?"static/chunks/1399-71db70ab3102530f.js":"static/chunks/"+(7418===e?"642b329c":e)+"."+({406:"7447d162fc1137ef",1049:"437f4475b49e9f25",1409:"9d9e122fbb02e985",1567:"380d58c42bf5620c",2673:"e645c662bafae6d3",2884:"d5538f4fb96995c4",3124:"945def356dab66f4",3245:"72bf2b81ee2bcca7",3257:"87d6a61b9e5f6a92",3386:"c9a6be6fd4e818a6",3657:"a211d6af230af940",5331:"de5a8e10de095128",5560:"8286d410d8bda0da",6474:"06effe2dc57f25fb",6676:"a4b23fc11d3037fd",6909:"38877fab8673c355",7418:"6470aa395ac1043a",8667:"b22b7da66acd945f",9078:"76edc4f70b7b9a52",9146:"cf59a3c6b6d8c735"})[e]+".js",f.miniCssF=e=>"static/css/008a05b0ad6b854a.css",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},f.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var a,c,i=document.getElementsByTagName("script"),d=0;d<i.length;d++){var l=i[d];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="_N_E:"+r){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,f.nc&&a.setAttribute("nonce",f.nc),a.setAttribute("data-webpack","_N_E:"+r),a.src=f.tu(e)),o[e]=[t];var s=(t,r)=>{a.onerror=a.onload=null,clearTimeout(u);var n=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach(e=>e(r)),t)return t(r)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)},f.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("nextjs#bundler",n))),n),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",a={8068:0},f.f.miniCss=(e,t)=>{if(a[e])t.push(a[e]);else 0!==a[e]&&({2554:1})[e]&&t.push(a[e]=new Promise((t,r)=>{var o=f.miniCssF(e),n=f.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),o=0;o<r.length;o++){var n=r[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===t))return n}for(var c=document.getElementsByTagName("style"),o=0;o<c.length;o++){var n=c[o],a=n.getAttribute("data-href");if(a===e||a===t)return n}})(o,n))return t();((e,t,r,o)=>{var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onerror=n.onload=a=>{if(n.onerror=n.onload=null,"load"===a.type)r();else{var c=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.href||t,d=Error("Loading CSS chunk "+e+" failed.\n("+i+")");d.code="CSS_CHUNK_LOAD_FAILED",d.type=c,d.request=i,n.parentNode.removeChild(n),o(d)}},n.href=t;if("function"==typeof _N_E_STYLE_LOAD){var a=n.href,c=n.onload,i=n.onerror;_N_E_STYLE_LOAD(0===a.indexOf(window.location.origin)?new URL(a).pathname:a).then(function(){c&&c.call(n,{type:"load"})},function(){i&&i.call(n,{})})}else document.head.appendChild(n)})(e,n,t,r)}).then(()=>{a[e]=0},t=>{throw delete a[e],t}))},c={8068:0,6525:0,186:0},f.f.j=(e,t)=>{var r=f.o(c,e)?c[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(186|2554|6525|8068)$/.test(e))c[e]=0;else{var o=new Promise((t,o)=>r=c[e]=[t,o]);t.push(r[2]=o);var n=f.p+f.u(e),a=Error();f.l(n,t=>{if(f.o(c,e)&&(0!==(r=c[e])&&(c[e]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,r[1](a)}},"chunk-"+e,e)}},f.O.j=e=>0===c[e],i=(e,t)=>{var r,o,[n,a,i]=t,d=0;if(n.some(e=>0!==c[e])){for(r in a)f.o(a,r)&&(f.m[r]=a[r]);if(i)var l=i(f)}for(e&&e(t);d<n.length;d++)o=n[d],f.o(c,o)&&c[o]&&c[o][0](),c[o]=0;return f.O(l)},(d=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),d.push=i.bind(null,d.push.bind(d))})();
1
+ (()=>{"use strict";var e,t,r,o,n,a,c,i,d,l={},s={};function f(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},o=!0;try{l[e].call(r.exports,r,r.exports,f),o=!1}finally{o&&delete s[e]}return r.exports}f.m=l,e=[],f.O=(t,r,o,n)=>{if(r){n=n||0;for(var a=e.length;a>0&&e[a-1][2]>n;a--)e[a]=e[a-1];e[a]=[r,o,n];return}for(var c=1/0,a=0;a<e.length;a++){for(var[r,o,n]=e[a],i=!0,d=0;d<r.length;d++)(!1&n||c>=n)&&Object.keys(f.O).every(e=>f.O[e](r[d]))?r.splice(d--,1):(i=!1,n<c&&(c=n));if(i){e.splice(a--,1);var l=o();void 0!==l&&(t=l)}}return t},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var n=Object.create(null);f.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var c=2&o&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach(t=>a[t]=()=>e[t]);return a.default=()=>e,f.d(n,a),n},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>7236===e?"static/chunks/7236-f1e0a36eb81c5151.js":5479===e?"static/chunks/5479-4214d11ddca13cd7.js":5334===e?"static/chunks/5334-4a80ee40870b70ae.js":1399===e?"static/chunks/1399-71db70ab3102530f.js":"static/chunks/"+(7418===e?"642b329c":e)+"."+({406:"7447d162fc1137ef",1049:"adc9916d5a6b95f8",1409:"9d9e122fbb02e985",1567:"380d58c42bf5620c",2673:"e645c662bafae6d3",2884:"d5538f4fb96995c4",3124:"945def356dab66f4",3245:"72bf2b81ee2bcca7",3257:"87d6a61b9e5f6a92",3386:"c9a6be6fd4e818a6",3657:"512c2a8e4d8a3378",5331:"049b1512362de1f4",5560:"8286d410d8bda0da",6474:"06effe2dc57f25fb",6676:"a4b23fc11d3037fd",6909:"38877fab8673c355",7418:"6470aa395ac1043a",8667:"b22b7da66acd945f",9078:"ea6aeb4af0c25e5d",9146:"cf59a3c6b6d8c735"})[e]+".js",f.miniCssF=e=>"static/css/008a05b0ad6b854a.css",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},f.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var a,c,i=document.getElementsByTagName("script"),d=0;d<i.length;d++){var l=i[d];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="_N_E:"+r){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,f.nc&&a.setAttribute("nonce",f.nc),a.setAttribute("data-webpack","_N_E:"+r),a.src=f.tu(e)),o[e]=[t];var s=(t,r)=>{a.onerror=a.onload=null,clearTimeout(u);var n=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach(e=>e(r)),t)return t(r)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)},f.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("nextjs#bundler",n))),n),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",a={8068:0},f.f.miniCss=(e,t)=>{if(a[e])t.push(a[e]);else 0!==a[e]&&({2554:1})[e]&&t.push(a[e]=new Promise((t,r)=>{var o=f.miniCssF(e),n=f.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),o=0;o<r.length;o++){var n=r[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===t))return n}for(var c=document.getElementsByTagName("style"),o=0;o<c.length;o++){var n=c[o],a=n.getAttribute("data-href");if(a===e||a===t)return n}})(o,n))return t();((e,t,r,o)=>{var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onerror=n.onload=a=>{if(n.onerror=n.onload=null,"load"===a.type)r();else{var c=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.href||t,d=Error("Loading CSS chunk "+e+" failed.\n("+i+")");d.code="CSS_CHUNK_LOAD_FAILED",d.type=c,d.request=i,n.parentNode.removeChild(n),o(d)}},n.href=t;if("function"==typeof _N_E_STYLE_LOAD){var a=n.href,c=n.onload,i=n.onerror;_N_E_STYLE_LOAD(0===a.indexOf(window.location.origin)?new URL(a).pathname:a).then(function(){c&&c.call(n,{type:"load"})},function(){i&&i.call(n,{})})}else document.head.appendChild(n)})(e,n,t,r)}).then(()=>{a[e]=0},t=>{throw delete a[e],t}))},c={8068:0,6525:0,186:0},f.f.j=(e,t)=>{var r=f.o(c,e)?c[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(186|2554|6525|8068)$/.test(e))c[e]=0;else{var o=new Promise((t,o)=>r=c[e]=[t,o]);t.push(r[2]=o);var n=f.p+f.u(e),a=Error();f.l(n,t=>{if(f.o(c,e)&&(0!==(r=c[e])&&(c[e]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,r[1](a)}},"chunk-"+e,e)}},f.O.j=e=>0===c[e],i=(e,t)=>{var r,o,[n,a,i]=t,d=0;if(n.some(e=>0!==c[e])){for(r in a)f.o(a,r)&&(f.m[r]=a[r]);if(i)var l=i(f)}for(e&&e(t);d<n.length;d++)o=n[d],f.o(c,o)&&c[o]&&c[o][0](),c[o]=0;return f.O(l)},(d=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),d.push=i.bind(null,d.push.bind(d))})();
package/app/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "vansrouter-app",
3
- "version": "0.9.96",
3
+ "version": "0.9.97",
4
4
  "description": "9Router web dashboard",
5
5
  "private": true,
6
+ "engines": {
7
+ "node": ">=22.5.0"
8
+ },
6
9
  "scripts": {
7
10
  "dev": "next dev --port 20127",
8
11
  "dev:webpack": "next dev --webpack --port 20127",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vansrouter",
3
- "version": "0.9.96",
4
- "description": "9Router CLI - Start and manage 9Router server",
3
+ "version": "0.9.97",
4
+ "description": "Vansrouter CLI - Start and manage Vansrouter server",
5
5
  "repository": "https://github.com/Vanszs/VansRouter",
6
6
  "bin": {
7
7
  "vansrouter": "./cli.js"
@@ -1 +0,0 @@
1
- "use strict";exports.id=3128,exports.ids=[3128],exports.modules={10747:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>r,DI:()=>m,IS:()=>g,JH:()=>l,Pd:()=>n,br:()=>k,fg:()=>j,gC:()=>q,gb:()=>p,jO:()=>x,js:()=>v,mq:()=>o,nJ:()=>h,rs:()=>t,wG:()=>u,wb:()=>w,zN:()=>i,zt:()=>s});var d=c(58857);let e=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],f=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),e))void 0!==a[c]&&(b[c]=a[c]);return{...{...a.display||{}},id:a.id,alias:a.uiAlias||a.alias,...a.aliases?{aliases:a.aliases}:{},...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{}}}(a)])),g=f("free"),h=f("freeTier"),i=f("oauth"),j=f("apikey"),k=f("webCookie"),l="openai-compatible-",m="anthropic-compatible-",n="custom-embedding-";function o(a){return"string"==typeof a&&a.startsWith(l)}function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}let r={...g,...h,...i,...j,...k};function s(a){for(let b of Object.values(r))if(b.alias===a||b.id===a||b.aliases?.includes(a))return b;return null}function t(a){let b=s(a);return b?.id||a}function u(a){let b=r[a];return b?.alias||a}let v=Object.values(r).reduce((a,b)=>{for(let c of(a[b.alias]=b.id,b.aliases||[]))a[c]=b.id;return a},{});Object.values(r).reduce((a,b)=>(a[b.id]=b.alias,a),{});let w=d.A.filter(a=>a.features?.usage).map(a=>a.id),x=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)}};