@rabbi696/ezrouter 0.5.70 → 0.5.71

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 (313) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +20 -20
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  42. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  43. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  44. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  46. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  50. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  51. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  52. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  53. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  54. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/callback.html +1 -1
  56. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  57. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  58. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  60. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  61. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  62. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  64. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  65. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  66. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  69. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  70. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  72. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  74. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  75. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  76. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  78. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  79. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  80. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  82. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  84. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  85. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  86. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  89. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  90. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  92. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  94. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
  95. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  96. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  99. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
  100. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
  102. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  104. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  105. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  106. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  108. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  109. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  110. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  112. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  114. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  115. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  116. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  117. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  118. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  119. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  120. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  121. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  122. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  123. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  124. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  125. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  126. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  127. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  128. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  129. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  130. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  131. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  132. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  133. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  134. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  135. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  136. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  137. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  139. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  140. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  141. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  142. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  143. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  144. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  145. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  146. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  147. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  149. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  150. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  151. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  152. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  153. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  154. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  155. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  156. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  157. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  158. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  160. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  161. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  162. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  163. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  164. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  166. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  167. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  168. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  169. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  170. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  171. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  172. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  173. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  174. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  175. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  176. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  177. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  178. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  181. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  182. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  183. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  184. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  186. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  187. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  188. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  191. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  192. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  193. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  194. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  198. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  201. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
  202. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  203. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
  204. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  207. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  208. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  209. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  211. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  212. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  213. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  217. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  218. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  219. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  222. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  223. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  225. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  226. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  227. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  228. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  229. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  232. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  233. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  235. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  238. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  239. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  240. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  242. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  243. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  244. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  245. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  248. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  249. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  252. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  253. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  254. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  255. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  257. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  258. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  259. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  261. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  262. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  264. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/index.html +1 -1
  266. package/app/.next-cli-build/server/app/index.rsc +3 -3
  267. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  268. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  269. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  271. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  273. package/app/.next-cli-build/server/app/landing.html +1 -1
  274. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  275. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  276. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  278. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  282. package/app/.next-cli-build/server/app/login.html +1 -1
  283. package/app/.next-cli-build/server/app/login.rsc +4 -4
  284. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  285. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  287. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  291. package/app/.next-cli-build/server/app-paths-manifest.json +20 -20
  292. package/app/.next-cli-build/server/chunks/412.js +1 -1
  293. package/app/.next-cli-build/server/chunks/4843.js +1 -1
  294. package/app/.next-cli-build/server/chunks/5767.js +1 -1
  295. package/app/.next-cli-build/server/chunks/7591.js +1 -1
  296. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  297. package/app/.next-cli-build/server/chunks/7889.js +1 -1
  298. package/app/.next-cli-build/server/chunks/8327.js +1 -1
  299. package/app/.next-cli-build/server/chunks/921.js +1 -1
  300. package/app/.next-cli-build/server/chunks/9212.js +1 -1
  301. package/app/.next-cli-build/server/chunks/9356.js +1 -1
  302. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  303. package/app/.next-cli-build/server/pages/404.html +1 -1
  304. package/app/.next-cli-build/server/pages/500.html +1 -1
  305. package/app/.next-cli-build/static/chunks/{1321-4b48f17a80bec5f8.js → 1321-075e69c1029a3be9.js} +1 -1
  306. package/app/.next-cli-build/static/chunks/{5497-93fc7728cdff1521.js → 5497-b8180f32d8b8d12d.js} +1 -1
  307. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-b5741659c03ca56b.js → page-f767dcc53bb237c6.js} +1 -1
  308. package/app/CHANGELOG.md +4 -2
  309. package/app/package.json +1 -1
  310. package/app/public/CHANGELOG.md +4 -2
  311. package/package.json +1 -1
  312. /package/app/.next-cli-build/static/{fknUITWVchqgRb_BVyv28 → SMVZ1Q84_Ws1e4PoYXFub}/_buildManifest.js +0 -0
  313. /package/app/.next-cli-build/static/{fknUITWVchqgRb_BVyv28 → SMVZ1Q84_Ws1e4PoYXFub}/_ssgManifest.js +0 -0
