zevairouter 1.0.40 → 1.0.42

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 (309) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  32. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  33. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  40. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  41. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  42. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  43. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  45. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  48. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  49. package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  61. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  62. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  63. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  64. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  65. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  66. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  69. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  70. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  71. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  73. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  74. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  75. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  77. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  78. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  79. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  80. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  81. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  82. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  83. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  84. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  85. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  86. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  87. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  88. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  90. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  95. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  97. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  100. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  107. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  115. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  117. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  120. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  125. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  127. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  130. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  134. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  135. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  136. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  137. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  138. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  140. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  141. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  142. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  144. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  145. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  146. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  147. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  148. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  150. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  151. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  152. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  156. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  158. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  161. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  165. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  166. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  167. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  168. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  169. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  171. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  172. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  173. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  175. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  176. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  177. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  178. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  179. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  180. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  181. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  182. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  183. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  187. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  188. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  189. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  190. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  191. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  192. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  193. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  197. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  199. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  200. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  201. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  202. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  203. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  207. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  208. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  209. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  210. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  211. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  212. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  213. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  214. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  215. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  216. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  217. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  218. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  219. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  220. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  222. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  223. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  224. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  226. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  227. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  228. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  229. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  230. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  231. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  232. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  233. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  234. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  238. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  239. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  240. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  241. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  242. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  243. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  244. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  248. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  249. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  250. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  251. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  253. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  254. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  256. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  257. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  258. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  259. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  260. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  261. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  262. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  263. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  264. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  266. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  267. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  268. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  269. package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
  270. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  271. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  272. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  273. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  274. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  276. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  277. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  278. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  279. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  280. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  281. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  282. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  283. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  285. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  286. package/cli/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  287. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  288. package/cli/app/.next-cli-build/server/chunks/5681.js +1 -1
  289. package/cli/app/.next-cli-build/server/chunks/6896.js +1 -1
  290. package/cli/app/.next-cli-build/server/chunks/7153.js +1 -1
  291. package/cli/app/.next-cli-build/server/chunks/7276.js +1 -1
  292. package/cli/app/.next-cli-build/server/chunks/8242.js +2 -2
  293. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  294. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  295. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  296. package/cli/app/.next-cli-build/static/chunks/{1321-fe2fcab7940ae8d5.js → 1321-89d6a896f3dae03e.js} +1 -1
  297. package/cli/app/.next-cli-build/static/chunks/523-f867c3d02c72b48f.js +3 -0
  298. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-5c75e636ebf21297.js +1 -0
  299. package/cli/app/package.json +1 -1
  300. package/cli/package.json +1 -1
  301. package/package.json +1 -1
  302. package/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +17 -214
  303. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js +21 -1
  304. package/src/app/api/providers/client/route.js +11 -3
  305. package/src/shared/constants/providers.js +5 -1
  306. package/cli/app/.next-cli-build/static/chunks/523-9807fa9a0746de61.js +0 -3
  307. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-3b33a64814f8c670.js +0 -1
  308. /package/cli/app/.next-cli-build/static/{Fgc4vdsr6a_wWu8yVkotQ → WPP0ARz-9ieVVo7WDF86q}/_buildManifest.js +0 -0
  309. /package/cli/app/.next-cli-build/static/{Fgc4vdsr6a_wWu8yVkotQ → WPP0ARz-9ieVVo7WDF86q}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[523],{80523:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>b});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059),c=s(73006);let d=["zh-CN","zh-TW"],m=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];async function x(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async function u(...e){let t=e.filter(Boolean).map(x);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}let h=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],p=[{id:"lite",label:"Lite",desc:"Suggest lazier alternative"},{id:"full",label:"Full",desc:"Enforce the ladder, shortest diff"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, one-liner or bust"}];function b({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[v,k]=(0,l.useState)(!1),[w,N]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),[T,E]=(0,l.useState)(null),[P,_]=(0,l.useState)(!1),[$,A]=(0,l.useState)(!0),[O,U]=(0,l.useState)(!0),[I,D]=(0,l.useState)(!1),[F,L]=(0,l.useState)(!0),[R,W]=(0,l.useState)(!1),[q,K]=(0,l.useState)("full"),[z,J]=(0,l.useState)(!1),[M,H]=(0,l.useState)("full"),[B,Z]=(0,l.useState)("en"),[G,Q]=(0,l.useState)(!0),[Y,V]=(0,l.useState)(!1),[X,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(""),[en,er]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)(null),[em,ex]=(0,l.useState)(!1),[eu,eh]=(0,l.useState)(!1),[ep,eb]=(0,l.useState)(!1),[ey,ef]=(0,l.useState)(!1),[eg,ej]=(0,l.useState)(""),[ev,ek]=(0,l.useState)(!1),[ew,eN]=(0,l.useState)(""),[eC,eS]=(0,l.useState)(null),[eT,eE]=(0,l.useState)(""),[eP,e_]=(0,l.useState)(""),[e$,eA]=(0,l.useState)(null),[eO,eU]=(0,l.useState)(!1),[eI,eD]=(0,l.useState)([]),[eF,eL]=(0,l.useState)(""),[eR,eW]=(0,l.useState)(!1),[eq,eK]=(0,l.useState)(!1),[ez,eJ]=(0,l.useState)(!1),eM=(0,l.useRef)(null),eH=(0,l.useRef)(0),eB=(0,l.useRef)(0),eZ=(0,l.useRef)(!1),eG=(0,l.useRef)(!1),eQ=(0,l.useRef)(!1),eY=(0,l.useRef)(!1),[eV,eX]=(0,l.useState)(!1),[e0,e1]=(0,l.useState)(!1),[e5,e2]=(0,l.useState)(new Set),[e4,e3]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e3(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]),(0,l.useEffect)(()=>(Z((0,c.kk)()),(0,c.oQ)(()=>Z((0,c.kk)()))),[]);let e8=d.includes(B),e6=e8?h:h.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=h.find(e=>e.id===q);e?.wenyan&&!e8&&(K("ultra"),to({cavemanLevel:"ultra"}))},[e8,q]);let{copied:e7,copy:e9}=(0,o.C)(),te=!$||!O,tt=$?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{eM.current&&(eM.current.scrollTop=eM.current.scrollHeight)},[eI]),(0,l.useEffect)(()=>{tc(),tl()},[]),(0,l.useEffect)(()=>{if(!(Y||ep))return;let e=!Y||X,t=!ep||ey,s=()=>{document.hidden||ta()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||ta()},5e3);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[Y,ep,X,ey]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(Y&&(et||ea)){let e=await u(ea,et);eZ.current=e,e?(eH.current=0,ee(!0),eQ.current||(eQ.current=!0,eX(!0))):(eH.current+=1,eH.current>=5&&ee(!1))}else eZ.current=!1;if(ep&&eg){let e=await x(eg);eG.current=e,e?(eB.current=0,ef(!0),eY.current||(eY.current=!0,e1(!0))):(eB.current+=1,eB.current>=5&&ef(!1))}else eG.current=!1}};if(!(Y&&(et||ea)||ep&&eg))return;e();let t=!ep||ey;if((!Y||X)&&t)return;let s=setInterval(e,1e4);return()=>clearInterval(s)},[Y,et,ea,ep,eg,X,ey]);let ts=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=5&&a(!1))},[]),ta=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";es(a),el(t.tunnel?.publicUrl||""),V(s),ts(null,eZ,eH,ee,eQ,eX);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";ej(n),eb(l),ts(null,eG,eB,ef,eY,e1)}catch{}},tl=async()=>{Q(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();_(t.requireApiKey||!1),A(!1!==t.requireLogin),U(t.hasPassword||!1),D(t.tunnelDashboardAccess||!1),L(!1!==t.rtkEnabled),W(!!t.cavemanEnabled),K(t.cavemanLevel||"full"),J(!!t.ponytailEnabled),H(t.ponytailLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";es(a),el(e.tunnel?.publicUrl||""),V(s),ts(null,eZ,eH,ee,eQ,eX);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";ej(n),eb(l),ts(null,eG,eB,ef,eY,e1)}}catch(e){console.log("Error loading settings:",e)}finally{Q(!1)}},tn=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&D(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},tr=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&_(e)}catch(e){console.log("Error updating requireApiKey:",e)}},ti=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&L(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},to=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},tc=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},td=async(...e)=>{er(!0),eo("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<3e5;){if(await new Promise(e=>setTimeout(e,2e3)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return V(!0),er(!1),eo(""),!0;if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return ed({type:"error",message:"Tunnel process stopped unexpectedly."}),er(!1),eo(""),!1}}catch{}}return ed({type:"error",message:"Tunnel created but not reachable. Please try again."}),er(!1),eo(""),!1},tm=async()=>{ex(!1),er(!0),ed(null),eo("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?eo(`Downloading cloudflared... ${s.download.progress}%`):e&&eo("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void ed({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void ed({type:"error",message:"No tunnel URL returned"});es(a),el(s.publicUrl||""),await td(s.publicUrl,a)}catch(e){ed({type:"error",message:e.message})}finally{e=!1,er(!1),eo("")}},tx=async()=>{er(!0),ed(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(V(!1),es(""),eh(!1),ed({type:"success",message:"Tunnel disabled"})):ed({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){ed({type:"error",message:e.message})}finally{er(!1)}},tu=async()=>{eA(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return eA(t.installed),t}}catch{}return eA(!1),{installed:!1}},th=async()=>{eU(!0),eS(null),eD([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eF})});eL("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)eD(e=>[...e.slice(-50),a.message]);else if("done"===s){eA(!0),eU(!1),eK(!1),tf();return}else"error"===s&&eS({type:"error",message:a.error||"Install failed"})}}}catch(e){eS({type:"error",message:e.message})}finally{eU(!1)}},tp=async e=>{eN("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},tb=(e,t)=>{eE(e),e_(t)},ty=()=>{eE(""),e_("")},tf=async()=>{eK(!1),eW(!0),ek(!0),eS(null),eN("Connecting..."),ty();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){tb(t.authUrl,"Open Login Page"),eN('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){ty(),eN("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await tg(t.enableUrl):eS({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}ty(),eS({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await tg(t.enableUrl);eS({type:"error",message:t.error||"Failed to connect"})}catch(e){eS({type:"error",message:e.message})}finally{ek(!1),eW(!1),eN(""),ty()}},tg=async e=>{tb(e,"Open Funnel Settings"),eN('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ty(),ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){ty(),eS({type:"error",message:t.error});return}}catch{}}ty(),eS({type:"error",message:"Timed out waiting for Funnel to be enabled."})},tj=async()=>{ek(!0),eS(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(eb(!1),ej(""),eJ(!1),eS({type:"success",message:"Tailscale disabled"})):eS({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){eS({type:"error",message:e.message})}finally{ek(!1)}},tv=async()=>{eS(null),eD([]);let e=await tu();e?.installed&&e?.hasCachedPassword?tf():eK(!0)},tk=async()=>{if(w.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:w})}),t=await e.json();e.ok&&(S(t.key),await tc(),N(""),k(!1))}catch(e){console.log("Error creating key:",e)}},tw=async e=>{E({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{E(null);try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),e2(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}}})},tN=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[tC,tS]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{tS(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(y,{label:"Local",url:tC,copyId:"local_url",copied:e7,onCopy:e9}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${Y?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),Y&&!en&&X?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${ea||et}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e9(`${ea||et}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===e7?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eh(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Y||en||X?en?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ei||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{er(!1),eo("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ec?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ec.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ex(!0),children:"Enable"})]}):G?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>Q(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{te?ed({type:"error",message:`Security required: ${tt}`}):P?ex(!0):ed({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eV?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>eh(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ep?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ep&&!ev&&ey?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${eg}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e9(`${eg}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===e7?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ep||ev||ey?ev||eR?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ew||"Connecting..."]}),eT&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(eT,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:eP||"Open"}),(0,a.jsx)("button",{onClick:()=>{ek(!1),eW(!1),eN(""),ty()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eC?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eC.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:tv,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{te?eS({type:"error",message:`Security required: ${tt}`}):tv()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e0?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>eJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),te&&!Y&&!ep&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(j,{message:tt,action:{label:"Open settings",href:"/dashboard/profile"}})}),(Y||ep)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!P&&(0,a.jsx)(j,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!$||!O)&&(0,a.jsx)(j,{message:$?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:$?"Change password":"Enable",href:"/dashboard/profile"}})]}),(Y||ep)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:I,onChange:()=>tn(!I)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(g,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(i.lM,{checked:F,onChange:()=>ti(!F)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[R&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:e6.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;K(t=e.id),to({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)("p",{className:"text-xs text-primary",children:h.find(e=>e.id===q)?.desc})]}),(0,a.jsx)(i.lM,{checked:R,onChange:()=>{var e;W(e=!R),to({cavemanEnabled:e})}})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Lazy code style"," ",(0,a.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"YAGNI ladder → shortest diff, minimal code"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:p.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;H(t=e.id),to({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${M===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)("p",{className:"text-xs text-primary",children:p.find(e=>e.id===M)?.desc})]}),(0,a.jsx)(i.lM,{checked:z,onChange:()=>{var e;J(e=!z),to({ponytailEnabled:e})}})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>tr(!P)})]}),e4&&!P&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(j,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:e5.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void e2(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:e5.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e5.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>e9(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e7===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?E({title:"Pause API Key",message:`Pause API key "${e.name}"?
2
-
3
- This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{E(null),tN(e.id,t)}}):tN(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>tw(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:v,title:"Create API Key",onClose:()=>{k(!1),N("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:w,onChange:e=>N(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tk,fullWidth:!0,disabled:!w.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{k(!1),N("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!C,title:"API Key Created",onClose:()=>S(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:C||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===e7?"check":"content_copy",onClick:()=>e9(C,"created_key"),children:"created_key"===e7?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>S(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:em,title:"Enable Tunnel",onClose:()=>ex(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ZevaiRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:m.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tm,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>ex(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eu,title:"Disable Tunnel",onClose:()=>!en&&eh(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tx,fullWidth:!0,disabled:en,variant:"danger",children:en?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eh(!1),variant:"ghost",fullWidth:!0,disabled:en,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eq,title:"Tailscale Funnel",onClose:()=>{eO||(eK(!1),eL(""),eS(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===e$&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===e$&&!eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:th,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),eI.length>0&&(0,a.jsx)("div",{ref:eM,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:eI.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===e$&&!eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>tf(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eC&&(0,a.jsx)(f,{status:eC})]})}),(0,a.jsx)(i.aF,{isOpen:ez,title:"Disable Tailscale",onClose:()=>!ev&&eJ(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tj,fullWidth:!0,disabled:ev,variant:"danger",children:ev?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eJ(!1),variant:"ghost",fullWidth:!0,disabled:ev,children:"Cancel"})]})]})}),(0,a.jsx)(i.uo,{isOpen:!!T,onClose:()=>E(null),onConfirm:T?.onConfirm,title:T?.title||"Confirm",message:T?.message,variant:"danger"})]})}function y({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function f({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function g({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function j({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}b.propTypes={machineId:r().string.isRequired}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{5498:(e,t,a)=>{Promise.resolve().then(a.bind(a,75095)),Promise.resolve().then(a.bind(a,25086))},75095:(e,t,a)=>{"use strict";a.d(t,{default:()=>A});var r=a(95155),s=a(12115),l=a(57250),n=a(42793);function i(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function o(e,t){if(!t||"object"!=typeof t)return[];let a=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.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])=>{a.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])=>{a.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])=>{a.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))&&a.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"autoclaw":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:"points"===e?"Points":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?a.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let r=(0,n.KC)(e);if(r.length>0){let e=new Map(r.map((e,t)=>[e.id,t]));a.sort((t,a)=>{let r=t.modelKey||t.name,s=a.modelKey||a.name;return(e.get(r)??999)-(e.get(s)??999)})}return a}function c({quotas:e=[],compact:t=!1,sortMode:a="default",showSortLabel:l=!1}){let[n,o]=(0,s.useState)(1),d=(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):i(e?.used,e?.total)})),[e]),u=(0,s.useMemo)(()=>"remaining-asc"===a?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===a?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,a]),m=Math.max(1,Math.ceil(u.length/10));if((0,s.useEffect)(()=>{o(1)},[a,e]),(0,s.useEffect)(()=>{o(e=>Math.min(e,m))},[m]),!e||0===e.length)return null;let x=u.slice((n-1)*10,10*n),h=0===u.length?0:(n-1)*10+1,b=Math.min(10*n,u.length),p=t?"py-1 px-1.5":"py-2 px-3",g=t?"text-[11px]":"text-sm",f=t?"text-[11px]":"text-sm",v=t?"text-[10px] leading-tight":"text-xs";return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"text-[10px] text-text-muted",children:[u.length," quota",u.length>1?"s":""]}),l&&(0,r.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,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsx)("table",{className:"w-full table-fixed text-left",children:(0,r.jsx)("tbody",{children:x.map(e=>{var a;let s=(a=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:a>=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"},l=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,a=new Date,r=t-a;if(r<=0)return"-";let s=Math.ceil(r/6e4);if(s<60)return`${s}m`;let l=Math.floor(s/60),n=s%60;if(l<24)return`${l}h ${n}m`;let i=Math.floor(l/24);return`${i}d ${l%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),n=function(e){if(!e)return null;try{let t=new Date(e),a=new Date,r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(r);s.setDate(s.getDate()+1);let l="";l=t>=r&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${l}, ${n}`}catch{return null}}(e.resetAt);return(0,r.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,r.jsx)("td",{className:`${p} w-[30%]`,children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,r.jsx)("span",{className:`${g} font-medium text-text-primary truncate`,children:e.name})]})}),(0,r.jsx)("td",{className:`${p} w-[45%]`,children:(0,r.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,r.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,r.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,r.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,r.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,r.jsx)("td",{className:`${p} w-[25%]`,children:"-"!==l||n?t?(0,r.jsx)("div",{className:`${f} text-text-primary font-medium truncate`,title:n||"",children:"-"!==l?`in ${l}`:n}):(0,r.jsxs)("div",{className:"space-y-0.5",children:["-"!==l&&(0,r.jsxs)("div",{className:`${f} text-text-primary font-medium`,children:["in ",l]}),n&&(0,r.jsx)("div",{className:`${v} text-text-muted`,children:n})]}):(0,r.jsx)("div",{className:`${f} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),m>1&&(0,r.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,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,r.jsxs)("span",{children:["Showing ",h,"-",b," of ",u.length]}),(0,r.jsxs)("span",{children:["Page ",n," / ",m]})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===n,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,r.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(m,e+1)),disabled:n===m,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 d=a(98542),u=a(84588),m=a(35497),x=a(52679);function h(e){let t=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);return t(e.email)?e.email:(t(e.name),e.name)}function b(e,t){let a=t[e.id]?.quotas?.[0];return a&&"number"==typeof a.remaining?a.remaining:1/0}function p(e){return x.Q2[e]?.name||e}function g(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function f(e,t){let a=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>a.has(e)))}async function v(e,t){return await e(t)}let y="quotaCacheData";function k(){try{let e=window.localStorage.getItem(y);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function w(e,t){try{let a=k();a[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(y,JSON.stringify(a))}catch(e){console.error("Error writing quota cache:",e)}}let j="quotaAutoRefresh",N=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],S=[{value:"single",label:"Satuan",icon:"account_circle"},{value:"bulk",label:"Bulk",icon:"stacks"}],C=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}],$=[10,20,50,100];function A(){let[e,t]=(0,s.useState)([]),[a,n]=(0,s.useState)({}),[A,q]=(0,s.useState)({}),[E,P]=(0,s.useState)({}),[M,D]=(0,s.useState)(!0),[I,O]=(0,s.useState)(null),[T,L]=(0,s.useState)(!1),[_,z]=(0,s.useState)(!1),[F,U]=(0,s.useState)(60),[R,J]=(0,s.useState)(!0),[K,B]=(0,s.useState)(null),[Q,W]=(0,s.useState)(null),[G,H]=(0,s.useState)(!1),[Y,V]=(0,s.useState)(null),[X,Z]=(0,s.useState)([]),[ee,et]=(0,s.useState)("all"),[ea,er]=(0,s.useState)([]),[es,el]=(0,s.useState)("single"),[en,ei]=(0,s.useState)("all"),[eo,ec]=(0,s.useState)("default"),[ed,eu]=(0,s.useState)(!1),[em,ex]=(0,s.useState)(!1),[eh,eb]=(0,s.useState)(!1),[ep,eg]=(0,s.useState)({}),[ef,ev]=(0,s.useState)({}),[ey,ek]=(0,s.useState)(1),[ew,ej]=(0,s.useState)(20),[eN,eS]=(0,s.useState)(String(20)),[eC,e$]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eA,eq]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eE=(0,s.useRef)(null),eP=(0,s.useRef)(null),eM=(0,s.useCallback)(async(e=ey)=>{try{var a,r;let s=new URLSearchParams({page:String(e),pageSize:String(ew),accountStatus:en,sort:"priority"});"all"!==ee&&s.set("provider",ee);let l=await fetch(`/api/providers/client?${s.toString()}`);if(!l.ok)throw Error("Failed to fetch connections");let n=await l.json(),i=n.connections||[],o=(a=n.pagination,a||{page:1,pageSize:ew,total:0,totalPages:1}),c=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(n.totals,i.length);return t(i),er(n.providerOptions||[]),e$(o),eq(c),ek((r=n.pagination,r?.page||e)),i}catch(e){return console.error("Error fetching connections:",e),t([]),er([]),e$({page:1,pageSize:ew,total:0,totalPages:1}),eq({eligibleConnections:0,providerFilteredConnections:0}),[]}},[en,ey,ew,ee]),eD=(0,s.useCallback)(async(e,t,a=!1)=>{q(t=>({...t,[e]:!0})),P(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}${a?"?refresh=1":""}`);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};n(t=>({...t,[e]:r})),w(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let s=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:o(t,s),plan:s.plan||null,message:s.message||null,raw:s};n(t=>({...t,[e]:l})),w(e,l)}catch(a){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,a),P(t=>({...t,[e]:a.message||"Failed to fetch quota"}))}finally{q(t=>({...t,[e]:!1}))}},[]),eI=(0,s.useCallback)(async(e,t)=>{await eD(e,t),O(new Date)},[eD]),eO=(0,s.useCallback)(async(e,t=!1)=>{if(e&&"all"!==e){ev(t=>({...t,[e]:!0}));try{let a=`/api/usage/aggregate?provider=${encodeURIComponent(e)}${t?"&refresh=1":""}`,r=await fetch(a);if(!r.ok)throw Error("Failed to fetch aggregate");let s=await r.json(),l=o(e,s);eg(t=>({...t,[e]:{quotas:l,plan:s.plan||null,accountCount:s.accountCount||0,accountsWithQuota:s.accountsWithQuota||0,deadCount:s.deadCount||0}}))}catch(t){console.error(`[ProviderLimits] Aggregate fetch error for ${e}:`,t)}finally{ev(t=>({...t,[e]:!1}))}}},[]),eT=(0,s.useCallback)(async(e,t)=>{if("bulk"===es&&t){await eO(t,!0),O(new Date);return}e?.length&&(q(t=>({...t,...Object.fromEntries(e.map(e=>[e,!0]))})),await Promise.all(e.map(e=>eD(e,t))),O(new Date))},[eD,es,eO]),eL=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){B(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){n(t=>{let a={...t};return delete a[e],a}),q(t=>{let a={...t};return delete a[e],a}),P(t=>{let a={...t};return delete a[e],a});try{let t=k();t[e]&&(delete t[e],window.localStorage.setItem(y,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await v(eM,ey)}}catch(e){console.error("Error deleting connection:",e)}finally{B(null)}}},[eM,ey]),e_=(0,s.useCallback)(async(e,t)=>{W(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(n(e=>({...e})),await v(eM,ey))}catch(e){console.error("Error updating connection status:",e)}finally{W(null)}},[eM,ey]),ez=(0,s.useCallback)(async e=>{if(!Y?.id)return;let t=Y.id,a=Y.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eM(),H(!1),V(null),x.wb.includes(a)&&await eD(t,a))}catch(e){console.error("Error saving connection:",e)}},[Y,eM,eD]);(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&&Z(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let eF=(0,s.useCallback)(async()=>{if(!_){z(!0),U(60);try{let e=await eM(ey);q(g(e)),P(t=>f(t,e)),n(t=>f(t,e)),await Promise.all(e.map(e=>eD(e.id,e.provider,!0))),"bulk"===es&&("all"!==ee?[ee]:ea.map(e=>e.value||e).filter(e=>"all"!==e)).forEach(e=>eO(e,!0)),O(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{z(!1)}}},[_,eM,eD,ey,es,ee,ea,eO]);(0,s.useEffect)(()=>{(async()=>{J(!0);let e=await eM(ey);J(!1),q(g(e)),P(t=>f(t,e)),n(t=>f(t,e)),await Promise.all(e.map(e=>eD(e.id,e.provider))),O(new Date)})()},[eM,eD,ey]),(0,s.useEffect)(()=>{"bulk"!==es||("all"!==ee?[ee]:ea.map(e=>e.value||e).filter(e=>"all"!==e)).forEach(e=>eO(e))},[es,ee,ea,eO]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(j);D(null===e||"true"===e),L(!0)},[]),(0,s.useEffect)(()=>{T&&window.localStorage.setItem(j,String(M))},[M,T]),(0,s.useEffect)(()=>{if(!T||!M){eE.current&&(clearInterval(eE.current),eE.current=null),eP.current&&(clearInterval(eP.current),eP.current=null);return}return eE.current=setInterval(()=>{eF()},6e4),eP.current=setInterval(()=>{U(e=>e<=1?60:e-1)},1e3),()=>{eE.current&&clearInterval(eE.current),eP.current&&clearInterval(eP.current)}},[M,eF,T]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eE.current&&(clearInterval(eE.current),eE.current=null),eP.current&&(clearInterval(eP.current),eP.current=null)):M&&T&&(eE.current=setInterval(eF,6e4),eP.current=setInterval(()=>{U(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[M,eF,T]);let eU=(0,s.useMemo)(()=>(function(e,t,a,r,s){if("codex"===r&&"default"!==s)return[...e].sort((e,a)=>{let r=b(e,t),l=b(a,t),n="remaining-asc"===s?r-l:l-r;return 0!==n?n:(h(e)||"").localeCompare(h(a)||"")});if(!a)return e;let l=e=>{let a=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return a.length>0?Math.min(...a):1/0};return[...e].sort((e,t)=>{let a=l(e)-l(t);return 0!==a?a:(e.provider||"").localeCompare(t.provider||"")||(h(e)||"").localeCompare(h(t)||"")})})(e,a,ed,ee,eo),[e,a,ed,ee,eo]),eR=(0,s.useMemo)(()=>{let e;return e=new Map,eU.forEach(t=>{t.provider&&(e.has(t.provider)||e.set(t.provider,[]),e.get(t.provider).push(t))}),[...e.entries()].map(([e,t])=>(function(e,t,a,r,s){if(!t.length)return null;let l=[],n=[],i=null,o=!1;return t.forEach(e=>{let t=a[e.id];Array.isArray(t?.quotas)&&l.push(...t.quotas),t?.message&&!i&&(i=t.message),s[e.id]&&n.push(s[e.id]),r[e.id]&&(o=!0)}),{id:`${e}-aggregate`,provider:e,name:p(e),email:`${t.length} accounts`,isActive:t.some(e=>e.isActive??!0),isAggregate:!0,quota:{quotas:function(e=[]){let t=new Map;return e.forEach(e=>{if(!e?.name)return;let a=t.get(e.name)||{name:e.name,used:0,total:0,resetAt:e.resetAt||null};a.used+=Number(e.used)||0,a.total+=Number(e.total)||0,e.resetAt&&(!a.resetAt||new Date(e.resetAt).getTime()<new Date(a.resetAt).getTime())&&(a.resetAt=e.resetAt),t.set(e.name,a)}),[...t.values()]}(l),message:0===l.length&&i||null},isLoading:o,error:!l.length&&n.length>0?n[0]:null,connectionIds:t.map(e=>e.id)}})(e,t,a,A,E)).filter(Boolean)},[eU,a,A,E]),eJ=(0,s.useMemo)(()=>Object.keys(ep).length?eR.map(e=>{let t=ep[e.provider];return t&&t.quotas?.length?{...e,email:`${t.accountCount||e.connectionIds?.length||0} accounts`,quota:{...e.quota,quotas:t.quotas,message:null},isLoading:ef[e.provider]||!1}:e}):eR,[eR,ep,ef]),eK=(0,s.useMemo)(()=>"bulk"===es?eJ:eU,[es,eJ,eU]),eB=e=>{let t=a[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=i(e.used,e.total))},eQ=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eh){eb(!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 v(eM,ey)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eb(!1)}}},[eh,eM,ey]),eW="all"===ee?"All providers":ee,eG=eA.eligibleConnections>0,eH=eK.length>0,eY=eA.eligibleConnections?eA.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"===ee?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===en?"turned off":"active"===en?"active":"matching"} accounts found for ${ee}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},eV=function(e){var t;let{start:a,end:r}=(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 ${a}-${r} of ${e.total}`}(eC),eX=!$.includes(ew);return R||eG?R||eH?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>ex(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":em,title:"Filter quota providers",children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ee?(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,r.jsx)(l.A,{src:`/providers/${ee}.png`,alt:ee,size:18,className:"size-[18px] rounded object-contain",fallbackText:ee.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:eW})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),em&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>ex(!1)}),(0,r.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{"all"!==ee&&ek(1),et("all"),ex(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ee?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,r.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ee&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,r.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,r.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ea.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{ee!==e&&ek(1),et(e),ex(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ee===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)(l.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"font-medium capitalize",children:e}),ee===e&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,r.jsx)("div",{className:"inline-flex h-8 overflow-hidden rounded-lg border border-black/10 bg-black/[0.02] dark:border-white/10 dark:bg-white/[0.03]",children:S.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>el(e.value),"aria-pressed":es===e.value,className:`flex h-full items-center gap-1.5 px-2 text-xs transition-colors ${es===e.value?"bg-primary text-white":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,title:`Show quota in ${e.label} mode`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.value))}),(0,r.jsx)("select",{value:en,onChange:e=>{let t=e.target.value;en!==t&&ek(1),ei(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:N.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ee&&(0,r.jsx)("select",{value:eo,onChange:e=>ec(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:C.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,r.jsxs)("button",{type:"button",onClick:()=>eu(e=>!e),"aria-pressed":ed,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${ed?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{eQ(eU.filter(e=>(e.isActive??!0)&&eB(e)).map(e=>e.id),!1)},disabled:eh,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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{eQ(eU.filter(e=>!(e.isActive??!0)&&!eB(e)).map(e=>e.id),!0)},disabled:eh,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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,r.jsxs)("button",{onClick:()=>D(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:M?"Disable auto-refresh":"Enable auto-refresh",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${M?"text-primary":"text-text-muted"}`,children:M?"toggle_on":"toggle_off"}),(0,r.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),M&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",F,"s)"]})]}),(0,r.jsx)("button",{type:"button",onClick:eF,disabled:_,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,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${_?"animate-spin":""}`,children:"refresh"})})]})}),ed&&(0,r.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,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eK.map(e=>{let t=!0===e.isAggregate,s=t?e.quota:a[e.id],n=t?e.isLoading:A[e.id],i=t?e.error:E[e.id],o=!1===e.isActive,m=!t&&(K===e.id||Q===e.id);return(0,r.jsxs)(u.default,{padding:"none",className:`min-w-0 ${o?"opacity-60":""}`,children:[(0,r.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,r.jsx)(l.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:32,className:"object-contain",fallbackText:e.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:e.name||p(e.provider)}),h(e)?(0,r.jsx)("p",{className:"text-xs text-text-muted truncate",children:h(e)}):null]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{type:"button",onClick:()=>t?eT(e.connectionIds,e.provider):eI(e.id,e.provider),disabled:n||m,"aria-label":"Refresh quota",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",title:"Refresh quota",children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${n?"animate-spin":""}`,children:"refresh"})}),!t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>{V(e),H(!0)},disabled:m,"aria-label":"Edit connection",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",title:"Edit connection",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,r.jsx)("button",{type:"button",onClick:()=>eL(e.id),disabled:m,"aria-label":"Delete connection",className:"p-1.5 rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",title:"Delete connection",children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] ${K===e.id?"animate-pulse":""}`,children:"delete"})}),(0,r.jsx)("div",{className:"inline-flex items-center pl-0.5",title:e.isActive??!0?"Disable connection":"Enable connection",children:(0,r.jsx)(d.default,{size:"sm",checked:e.isActive??!0,disabled:m,onChange:t=>e_(e.id,t)})})]})]})]})}),(0,r.jsx)("div",{className:"px-2 py-1.5",children:n?(0,r.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):i?(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:i})]}):s?.message?(0,r.jsx)("div",{className:"text-center py-5",children:(0,r.jsx)("p",{className:"text-xs text-text-muted",children:s.message})}):(0,r.jsx)(c,{quotas:s?.quotas,compact:!0,sortMode:"default",showSortLabel:"codex"===e.provider&&"default"!==eo})})]},e.id)})}),(0,r.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,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted",children:eV}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)("select",{value:eX?"custom":String(ew),onChange:e=>{let t=e.target.value;if("custom"===t)return;let a=Number.parseInt(t,10);Number.isFinite(a)&&(ek(1),ej(a),eS(String(a)))},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:[$.map(e=>(0,r.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,r.jsx)("option",{value:"custom",children:"Custom"})]}),(0,r.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eN,onChange:e=>eS(e.target.value),onBlur:()=>{let e=Number.parseInt(eN,10);if(!Number.isFinite(e))return void eS(String(ew));let t=Math.min(500,Math.max(1,e));ek(1),ej(t),eS(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eN,10);if(!Number.isFinite(t))return void eS(String(ew));let a=Math.min(500,Math.max(1,t));ek(1),ej(a),eS(String(a))},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,r.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eC.page," / ",eC.totalPages]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>ek(1),disabled:eC.page<=1||R||_,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,r.jsx)("button",{type:"button",onClick:()=>ek(e=>Math.max(1,e-1)),disabled:eC.page<=1||R||_,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,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(e=>Math.min(eC.totalPages,e+1)),disabled:eC.page>=eC.totalPages||R||_,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,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(eC.totalPages),disabled:eC.page>=eC.totalPages||R||_,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,r.jsx)(m.wI,{isOpen:G,connection:Y,proxyPools:X,onSave:ez,onClose:()=>{H(!1),V(null)}})]}):(0,r.jsx)(u.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:eY.icon}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:eY.title}),(0,r.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:eY.description})]})}):(0,r.jsx)(u.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,r.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,[2574,3862,4343,1321,5497,8441,3794,7358],()=>e(e.s=5498)),_N_E=e.O()}]);