@@ -11,4 +11,4 @@ pt-only-auto-named`:q,[G,V]=(0,s.useState)("single"),[Q,Z]=(0,s.useState)(""),[Y
11
11
  "idToken": "eyJhbGc...",
12
12
  "email": "user@example.com"
13
13
  }
14
- ]`;function B({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,s.useState)(""),[n,o]=(0,s.useState)(!1),[d,m]=(0,s.useState)(""),[p,u]=(0,s.useState)(null),x=()=>{n||(r(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let s=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!s||0===s.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:s})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:H,value:l,onChange:e=>r(e.target.value),disabled:n}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,N.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,N.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}B.propTypes={isOpen:$().bool.isRequired,onClose:$().func.isRequired,onSuccess:$().func};let W={claude:"claudeAutoPing",codex:"codexAutoPing"},G=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function V(){let e,t=(0,l.useParams)(),a=(0,l.useRouter)(),r=t.id,{getCaps:u}=(0,k.y)(),[x,h]=(0,s.useState)([]),[f,g]=(0,s.useState)(1),[y,b]=(0,s.useState)(10),[v,C]=(0,s.useState)(!0),[T,$]=(0,s.useState)(null),[I,E]=(0,s.useState)([]),[R,D]=(0,s.useState)(!1),[_,q]=(0,s.useState)(!1),[M,K]=(0,s.useState)(!1),[L,H]=(0,s.useState)(""),[V,Q]=(0,s.useState)(!1),[Z,Y]=(0,s.useState)(!1),[X,ee]=(0,s.useState)(!1),[et,ea]=(0,s.useState)(!1),[ei,es]=(0,s.useState)(null),[el,er]=(0,s.useState)({}),[en,eo]=(0,s.useState)([]),[ed,ec]=(0,s.useState)(!1),[em,ep]=(0,s.useState)({}),[eu,ex]=(0,s.useState)(""),[eh,ef]=(0,s.useState)(()=>new Set),[eg,ey]=(0,s.useState)(!1),[eb,ev]=(0,s.useState)([]),[ej,ew]=(0,s.useState)("__none__"),[ek,eN]=(0,s.useState)(!1),[eC,eS]=(0,s.useState)(null),[eA,eT]=(0,s.useState)(""),[e$,eP]=(0,s.useState)("auto"),[eI,eO]=(0,s.useState)("auto"),[eE,eR]=(0,s.useState)(""),[eD,e_]=(0,s.useState)({enabled:!1,connections:{}}),[eU,eq]=(0,s.useState)([]),[ez,eM]=(0,s.useState)([]),[eK,eL]=(0,s.useState)([]),[eF,eJ]=(0,s.useState)([]),[eH,eB]=(0,s.useState)(null),[eW,eG]=(0,s.useState)(!1),[eV,eQ]=(0,s.useState)(!1),[eZ,eY]=(0,s.useState)(!1),[eX,e0]=(0,s.useState)(null),[e1,e2]=(0,s.useState)({}),[e5,e3]=(0,s.useState)(null),e4=(0,s.useRef)(!1),[e6,e8]=(0,s.useState)(!1),{copied:e7,copy:e9}=(0,w.C)(),te="ag_risk_confirmed",tt=()=>{D(!0)},ta=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(te)?eG(!0):tn?tt():(H(""),K(!0))},ti=()=>{H(""),K(!0)},ts=()=>{tn?ta():ti()},tl=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r]||m.br[r],tr=tl?.authModes||[],tn=!!m.zN[r]||!!m.IS[r]||tr.includes("oauth"),to=!!m.fg[r]||tr.includes("apikey"),td=!!m.IS[r]?.noAuth,tc=(0,p.KC)(r),tm="cursor"===r&&ez.length>0?ez:tc,tp=(0,m.wG)(r),tu=(0,m.mq)(r),tx=(0,m.gb)(r),th=tu||tx,tf=!th&&tn&&to,tg="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"OAuth",ty="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"API Key",tb=e=>{if(!e$||"auto"===e$)return null;let t=j(r,e);return t&&t.includes(e$)?e$:null},tv=th?r:tp,tj=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let i=j(r,a);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tm)a(e.id);for(let e of eK)a(e.id);for(let e of en)e.providerAlias===tv&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),tw=th?T?.prefix||r:tp,tk=(0,s.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}`,{cache:"no-store"}),t=await e.json();e.ok&&eJ(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tv]),tN=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tv,ids:[e]})})).ok&&await tk()}catch(e){console.log("Error disabling model:",e)}},tC=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tk()}catch(e){console.log("Error enabling model:",e)}},tS=async e=>{e.length&&eB({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eB(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tv,ids:e})})).ok&&await tk()}catch(e){console.log("Error disabling all models:",e)}}})},tA=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}`,{method:"DELETE"})).ok&&await tk()}catch(e){console.log("Error enabling all models:",e)}},tT=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&er(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t$=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eo(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,s.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eL(e.models)}).catch(()=>{})},[r]);let tP=(0,s.useCallback)(async()=>{try{let[e,t,a,i]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(r)}`,{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),s=await e.json(),l=await t.json(),n=await a.json(),o=i.ok?await i.json():{};e.ok&&h(s.connections||[]),a.ok&&E(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};eS(d.fallbackStrategy||null),eT(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};eP(c.mode||"auto");let m=(o.retryDelayByProvider||{})[r];eO(null!=m&&"auto"!==m?String(m):"auto");let p=(o.rpmByProvider||{})[r];eR(null!=p?String(p):"");let u=W[r],x=u&&o[u]||{};if(e_({enabled:!0===x.enabled,connections:x.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&th)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[r,th]),tI=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&($(a.node),await tP(),ee(!1))}catch(e){console.log("Error updating provider node:",e)}},tO=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),i=(a.ok?await a.json():{}).providerStrategies||{},s={};e&&(s.fallbackStrategy=e),"round-robin"===e&&""!==t&&(s.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(s).length?delete l[r]:l[r]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tE=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[r]={mode:e}:delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tR=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?a[r]=Number(e):delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:a})})}catch(e){console.log("Error saving retry delay:",e)}},tD=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).rpmByProvider||{}},i=String(e??"").trim();""===i?delete a[r]:a[r]=Math.max(0,Number(i)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:a})})}catch(e){console.log("Error saving RPM limit:",e)}},t_=async e=>{let t=W[r];if(t){e_(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,s.useEffect)(()=>{tP(),tT(),t$(),tk()},[tP,tT,t$,tk]),(0,s.useEffect)(()=>{if("cursor"!==r)return void eM([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void eM([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eM(a.models)}).catch(()=>{}),()=>{t=!0}},[r,x]),(0,s.useEffect)(()=>{let e=(m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r])?.modelsFetcher;e&&S(e).then(eq)},[r]);let tU=async(e,t,a=tp)=>{let i=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tT();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tq=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error deleting alias:",e)}},tz=async(e,t="llm",a=tv)=>{try{let i=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(i.ok)await t$(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await i.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tM=async(e,t="llm",a=tv)=>{try{let i=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await t$(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tK=async()=>{if(e6)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Qoder connection first"));e8(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,N.Tl)("Failed to fetch models"));let i=a.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let s=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");en.some(e=>e.providerAlias===tv&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(el).includes(`${tv}/${a}`)||(await tz(a,"llm",tv),s+=1)}0===s?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${s} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{e8(!1)}},tL=async()=>{if(eV||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));e4.current=!1,eQ(!0),eY(!1),e0(null),e2(e),e3({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<x.length;e+=1){if(e4.current){e3({total:x.length,completed:e,passed:t,failed:a,stopped:!0});break}let i=x[e];e0(i.id),e2(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),s=await e.json(),l=!!s.valid;l?t+=1:a+=1,e2(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:s.error||null}}))}catch(e){a+=1,e2(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e3({total:x.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e0(null),eQ(!1),eY(!1),e4.current=!1}},tF=async e=>{eB({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eB(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tJ=()=>{tP(),D(!1)},tH=async e=>{H("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tP(),K(!1);return}H(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),H("Failed to save connection")}},tB=async e=>{try{(await fetch(`/api/providers/${ei.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tP(),Y(!1))}catch(e){console.log("Error updating connection:",e)}},tW=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tG=async(e,t)=>{let a=[...x];[a[e],a[t]]=[a[t],a[e]],h(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tP()}},tV=x.filter(e=>eb.includes(e.id));(0,s.useEffect)(()=>{ev(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tV.length)return;let e=new Set(tV.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=I.find(e=>e.id===t);return a?.name}})();let tQ=()=>{ek||ea(!1)},tZ=async e=>{eN(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tP(),ea(!1)}finally{eN(!1)}},tY=e=>tZ(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:tX,items:t0,start:t1}=function(e=[],t=1,a=10){let i=Array.isArray(e)?e:[],s=Number.isFinite(a)&&a>=1?Math.floor(a):10,l=i.length,r=Math.max(1,Math.ceil(l/s)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,r),d=(o-1)*s,c=i.slice(d,d+s);return{currentPage:o,totalPages:r,totalItems:l,start:d,items:c,pageSize:s}}(x,f,y),t2=new Set(t0.map(e=>e.id)),t5=t0.length>0&&t0.every(e=>eb.includes(e.id)),t3=(0,i.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[t0.map((e,t)=>{let a,s=t1+t;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(a=e.id,eb.includes(a)),onChange:()=>{var t;return t=e.id,void ev(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(U,{connection:e,proxyPools:I,isOAuth:tn,isFirst:0===s,isLast:s===x.length-1,onMoveUp:()=>tG(s,s-1),onMoveDown:()=>tG(s,s+1),onToggleActive:t=>tW(e.id,t),autoPing:W[r]&&"oauth"===e.authType?{on:!0===eD.connections[e.id],onToggle:t=>{var a;return a=e.id,void t_({...eD,connections:{...eD.connections,[a]:t}})},provider:r}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{es(e),Y(!0)},onReconnect:()=>{"iflow"===r?q(!0):D(!0)},onDelete:()=>tF(e.id),oneByOneStatus:e1[e.id]||null})})]},e.id)}),x.length>10&&(0,i.jsx)(Pagination,{currentPage:tX,pageSize:y,totalItems:x.length,onPageChange:g,onPageSizeChange:e=>{b(e),g(1)},allowCustomPageSize:!0,maxPageSize:200})]}),t4=I.filter(e=>!0===e.isActive),t6=(0,i.jsx)(c.aF,{isOpen:et,onClose:tQ,title:`Apply Proxy (${x.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=I.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tZ(x.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:ek||0===t4.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tY(null),disabled:ek,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),I.map(e=>(0,i.jsxs)("button",{onClick:()=>tY(e.id),disabled:ek||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ek&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tQ,variant:"ghost",fullWidth:!0,disabled:ek,children:"Cancel"})]})}),t8=async e=>{if(!eh.has(e)){ef(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tv}/${e}`})}),a=await t.json();ep(t=>({...t,[e]:a.ok?"ok":"error"})),ex(a.ok?"":a.error||"Model not reachable")}catch{ep(t=>({...t,[e]:"error"})),ex("Network error")}finally{ef(t=>{let a=new Set(t);return a.delete(e),a})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tl)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let t7=()=>tu&&tl.apiType?"responses"===tl.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tx?"/providers/anthropic-m.png":(0,d.HY)(tl.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tl.color}15`},children:ed||!t7()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tl.color},children:tl.textIcon||tl.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:t7(),alt:tl.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tl.id),ec(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tl.name}),(tl.notice?.apiKeyUrl||tl.notice?.signupUrl||tl.website)&&(0,i.jsxs)("a",{href:tl.notice?.apiKeyUrl||tl.notice?.signupUrl||tl.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tl.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]}),(0,i.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,i.jsx)("input",{type:"number",min:"0",value:eE,placeholder:String(m.W[r]||0),onChange:e=>eR(e.target.value),onBlur:e=>tD(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,i.jsx)("select",{value:eI,onChange:e=>{var t;eO(t=e.target.value),tR(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:G.map(e=>(0,i.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tl.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tl.deprecationNotice})]}),tl.notice?.text&&!tl.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tl.notice.text}),tl.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tl.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),th&&T&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tx?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tx?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tx?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{H(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ee(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eB({title:"Delete Compatible Node",message:`Delete this ${tx?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eB(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),td?(0,i.jsx)(c.gw,{providerId:r}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[x.length>0&&I.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ea(!0),children:"Apply Proxy"}),x.length>0&&(0,i.jsxs)(i.Fragment,{children:[eb.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eb.length;0!==e&&eB({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eB(null);let e=0,t=[...eb];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}h(e=>e.filter(e=>!t.includes(e.id))),ev([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eb.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tL,disabled:eV,children:eV?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eV&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eV&&(e4.current=!0,eY(!0))},disabled:eZ,children:eZ?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eC,onChange:e=>{let t=e?"round-robin":null,a=e?eA||"1":eA;e&&!eA&&eT("1"),eS(t),tO(t,a)}}),"round-robin"===eC&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eA,onChange:e=>{var t;eT(t=e.target.value),tO("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tn?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tf&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tg," or ",ty,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tf?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:ta,children:tg}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:ti,children:ty})]}):(0,i.jsxs)(i.Fragment,{children:[!th&&"iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,children:th?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e5&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",e5.total]}),(0,i.jsxs)("span",{children:["Completed: ",e5.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e5.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e5.failed]}),e5.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eV&&eX&&(0,i.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eX)?.name||eX]})]})}),x.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:t5,onChange:()=>{t5?ev(e=>e.filter(e=>!t2.has(e))):ev(e=>{let t=new Set(e);for(let e of t2)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!th&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tf?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:ta,className:"w-full sm:w-auto",children:tg}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:ti,className:"w-full sm:w-auto",children:ty})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tj&&(0,i.jsx)("select",{value:e$,onChange:e=>{var t;eP(t=e.target.value),tE(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tj.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!th&&(e=[...tm,...eK.filter(e=>!tm.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eF.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eF.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tA,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tS(e),children:"Disable All"})]}))]}),!!eu&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eu}),(()=>{let e,t,a;if(th)return(0,i.jsx)(O,{providerStorageAlias:tv,providerDisplayAlias:tw,modelAliases:el,customModels:en,copied:e7,onCopy:e9,onSetAlias:tU,onDeleteAlias:tq,onAddCustomModel:e=>tz(e,"llm",tv),onDeleteCustomModel:e=>tM(e,"llm",tv),connections:x,isAnthropic:tx});let s=[...tm,...eK.filter(e=>!tm.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eF),n=s.filter(e=>!l.has(e.id)),o=s.filter(e=>l.has(e.id)),d=A({customModels:en,modelAliases:el,providerAlias:tv,builtInModels:tm,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tw}/${e.id}`,alias:e.alias,copied:e7,onCopy:e9,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tM(e.id,"llm",tv):tq(e.alias)},testStatus:em[e.id],onTest:x.length>0||td?()=>t8(e.id):void 0,isTesting:eh.has(e.id),isCustom:!0,isFree:!1,caps:u(`${r}/${e.id}`),thinkingSuffix:tb(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tv}/${e.id}`,a=`${r}/${e.id}`,s=Object.entries(el).find(([,e])=>e===t||e===a)?.[0];return(0,i.jsx)(P,{model:e,fullModel:`${tw}/${e.id}`,alias:s,copied:e7,onCopy:e9,onSetAlias:t=>tU(e.id,t,tv),onDeleteAlias:()=>tq(s),testStatus:em[e.id],onTest:x.length>0||td?()=>t8(e.id):void 0,isTesting:eh.has(e.id),isFree:e.isFree,onDisable:()=>tN(e.id),caps:u(`${r}/${e.id}`),thinkingSuffix:tb(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ey(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===r&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tK,disabled:e6,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e6?{animation:"spin 1s linear infinite"}:void 0,children:e6?"progress_activity":"download"}),e6?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),eU.length>0&&(e=new Set([...Object.values(el),...d.map(e=>e.fullModel)]),t=new Set(tm.map(e=>e.id)),0===(a=eU.filter(a=>!e.has(`${tv}/${a.id}`)&&!t.has(a.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tz(e.id,"llm",tv)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tC(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t6,"kiro"===r?(0,i.jsx)(c.Mh,{isOpen:R,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}):"cursor"===r?(0,i.jsx)(c.G9,{isOpen:R,onSuccess:tJ,onClose:()=>D(!1)}):"gitlab"===r?(0,i.jsx)(c.vj,{isOpen:R,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}):(0,i.jsx)(c.LF,{isOpen:R,provider:r,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}),"iflow"===r&&(0,i.jsx)(c.vE,{isOpen:_,onSuccess:()=>{tP(),q(!1)},onClose:()=>q(!1)}),(0,i.jsx)(z,{isOpen:M,provider:r,providerName:tl.name,isCompatible:th,isAnthropic:tx,authType:tl?.authType,authHint:tl?.authHint,website:tl?.website,proxyPools:I,error:L,existingNames:x.map(e=>e.name).filter(Boolean),onSave:tH,onBulkDone:tP,onClose:()=>{H(""),K(!1)}}),(0,i.jsx)(c.wI,{isOpen:Z,connection:ei,proxyPools:I,onSave:tB,onClose:()=>Y(!1)}),th&&(0,i.jsx)(F,{isOpen:X,node:T,onSave:tI,onClose:()=>ee(!1),isAnthropic:tx}),!th&&(0,i.jsx)(J,{isOpen:eg,providerAlias:tv,providerDisplayAlias:tw,onSave:async e=>{await tz(e,"llm",tv),ey(!1)},onClose:()=>ey(!1)}),"codex"===r&&(0,i.jsx)(B,{isOpen:V,onClose:()=>Q(!1),onSuccess:tP}),(0,i.jsx)(c.uo,{isOpen:eW,onClose:()=>eG(!1),onConfirm:()=>{(window.localStorage.setItem(te,"true"),eG(!1),tn)?tt():ti()},title:"Risk Notice",message:tl?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eH,onClose:()=>eB(null),onConfirm:eH?.onConfirm,title:eH?.title||"Confirm",message:eH?.message,variant:"danger"})]})}},85295:(e,t,a)=>{Promise.resolve().then(a.bind(a,80035))}},e=>{e.O(0,[8010,5772,8105,1321,801,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
14
+ ]`;function B({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,s.useState)(""),[n,o]=(0,s.useState)(!1),[d,m]=(0,s.useState)(""),[p,u]=(0,s.useState)(null),x=()=>{n||(r(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let s=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!s||0===s.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:s})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:H,value:l,onChange:e=>r(e.target.value),disabled:n}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,N.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,N.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}B.propTypes={isOpen:$().bool.isRequired,onClose:$().func.isRequired,onSuccess:$().func};let W={claude:"claudeAutoPing",codex:"codexAutoPing"},G=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function V(){let e,t=(0,l.useParams)(),a=(0,l.useRouter)(),r=t.id,{getCaps:u}=(0,k.y)(),[x,h]=(0,s.useState)([]),[f,g]=(0,s.useState)(1),[y,b]=(0,s.useState)(10),[v,C]=(0,s.useState)(!0),[T,$]=(0,s.useState)(null),[I,E]=(0,s.useState)([]),[R,D]=(0,s.useState)(!1),[_,q]=(0,s.useState)(!1),[M,K]=(0,s.useState)(!1),[L,H]=(0,s.useState)(""),[V,Q]=(0,s.useState)(!1),[Z,Y]=(0,s.useState)(!1),[X,ee]=(0,s.useState)(!1),[et,ea]=(0,s.useState)(!1),[ei,es]=(0,s.useState)(null),[el,er]=(0,s.useState)({}),[en,eo]=(0,s.useState)([]),[ed,ec]=(0,s.useState)(!1),[em,ep]=(0,s.useState)({}),[eu,ex]=(0,s.useState)(""),[eh,ef]=(0,s.useState)(()=>new Set),[eg,ey]=(0,s.useState)(!1),[eb,ev]=(0,s.useState)([]),[ej,ew]=(0,s.useState)("__none__"),[ek,eN]=(0,s.useState)(!1),[eC,eS]=(0,s.useState)(null),[eA,eT]=(0,s.useState)(""),[e$,eP]=(0,s.useState)("auto"),[eI,eO]=(0,s.useState)("auto"),[eE,eR]=(0,s.useState)(""),[eD,e_]=(0,s.useState)({enabled:!1,connections:{}}),[eU,eq]=(0,s.useState)([]),[ez,eM]=(0,s.useState)([]),[eK,eL]=(0,s.useState)([]),[eF,eJ]=(0,s.useState)([]),[eH,eB]=(0,s.useState)(null),[eW,eG]=(0,s.useState)(!1),[eV,eQ]=(0,s.useState)(!1),[eZ,eY]=(0,s.useState)(!1),[eX,e0]=(0,s.useState)(null),[e1,e2]=(0,s.useState)({}),[e5,e3]=(0,s.useState)(null),e4=(0,s.useRef)(!1),[e6,e8]=(0,s.useState)(!1),{copied:e7,copy:e9}=(0,w.C)(),te="ag_risk_confirmed",tt=()=>{D(!0)},ta=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(te)?eG(!0):tn?tt():(H(""),K(!0))},ti=()=>{H(""),K(!0)},ts=()=>{tn?ta():ti()},tl=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r]||m.br[r],tr=tl?.authModes||[],tn=!!m.zN[r]||!!m.IS[r]||tr.includes("oauth"),to=!!m.fg[r]||tr.includes("apikey"),td=!!m.IS[r]?.noAuth,tc=(0,p.KC)(r),tm="cursor"===r&&ez.length>0?ez:tc,tp=(0,m.wG)(r),tu=(0,m.mq)(r),tx=(0,m.gb)(r),th=tu||tx,tf=!th&&tn&&to,tg="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"OAuth",ty="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"API Key",tb=e=>{if(!e$||"auto"===e$)return null;let t=j(r,e);return t&&t.includes(e$)?e$:null},tv=th?r:tp,tj=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let i=j(r,a);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tm)a(e.id);for(let e of eK)a(e.id);for(let e of en)e.providerAlias===tv&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),tw=th?T?.prefix||r:tp,tk=(0,s.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}`,{cache:"no-store"}),t=await e.json();e.ok&&eJ(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tv]),tN=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tv,ids:[e]})})).ok&&await tk()}catch(e){console.log("Error disabling model:",e)}},tC=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tk()}catch(e){console.log("Error enabling model:",e)}},tS=async e=>{e.length&&eB({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eB(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tv,ids:e})})).ok&&await tk()}catch(e){console.log("Error disabling all models:",e)}}})},tA=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tv)}`,{method:"DELETE"})).ok&&await tk()}catch(e){console.log("Error enabling all models:",e)}},tT=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&er(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t$=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eo(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,s.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eL(e.models)}).catch(()=>{})},[r]);let tP=(0,s.useCallback)(async()=>{try{let[e,t,a,i]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(r)}`,{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),s=await e.json(),l=await t.json(),n=await a.json(),o=i.ok?await i.json():{};e.ok&&h(s.connections||[]),a.ok&&E(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};eS(d.fallbackStrategy||null),eT(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};eP(c.mode||"auto");let m=(o.retryDelayByProvider||{})[r];eO(null!=m&&"auto"!==m?String(m):"auto");let p=(o.rpmByProvider||{})[r];eR(null!=p?String(p):"");let u=W[r],x=u&&o[u]||{};if(e_({enabled:!0===x.enabled,connections:x.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&th)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[r,th]),tI=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&($(a.node),await tP(),ee(!1))}catch(e){console.log("Error updating provider node:",e)}},tO=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),i=(a.ok?await a.json():{}).providerStrategies||{},s={};e&&(s.fallbackStrategy=e),"round-robin"===e&&""!==t&&(s.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(s).length?delete l[r]:l[r]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tE=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[r]={mode:e}:delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tR=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?a[r]=Number(e):delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:a})})}catch(e){console.log("Error saving retry delay:",e)}},tD=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).rpmByProvider||{}},i=String(e??"").trim();""===i?delete a[r]:a[r]=Math.max(0,Number(i)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:a})})}catch(e){console.log("Error saving RPM limit:",e)}},t_=async e=>{let t=W[r];if(t){e_(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,s.useEffect)(()=>{tP(),tT(),t$(),tk()},[tP,tT,t$,tk]),(0,s.useEffect)(()=>{if("cursor"!==r)return void eM([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void eM([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eM(a.models)}).catch(()=>{}),()=>{t=!0}},[r,x]),(0,s.useEffect)(()=>{let e=(m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r])?.modelsFetcher;e&&S(e).then(eq)},[r]);let tU=async(e,t,a=tp)=>{let i=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tT();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tq=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tT()}catch(e){console.log("Error deleting alias:",e)}},tz=async(e,t="llm",a=tv)=>{try{let i=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(i.ok)await t$(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await i.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tM=async(e,t="llm",a=tv)=>{try{let i=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await t$(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tK=async()=>{if(e6)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Qoder connection first"));e8(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,N.Tl)("Failed to fetch models"));let i=a.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let s=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");en.some(e=>e.providerAlias===tv&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(el).includes(`${tv}/${a}`)||(await tz(a,"llm",tv),s+=1)}0===s?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${s} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{e8(!1)}},tL=async()=>{if(eV||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));e4.current=!1,eQ(!0),eY(!1),e0(null),e2(e),e3({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<x.length;e+=1){if(e4.current){e3({total:x.length,completed:e,passed:t,failed:a,stopped:!0});break}let i=x[e];e0(i.id),e2(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),s=await e.json(),l=!!s.valid;l?t+=1:a+=1,e2(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:s.error||null}}))}catch(e){a+=1,e2(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e3({total:x.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e0(null),eQ(!1),eY(!1),e4.current=!1}},tF=async e=>{eB({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eB(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tJ=()=>{tP(),D(!1)},tH=async e=>{H("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tP(),K(!1);return}H(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),H("Failed to save connection")}},tB=async e=>{try{(await fetch(`/api/providers/${ei.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tP(),Y(!1))}catch(e){console.log("Error updating connection:",e)}},tW=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tG=async(e,t)=>{let a=[...x];[a[e],a[t]]=[a[t],a[e]],h(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tP()}},tV=x.filter(e=>eb.includes(e.id));(0,s.useEffect)(()=>{ev(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tV.length)return;let e=new Set(tV.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=I.find(e=>e.id===t);return a?.name}})();let tQ=()=>{ek||ea(!1)},tZ=async e=>{eN(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tP(),ea(!1)}finally{eN(!1)}},tY=e=>tZ(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:tX,items:t0,start:t1}=function(e=[],t=1,a=10){let i=Array.isArray(e)?e:[],s=Number.isFinite(a)&&a>=1?Math.floor(a):10,l=i.length,r=Math.max(1,Math.ceil(l/s)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,r),d=(o-1)*s,c=i.slice(d,d+s);return{currentPage:o,totalPages:r,totalItems:l,start:d,items:c,pageSize:s}}(x,f,y),t2=new Set(t0.map(e=>e.id)),t5=t0.length>0&&t0.every(e=>eb.includes(e.id)),t3=(0,i.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[t0.map((e,t)=>{let a,s=t1+t;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(a=e.id,eb.includes(a)),onChange:()=>{var t;return t=e.id,void ev(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(U,{connection:e,proxyPools:I,isOAuth:tn,isFirst:0===s,isLast:s===x.length-1,onMoveUp:()=>tG(s,s-1),onMoveDown:()=>tG(s,s+1),onToggleActive:t=>tW(e.id,t),autoPing:W[r]&&"oauth"===e.authType?{on:!0===eD.connections[e.id],onToggle:t=>{var a;return a=e.id,void t_({...eD,connections:{...eD.connections,[a]:t}})},provider:r}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{es(e),Y(!0)},onReconnect:()=>{"iflow"===r?q(!0):D(!0)},onDelete:()=>tF(e.id),oneByOneStatus:e1[e.id]||null})})]},e.id)}),x.length>10&&(0,i.jsx)(c.dK,{currentPage:tX,pageSize:y,totalItems:x.length,onPageChange:g,onPageSizeChange:e=>{b(e),g(1)},allowCustomPageSize:!0,maxPageSize:200})]}),t4=I.filter(e=>!0===e.isActive),t6=(0,i.jsx)(c.aF,{isOpen:et,onClose:tQ,title:`Apply Proxy (${x.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=I.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tZ(x.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:ek||0===t4.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tY(null),disabled:ek,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),I.map(e=>(0,i.jsxs)("button",{onClick:()=>tY(e.id),disabled:ek||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ek&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tQ,variant:"ghost",fullWidth:!0,disabled:ek,children:"Cancel"})]})}),t8=async e=>{if(!eh.has(e)){ef(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tv}/${e}`})}),a=await t.json();ep(t=>({...t,[e]:a.ok?"ok":"error"})),ex(a.ok?"":a.error||"Model not reachable")}catch{ep(t=>({...t,[e]:"error"})),ex("Network error")}finally{ef(t=>{let a=new Set(t);return a.delete(e),a})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tl)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let t7=()=>tu&&tl.apiType?"responses"===tl.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tx?"/providers/anthropic-m.png":(0,d.HY)(tl.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tl.color}15`},children:ed||!t7()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tl.color},children:tl.textIcon||tl.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:t7(),alt:tl.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tl.id),ec(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tl.name}),(tl.notice?.apiKeyUrl||tl.notice?.signupUrl||tl.website)&&(0,i.jsxs)("a",{href:tl.notice?.apiKeyUrl||tl.notice?.signupUrl||tl.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tl.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]}),(0,i.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,i.jsx)("input",{type:"number",min:"0",value:eE,placeholder:String(m.W[r]||0),onChange:e=>eR(e.target.value),onBlur:e=>tD(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,i.jsx)("select",{value:eI,onChange:e=>{var t;eO(t=e.target.value),tR(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:G.map(e=>(0,i.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tl.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tl.deprecationNotice})]}),tl.notice?.text&&!tl.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tl.notice.text}),tl.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tl.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),th&&T&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tx?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tx?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tx?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{H(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ee(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eB({title:"Delete Compatible Node",message:`Delete this ${tx?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eB(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),td?(0,i.jsx)(c.gw,{providerId:r}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[x.length>0&&I.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ea(!0),children:"Apply Proxy"}),x.length>0&&(0,i.jsxs)(i.Fragment,{children:[eb.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eb.length;0!==e&&eB({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eB(null);let e=0,t=[...eb];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}h(e=>e.filter(e=>!t.includes(e.id))),ev([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eb.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tL,disabled:eV,children:eV?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eV&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eV&&(e4.current=!0,eY(!0))},disabled:eZ,children:eZ?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eC,onChange:e=>{let t=e?"round-robin":null,a=e?eA||"1":eA;e&&!eA&&eT("1"),eS(t),tO(t,a)}}),"round-robin"===eC&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eA,onChange:e=>{var t;eT(t=e.target.value),tO("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tn?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tf&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tg," or ",ty,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tf?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:ta,children:tg}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:ti,children:ty})]}):(0,i.jsxs)(i.Fragment,{children:[!th&&"iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,children:th?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e5&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",e5.total]}),(0,i.jsxs)("span",{children:["Completed: ",e5.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e5.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e5.failed]}),e5.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eV&&eX&&(0,i.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eX)?.name||eX]})]})}),x.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:t5,onChange:()=>{t5?ev(e=>e.filter(e=>!t2.has(e))):ev(e=>{let t=new Set(e);for(let e of t2)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!th&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tf?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:ta,className:"w-full sm:w-auto",children:tg}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:ti,className:"w-full sm:w-auto",children:ty})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tj&&(0,i.jsx)("select",{value:e$,onChange:e=>{var t;eP(t=e.target.value),tE(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tj.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!th&&(e=[...tm,...eK.filter(e=>!tm.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eF.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eF.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tA,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tS(e),children:"Disable All"})]}))]}),!!eu&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eu}),(()=>{let e,t,a;if(th)return(0,i.jsx)(O,{providerStorageAlias:tv,providerDisplayAlias:tw,modelAliases:el,customModels:en,copied:e7,onCopy:e9,onSetAlias:tU,onDeleteAlias:tq,onAddCustomModel:e=>tz(e,"llm",tv),onDeleteCustomModel:e=>tM(e,"llm",tv),connections:x,isAnthropic:tx});let s=[...tm,...eK.filter(e=>!tm.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eF),n=s.filter(e=>!l.has(e.id)),o=s.filter(e=>l.has(e.id)),d=A({customModels:en,modelAliases:el,providerAlias:tv,builtInModels:tm,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tw}/${e.id}`,alias:e.alias,copied:e7,onCopy:e9,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tM(e.id,"llm",tv):tq(e.alias)},testStatus:em[e.id],onTest:x.length>0||td?()=>t8(e.id):void 0,isTesting:eh.has(e.id),isCustom:!0,isFree:!1,caps:u(`${r}/${e.id}`),thinkingSuffix:tb(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tv}/${e.id}`,a=`${r}/${e.id}`,s=Object.entries(el).find(([,e])=>e===t||e===a)?.[0];return(0,i.jsx)(P,{model:e,fullModel:`${tw}/${e.id}`,alias:s,copied:e7,onCopy:e9,onSetAlias:t=>tU(e.id,t,tv),onDeleteAlias:()=>tq(s),testStatus:em[e.id],onTest:x.length>0||td?()=>t8(e.id):void 0,isTesting:eh.has(e.id),isFree:e.isFree,onDisable:()=>tN(e.id),caps:u(`${r}/${e.id}`),thinkingSuffix:tb(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ey(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===r&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tK,disabled:e6,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e6?{animation:"spin 1s linear infinite"}:void 0,children:e6?"progress_activity":"download"}),e6?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),eU.length>0&&(e=new Set([...Object.values(el),...d.map(e=>e.fullModel)]),t=new Set(tm.map(e=>e.id)),0===(a=eU.filter(a=>!e.has(`${tv}/${a.id}`)&&!t.has(a.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tz(e.id,"llm",tv)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tC(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t6,"kiro"===r?(0,i.jsx)(c.Mh,{isOpen:R,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}):"cursor"===r?(0,i.jsx)(c.G9,{isOpen:R,onSuccess:tJ,onClose:()=>D(!1)}):"gitlab"===r?(0,i.jsx)(c.vj,{isOpen:R,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}):(0,i.jsx)(c.LF,{isOpen:R,provider:r,providerInfo:tl,onSuccess:tJ,onClose:()=>D(!1)}),"iflow"===r&&(0,i.jsx)(c.vE,{isOpen:_,onSuccess:()=>{tP(),q(!1)},onClose:()=>q(!1)}),(0,i.jsx)(z,{isOpen:M,provider:r,providerName:tl.name,isCompatible:th,isAnthropic:tx,authType:tl?.authType,authHint:tl?.authHint,website:tl?.website,proxyPools:I,error:L,existingNames:x.map(e=>e.name).filter(Boolean),onSave:tH,onBulkDone:tP,onClose:()=>{H(""),K(!1)}}),(0,i.jsx)(c.wI,{isOpen:Z,connection:ei,proxyPools:I,onSave:tB,onClose:()=>Y(!1)}),th&&(0,i.jsx)(F,{isOpen:X,node:T,onSave:tI,onClose:()=>ee(!1),isAnthropic:tx}),!th&&(0,i.jsx)(J,{isOpen:eg,providerAlias:tv,providerDisplayAlias:tw,onSave:async e=>{await tz(e,"llm",tv),ey(!1)},onClose:()=>ey(!1)}),"codex"===r&&(0,i.jsx)(B,{isOpen:V,onClose:()=>Q(!1),onSuccess:tP}),(0,i.jsx)(c.uo,{isOpen:eW,onClose:()=>eG(!1),onConfirm:()=>{(window.localStorage.setItem(te,"true"),eG(!1),tn)?tt():ti()},title:"Risk Notice",message:tl?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eH,onClose:()=>eB(null),onConfirm:eH?.onConfirm,title:eH?.title||"Confirm",message:eH?.message,variant:"danger"})]})}},85295:(e,t,a)=>{Promise.resolve().then(a.bind(a,80035))}},e=>{e.O(0,[8010,5772,8105,1321,801,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
package/app/CHANGELOG.md CHANGED
@@ -17,8 +17,10 @@
17
17
  - Updated Skills dashboard display name to `EzRouter (Entry)`.
18
18
 
19
19
  ## Fixes
20
- - **Provider Details & Accounts**:
21
- - Fixed template string syntax in `src/app/(dashboard)/dashboard/providers/[id]/page.js` (`fetchConnections` was sending literal string `"${encodeURIComponent(providerId)}"` instead of evaluating `providerId`, causing 0 accounts to show in provider connection list).
20
+ - **Provider Details & Pagination**:
21
+ - Restored `Pagination` import in `src/app/(dashboard)/dashboard/providers/[id]/page.js`, fixing runtime render crash when a provider has >10 accounts (e.g. Antigravity with 11 accounts).
22
+ - Fixed `getProviderStats` and `freeTierEntries` in `src/app/(dashboard)/dashboard/providers/page.js` to dynamically match all valid connection types (`oauth`, `apikey`, `api_key`, `cookie`), ensuring accurate account counts on overview cards.
23
+ - Fixed template string syntax in `src/app/(dashboard)/dashboard/providers/[id]/page.js` (`fetchConnections` was sending literal string `"${encodeURIComponent(providerId)}"` instead of evaluating `providerId`).
22
24
  - **CLI Tools & Media Combo Configurations**:
23
25
  - Updated legacy hardcoded port `20128` fallbacks to dynamic `window.location.origin` / `20126` in Media Combo details, DeepSeek TUI, Hermes, Grok Build, OpenClaw, JCode, and CLI tools cards.
24
26
  - Updated JCode settings route to recognize both port 20126 and 20128 configurations.
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezrouter-app",
3
- "version": "0.5.70",
3
+ "version": "0.5.71",
4
4
  "description": "9Router web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
@@ -17,8 +17,10 @@
17
17
  - Updated Skills dashboard display name to `EzRouter (Entry)`.
18
18
 
19
19
  ## Fixes
20
- - **Provider Details & Accounts**:
21
- - Fixed template string syntax in `src/app/(dashboard)/dashboard/providers/[id]/page.js` (`fetchConnections` was sending literal string `"${encodeURIComponent(providerId)}"` instead of evaluating `providerId`, causing 0 accounts to show in provider connection list).
20
+ - **Provider Details & Pagination**:
21
+ - Restored `Pagination` import in `src/app/(dashboard)/dashboard/providers/[id]/page.js`, fixing runtime render crash when a provider has >10 accounts (e.g. Antigravity with 11 accounts).
22
+ - Fixed `getProviderStats` and `freeTierEntries` in `src/app/(dashboard)/dashboard/providers/page.js` to dynamically match all valid connection types (`oauth`, `apikey`, `api_key`, `cookie`), ensuring accurate account counts on overview cards.
23
+ - Fixed template string syntax in `src/app/(dashboard)/dashboard/providers/[id]/page.js` (`fetchConnections` was sending literal string `"${encodeURIComponent(providerId)}"` instead of evaluating `providerId`).
22
24
  - **CLI Tools & Media Combo Configurations**:
23
25
  - Updated legacy hardcoded port `20128` fallbacks to dynamic `window.location.origin` / `20126` in Media Combo details, DeepSeek TUI, Hermes, Grok Build, OpenClaw, JCode, and CLI tools cards.
24
26
  - Updated JCode settings route to recognize both port 20126 and 20128 configurations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbi696/ezrouter",
3
- "version": "0.5.70",
3
+ "version": "0.5.71",
4
4
  "description": "EzRouter CLI - Start and manage EzRouter server (default port 20126)",
5
5
  "bin": {
6
6
  "ezrouter": "./cli.js"